-
Notifications
You must be signed in to change notification settings - Fork 222
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
Forward trajectory controller #944
base: main
Are you sure you want to change the base?
Conversation
I cannot reproduce your build errors, are you up-to-date with the packages listed in As for the general idea, i don't think the forwarding controller should be derived from the JTC at all as it doesn't do any spline interpolation itself. You can just derive directly from The main problem we will have is encoding the trajectory in a way that it reaches the hardware interface. In ROS 1, we could just define |
I am up-to-date on everything, as far as i can tell, but I have started working while deriving from ControllerInterface and that works fine, so i will just continue on that. |
The controller is now functional, and you should be able to test it out yourself. A user can give the controller a trajectory to forward via the action server running on the controller. It is possible to define trajectories with just positions, or with both positions and velocities and/or accelerations. The trajectory is transferred to the hardware interface via the command interfaces, before the hardware interface then transfers it to the robot. |
c7eea3c
to
983bc62
Compare
20fe4a6
to
a8b83ff
Compare
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.
This is looking very promising but I think we have to iterate this a couple of times, since this is a rather big change :-)
ur_controllers/include/ur_controllers/passthrough_trajectory_controller.hpp
Outdated
Show resolved
Hide resolved
ur_controllers/include/ur_controllers/passthrough_trajectory_controller.hpp
Outdated
Show resolved
Hide resolved
a8b83ff
to
8e8f88f
Compare
Creates errors on compilation due to multiple definition of funtions.
…upports passing through accelerations and velocities.
The number of joints in the controller is variable and received from the hardware interface. (It is not variable there though). The internal action server uses the action type FollowJointTrajectory. Both goal time tolerance and goal position tolerance are checked upon completion of trajectory, and feedback is sent to the user. The integration test has also been updated to test the controller.
Did some cleanup of comments and print statements. Improved the examples, so they are easier to use.
Moved functionality of passthrough controller from separate execute loop in to controller's update method. Also changed how the controller checks validity of a received trajectory, and how it communicates that to the hardware interface.
8e8f88f
to
4c9d9b6
Compare
Command and state interfaces are now only interacted with within the update method. The update method still triggers some action server callbacks, so it is not threadsafe yet, but i dont know how to trigger the action server without having them in the update method.
ur_controllers/include/ur_controllers/passthrough_trajectory_controller.hpp
Outdated
Show resolved
Hide resolved
This should making it drop in easier
This gets started by the initial joint_controller
url: https://github.com/pal-robotics-forks/ros2_control.git | ||
version: fix/controller_update_period |
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.
url: https://github.com/pal-robotics-forks/ros2_control.git | |
version: fix/controller_update_period | |
url: https://github.com/ros-controls/ros2_control.git | |
version: master |
url: https://github.com/pal-robotics-forks/ros2_control.git | ||
version: fix/controller_update_period |
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.
url: https://github.com/pal-robotics-forks/ros2_control.git | |
version: fix/controller_update_period | |
url: https://github.com/ros-controls/ros2_control.git | |
version: master |
Make passthrough command interfaces part of the joints and fix claiming conflicts
If we want to use other types for forwarding such as Cartesian setpoints or motion primitives it doesn't really make sense to have this as a part of the joints.
This reverts commit e224dfa.
This should be thread-safe in contrast to calling it from the AsyncIO thread.
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.
Works nicely and looks good, I just have some minor suggestions.
ur_controllers/include/ur_controllers/passthrough_trajectory_controller.hpp
Outdated
Show resolved
Hide resolved
|
||
if (current_index_ == 0 && current_transfer_state == TRANSFER_STATE_IDLE) { | ||
active_trajectory_elapsed_time_ = rclcpp::Duration(0, 0); | ||
rclcpp::Duration::from_seconds(duration_to_double(active_joint_traj_.points.back().time_from_start)); |
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.
Is this line useful? Because it is not assigned to anything and then it's repeated immediately after but assigned to max_trajectory_time
Co-authored-by: Vincenzo Di Pentima <[email protected]>
This reverts commit bc76a61.
The controller should be able to forward a cartesian tracjectory to the robot for interpolation.
Creates errors on compilation due to multiple definition of functions, when inheriting from the joint_trajectory_controller. But looking at the passthrough controllers from ROS1 that may not be the right controller to use anyway?
All inputs are welcome.
closes #839