forked from ros-controls/ros2_controllers
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge main #1
Merged
Merged
Merge main #1
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
a7e3777
Create PID Controller package.
destogl 3667a20
Updated PID controller with functionality.
destogl eb6c296
Move parameter read and check into separate method for easier inherit…
destogl 1b387c7
Small fixes of pid_controller for compilation.
destogl 22f7094
Correct dependencies of PID controller.
destogl c076bda
Debug PID controller to actually work.
destogl 3dea74c
Remove validation file since it is not needed.
destogl f451038
Delete LICENSE
destogl 7c47ae0
Simplify things in the PID controller and add some error management.
destogl dacd8ea
Update CMake export in pid-controller
tylerjw a1eb1ac
Cleaning CMakeLists and deprecation from PID controller and starting …
destogl a423cc9
pid_controller compiles, tests need adjustments
muritane 314adb7
all tests in test_pid_controller are green
muritane 4e40be8
test_pid_controller_preceeding: all green
muritane edce147
Update pid_controller/include/pid_controller/pid_controller.hpp
destogl 56e1a6e
Apply suggestions from code review
destogl 703ee25
Apply suggestions from code review
destogl b11a67c
Rename test_pid_controller_preceeding.cpp to test_pid_controller_prec…
destogl d5bb3a6
Rename pid_controller_preceeding_params.yaml to pid_controller_preced…
destogl 9145987
Update pid_controller/CMakeLists.txt
destogl d229ed8
Update pid_controller/test/test_pid_controller.cpp
destogl f1b6bca
More fixups for PID after renaming stuff in the message.
destogl 0733d01
Apply suggestions from code review
destogl 2fd0490
Add user doc
destogl 00d03b7
Update controllers_index.rst
destogl 072600e
Apply suggestions from code review
destogl a9868dc
Fixup formatting.
destogl 5ddf108
Squashed commit of the following:
destogl b84b40a
Add reseting of individual DoFs to state values in JTC when using in …
destogl edc703b
Fix missing .cpp extension in CMakeLists for CTG
bijoua29 8b2761b
Fix unused variable compiler warning in pid_controller tests
bijoua29 81ca561
Added structures for joint limits.
destogl 06d5f0b
Integrate SimpleJointLimiter in to JTC.
destogl 8b97f22
Adjust default value of limiters.
destogl 3ecaaa3
Fix missing .cpp extension in CMakeLists for CTG
bijoua29 7e4d851
Fix unused variable compiler warning in pid_controller tests
bijoua29 bcbb3fc
Added support for save integral term parameter
Whalex451 520a099
Applied suggestions from code review
Whalex451 8c6fff8
More comment updates
Whalex451 b41f5f7
Merge pull request #5 from SchillingRobotics/Add-support-for-new-para…
Whalex451 2ae8260
Check measured state for null to determine if hardware state available
bijoua29 cb851b4
Fix pre-commit warnings not related to changes in this branch
bijoua29 069ec65
Remove unused variable
bijoua29 1b4ee7b
Fix bug in processing read of state from hardware
bijoua29 61f6eee
Remove deprecated rclcpp/qos_event.hpp
bijoua29 eb1cd2b
Remove unused free functions for resetting controlled feedback messages
bijoua29 e495783
Use time from start passed in from input reference if non-zero in CTG
bijoua29 dfbd63e
Merge pull request #8 from SchillingRobotics/ctg-use-time-from-start
destogl 2fb152c
Modify CTG to expect twist in measured state input to be in body frame
bijoua29 3cc05db
Update comment
bijoua29 486c078
Merge pull request #9 from SchillingRobotics/ctg-meas-state-twist-body
bijoua29 92e7139
Update PIDController to enable parameter updates.
destogl 6b118f4
Handle NaNs in measured state in CTG
bijoua29 8ca56ef
Merge pull request #10 from SchillingRobotics/bijoua/handle_meas_stat…
bijoua29 06b35a1
Add cartesian state into CTG.
destogl 71c128a
Fix stair step in JTC when new trajectory message received
bijoua29 4411276
Reset initial value of last commanded time to 0.
destogl 0c83a41
Use previous state for limiters.
destogl 68920c4
Use values, if present in reset dofs service, instead of fb to reset
bijoua29 986de2d
Merge pull request #11 from SchillingRobotics/bijoua/update_reset_dof…
bijoua29 377ebb9
Fix bug when two reset dofs req sent without being processed in between
bijoua29 0756f14
Update reset dofs output messages in JTC
bijoua29 8af535b
Merge pull request #12 from SchillingRobotics/bijoua/fix_reset_dofs_bug
bijoua29 bbaee37
Remove service for setting joint limits in CTG.
destogl b6b8ba7
Merge remote-tracking branch 'upstream/master' into merge_main
henrygerardmoore 17515b1
wip JTC fix
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
...jectory_controller/include/joint_trajectory_controller/cartesian_trajectory_generator.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Copyright (c) 2023 Stogl Robotics Consulting UG (haftungsbeschränkt) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef JOINT_TRAJECTORY_CONTROLLER__CARTESIAN_TRAJECTORY_GENERATOR_HPP_ | ||
#define JOINT_TRAJECTORY_CONTROLLER__CARTESIAN_TRAJECTORY_GENERATOR_HPP_ | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
#include "control_msgs/msg/cartesian_trajectory_generator_state.hpp" | ||
#include "geometry_msgs/msg/pose.hpp" | ||
#include "geometry_msgs/msg/transform_stamped.hpp" | ||
#include "joint_limits/joint_limits.hpp" | ||
#include "joint_trajectory_controller/joint_trajectory_controller.hpp" | ||
#include "nav_msgs/msg/odometry.hpp" | ||
#include "trajectory_msgs/msg/multi_dof_joint_trajectory_point.hpp" | ||
|
||
using namespace std::chrono_literals; // NOLINT | ||
|
||
namespace cartesian_trajectory_generator | ||
{ | ||
class CartesianTrajectoryGenerator : public joint_trajectory_controller::JointTrajectoryController | ||
{ | ||
public: | ||
JOINT_TRAJECTORY_CONTROLLER_PUBLIC | ||
CartesianTrajectoryGenerator(); | ||
|
||
/** | ||
* @brief command_interface_configuration This controller requires the position and velocity | ||
* state interfaces for the controlled joints | ||
*/ | ||
JOINT_TRAJECTORY_CONTROLLER_PUBLIC | ||
controller_interface::InterfaceConfiguration state_interface_configuration() const override; | ||
|
||
JOINT_TRAJECTORY_CONTROLLER_PUBLIC | ||
controller_interface::CallbackReturn on_configure( | ||
const rclcpp_lifecycle::State & previous_state) override; | ||
|
||
JOINT_TRAJECTORY_CONTROLLER_PUBLIC | ||
controller_interface::CallbackReturn on_activate( | ||
const rclcpp_lifecycle::State & previous_state) override; | ||
|
||
using ControllerReferenceMsg = trajectory_msgs::msg::MultiDOFJointTrajectoryPoint; | ||
using ControllerFeedbackMsg = nav_msgs::msg::Odometry; | ||
|
||
protected: | ||
bool read_state_from_hardware(JointTrajectoryPoint & state) override; | ||
|
||
using JointTrajectoryPoint = trajectory_msgs::msg::JointTrajectoryPoint; | ||
JOINT_TRAJECTORY_CONTROLLER_PUBLIC | ||
void publish_state( | ||
const rclcpp::Time & time, const JointTrajectoryPoint & desired_state, | ||
const JointTrajectoryPoint & current_state, const JointTrajectoryPoint & state_error, | ||
const JointTrajectoryPoint & splines_output, const JointTrajectoryPoint & ruckig_input_target, | ||
const JointTrajectoryPoint & ruckig_input) override; | ||
|
||
// Command subscribers and Controller State publisher | ||
rclcpp::Subscription<ControllerReferenceMsg>::SharedPtr ref_subscriber_ = nullptr; | ||
rclcpp::Subscription<ControllerReferenceMsg>::SharedPtr ref_subscriber_reliable_ = nullptr; | ||
realtime_tools::RealtimeBuffer<std::shared_ptr<ControllerReferenceMsg>> reference_world_; | ||
|
||
rclcpp::Subscription<ControllerFeedbackMsg>::SharedPtr feedback_subscriber_ = nullptr; | ||
realtime_tools::RealtimeBuffer<std::shared_ptr<ControllerFeedbackMsg>> feedback_; | ||
|
||
trajectory_msgs::msg::JointTrajectoryPoint control_output_local_; | ||
|
||
private: | ||
void reference_callback(const std::shared_ptr<ControllerReferenceMsg> msg); | ||
|
||
using CartControllerStateMsg = control_msgs::msg::CartesianTrajectoryGeneratorState; | ||
using CartStatePublisher = realtime_tools::RealtimePublisher<CartControllerStateMsg>; | ||
using CartStatePublisherPtr = std::unique_ptr<CartStatePublisher>; | ||
rclcpp::Publisher<CartControllerStateMsg>::SharedPtr cart_publisher_; | ||
CartStatePublisherPtr cart_state_publisher_; | ||
|
||
std::vector<joint_limits::JointLimits> configured_joint_limits_; | ||
|
||
// storage of last received measured position to | ||
geometry_msgs::msg::Pose last_received_measured_position_; | ||
}; | ||
|
||
} // namespace cartesian_trajectory_generator | ||
|
||
#endif // JOINT_TRAJECTORY_CONTROLLER__CARTESIAN_TRAJECTORY_GENERATOR_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me see if it can be re-enabled. If I remember correctly, it was making the build fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, the test is using the old version of trajectory.sample. There are a lot of them, so I thought I would leave re-enabling it until later (since the fix is more involved than just a find and replace, too). Is that okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we change trajectory.sample in our fork? Then it is ok as it will get fixed when we merge upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we changed that in our fork and it should be fixed when we merge upstream