generated from Robotic-Decision-Making-Lab/ros2-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Port end effector trajectory controller from Angler #54
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
Merged
Merged
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
03e3ca3
testing gif in readme
evan-palmer 97c92d5
format
evan-palmer adb8a4b
bleh
evan-palmer 80af8df
Added reference to blue docs
evan-palmer 1203610
Cleanup folders
evan-palmer 06d19f8
implemented trajectory
evan-palmer b9379b6
whoops
evan-palmer a58caaa
ee controller mvp done
evan-palmer 41724dc
added error tolerance for execution
evan-palmer 8631aba
add controller state publishing
evan-palmer 336ebb8
fix compilation errors
evan-palmer 34ef8b9
update version and changelogs
evan-palmer 476aa75
Start implementing action server interface
evan-palmer 32947d9
adding action server and improving logic
evan-palmer 45fbda8
updates
evan-palmer 935b80a
controller ready for testing
evan-palmer 73a72bf
add pluginlib description
evan-palmer f4629b3
fix pluginlib
evan-palmer d98ddb1
fix plugin registration
evan-palmer f338f2d
reintegrate default constructor
evan-palmer c8f03b4
fix library build
evan-palmer 62adc17
add transform to chained references in ik controller
evan-palmer 34f0552
bug fixes
evan-palmer 3cf0b4c
bug fixes
evan-palmer 06f965c
added readme
evan-palmer d71a6dc
fix slerp
evan-palmer 7aa5245
fix link to blue docs
evan-palmer 9a701d5
add changelogs
evan-palmer dfd39d5
fix ci errors and pr comments
evan-palmer a0d3efe
cleanup
evan-palmer 2c8b066
bad idea :D
evan-palmer 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| <package format="3"> | ||
|
|
||
| <name>auv_control_demos</name> | ||
| <version>0.1.0</version> | ||
| <version>0.2.0</version> | ||
| <description>Example package that includes demos for using auv_controllers in individual and chained modes</description> | ||
|
|
||
| <maintainer email="[email protected]">Colin Mitchell</maintainer> | ||
|
|
||
This file contains hidden or 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 hidden or 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
21 changes: 21 additions & 0 deletions
21
auv_control_msgs/action/FollowEndEffectorTrajectory.action
This file contains hidden or 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,21 @@ | ||
| auv_control_msgs/EndEffectorTrajectory trajectory | ||
|
|
||
| float64 path_tolerance | ||
|
|
||
| float64 goal_tolerance | ||
|
|
||
| --- | ||
| int32 error_code | ||
| int32 SUCCESSFUL = 0 | ||
| int32 INVALID_GOAL = -1 | ||
| int32 OLD_HEADER_TIMESTAMP = -2 | ||
| int32 PATH_TOLERANCE_VIOLATED = -3 | ||
| int32 GOAL_TOLERANCE_VIOLATED = -4 | ||
|
|
||
| string error_string | ||
|
|
||
| --- | ||
| std_msgs/Header header | ||
| geometry_msgs/Pose desired | ||
| geometry_msgs/Pose actual | ||
| float64 error | ||
This file contains hidden or 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,4 @@ | ||
| std_msgs/Header header | ||
|
|
||
| # The sequence of end effector points to track. | ||
| auv_control_msgs/EndEffectorTrajectoryPoint[] points |
14 changes: 14 additions & 0 deletions
14
auv_control_msgs/msg/EndEffectorTrajectoryControllerState.msg
This file contains hidden or 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,14 @@ | ||
| std_msgs/Header header | ||
|
|
||
| # The reference sample from the trajectory. This is the sample from the current time instance and used | ||
| # for error calculation. | ||
| geometry_msgs/Pose reference | ||
|
|
||
| # The current end effector state. | ||
| geometry_msgs/Pose feedback | ||
|
|
||
| # The squared Euclidean norm of the geodesic distance between the reference state and end effector state. | ||
| float64 error | ||
|
|
||
| # The trajectory controller command. This is the trajectory sample from the next time instance. | ||
| geometry_msgs/Pose output |
This file contains hidden or 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,5 @@ | ||
| # The sequence of end effector poses. | ||
| geometry_msgs/Pose point | ||
|
|
||
| # The duration of the trajectory. | ||
evan-palmer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| builtin_interfaces/Duration time_from_start | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
| <package format="3"> | ||
| <name>auv_control_msgs</name> | ||
| <version>0.1.0</version> | ||
| <version>0.2.0</version> | ||
| <description>Custom messages for AUV controllers</description> | ||
|
|
||
| <maintainer email="[email protected]">Rakesh Vivekanandan</maintainer> | ||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| <package format="3"> | ||
|
|
||
| <name>auv_controllers</name> | ||
| <version>0.1.0</version> | ||
| <version>0.2.0</version> | ||
| <description>Meta package for auv_controllers</description> | ||
|
|
||
| <maintainer email="[email protected]">Evan Palmer</maintainer> | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| # Changelog for package controller_common | ||
|
|
||
| ## 0.2.0 (??) | ||
|
|
||
| ## 0.1.0 (2025-04-27) | ||
|
|
||
| - Ports reset message functions and error calculation to a common API |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| <package format="3"> | ||
|
|
||
| <name>controller_common</name> | ||
| <version>0.1.0</version> | ||
| <version>0.2.0</version> | ||
| <description>Common interfaces for controllers used in this project</description> | ||
|
|
||
| <maintainer email="[email protected]">Evan Palmer</maintainer> | ||
|
|
||
This file contains hidden or 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 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -171,6 +171,11 @@ auto all_nan(const std::vector<double> & vec) -> bool | |||||||||||||||||||||||||||||||
| return std::ranges::all_of(vec, [](double x) { return std::isnan(x); }); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| /** | |
| * @brief Compares two floating-point numbers for approximate equality. | |
| * | |
| * This function checks whether the difference between two numbers `a` and `b` | |
| * is within a specified tolerance. The tolerance is determined by the formula: | |
| * |a - b| <= atol + rtol * |b| | |
| * | |
| * @param a The first floating-point number. | |
| * @param b The second floating-point number. | |
| * @param rtol The relative tolerance. It scales with the magnitude of `b`. | |
| * @param atol The absolute tolerance. It provides a fixed margin of error. | |
| * @return true if the numbers are approximately equal, false otherwise. | |
| */ |
This file contains hidden or 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,96 @@ | ||
| cmake_minimum_required(VERSION 3.23) | ||
| project(end_effector_trajectory_controller) | ||
|
|
||
| if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") | ||
| add_compile_options(-Wall -Wextra -Wpedantic) | ||
| endif() | ||
|
|
||
| include(GNUInstallDirs) | ||
|
|
||
| find_package(ament_cmake REQUIRED) | ||
| find_package(geometry_msgs REQUIRED) | ||
| find_package(realtime_tools REQUIRED) | ||
| find_package(auv_control_msgs REQUIRED) | ||
| find_package(controller_common REQUIRED) | ||
| find_package(tf2 REQUIRED) | ||
| find_package(tf2_ros REQUIRED) | ||
| find_package(tf2_eigen REQUIRED) | ||
| find_package(hardware_interface REQUIRED) | ||
| find_package(rclcpp REQUIRED) | ||
| find_package(rclcpp_lifecycle REQUIRED) | ||
| find_package(generate_parameter_library REQUIRED) | ||
| find_package(controller_interface REQUIRED) | ||
| find_package(Eigen3 REQUIRED) | ||
| find_package(rclcpp_action REQUIRED) | ||
| find_package(lifecycle_msgs REQUIRED) | ||
| find_package(pluginlib REQUIRED) | ||
| find_package(tf2_geometry_msgs REQUIRED) | ||
|
|
||
| generate_parameter_library(end_effector_trajectory_controller_parameters | ||
| src/end_effector_trajectory_controller_parameters.yaml | ||
| ) | ||
|
|
||
| add_library(end_effector_trajectory_controller SHARED) | ||
| target_sources( | ||
| end_effector_trajectory_controller | ||
| PRIVATE src/end_effector_trajectory_controller.cpp src/trajectory.cpp | ||
| PUBLIC | ||
| FILE_SET HEADERS | ||
| BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include | ||
| FILES | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/include/end_effector_trajectory_controller/end_effector_trajectory_controller.hpp | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/include/end_effector_trajectory_controller/trajectory.hpp | ||
| ) | ||
| target_compile_features(end_effector_trajectory_controller PUBLIC cxx_std_23) | ||
| target_link_libraries( | ||
| end_effector_trajectory_controller | ||
| PUBLIC | ||
| end_effector_trajectory_controller_parameters | ||
| realtime_tools::realtime_tools | ||
| controller_common::controller_common | ||
| hardware_interface::hardware_interface | ||
| rclcpp::rclcpp | ||
| rclcpp_lifecycle::rclcpp_lifecycle | ||
| tf2_ros::tf2_ros | ||
| tf2_eigen::tf2_eigen | ||
| tf2::tf2 | ||
| controller_interface::controller_interface | ||
| rclcpp_action::rclcpp_action | ||
| tf2_geometry_msgs::tf2_geometry_msgs | ||
| ${geometry_msgs_TARGETS} | ||
| ${auv_control_msgs_TARGETS} | ||
| ${lifecycle_msgs_TARGETS} | ||
| ) | ||
|
|
||
| pluginlib_export_plugin_description_file(controller_interface end_effector_trajectory_controller.xml) | ||
|
|
||
| install( | ||
| TARGETS | ||
| end_effector_trajectory_controller | ||
| end_effector_trajectory_controller_parameters | ||
| EXPORT export_end_effector_trajectory_controller | ||
| LIBRARY DESTINATION lib/${PROJECT_NAME} | ||
| ARCHIVE DESTINATION lib/${PROJECT_NAME} | ||
| RUNTIME DESTINATION bin/${PROJECT_NAME} | ||
| FILE_SET HEADERS | ||
| ) | ||
|
|
||
| ament_export_targets(export_end_effector_trajectory_controller HAS_LIBRARY_TARGET) | ||
| ament_export_dependencies( | ||
| "geometry_msgs" | ||
| "realtime_tools" | ||
| "auv_control_msgs" | ||
| "controller_common" | ||
| "tf2" | ||
| "tf2_ros" | ||
| "tf2_eigen" | ||
| "hardware_interface" | ||
| "rclcpp" | ||
| "rclcpp_lifecycle" | ||
| "controller_interface" | ||
| "rclcpp_action" | ||
| "lifecycle_msgs" | ||
| "tf2_geometry_msgs" | ||
| ) | ||
|
|
||
| ament_package() |
This file contains hidden or 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,17 @@ | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
This file contains hidden or 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,30 @@ | ||
| # End Effector Trajectory Controller | ||
|
|
||
| The end effector trajectory controller interpolates an end effector motion plan | ||
| for whole-body inverse kinematic control. The positions are interpolated using | ||
| linear interpolation. The orientations are interpolated using spherical linear | ||
| interpolation. | ||
|
|
||
| ## Plugin Library | ||
|
|
||
| end_effector_trajectory_controller/EndEffectorTrajectoryController | ||
|
|
||
| ## References | ||
|
|
||
| The input to this controller is a sequence of end effector poses. | ||
|
|
||
| ## Commands | ||
|
|
||
| The output of this controller is a sampled end effector pose. | ||
|
|
||
| ## Subscribers | ||
|
|
||
| - end_effector_trajectory_controller/trajectory [auv_control_msgs::msg::EndEffectorTrajectory] | ||
|
|
||
| ## Action Servers | ||
|
|
||
| - end_effector_trajectory_controller/follow_trajectory [auv_control_msgs::action::FollowEndEffectorTrajectory] | ||
|
|
||
| ## Publishers | ||
|
|
||
| - end_effector_trajectory_controller/status [auv_control_msgs::msg::EndEffectorTrajectoryControllerState] |
9 changes: 9 additions & 0 deletions
9
end_effector_trajectory_controller/end_effector_trajectory_controller.xml
This file contains hidden or 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,9 @@ | ||
| <library path="end_effector_trajectory_controller"> | ||
| <class name="end_effector_trajectory_controller/EndEffectorTrajectoryController" | ||
| type="end_effector_trajectory_controller::EndEffectorTrajectoryController" | ||
| base_class_type="controller_interface::ControllerInterface"> | ||
| <description> | ||
| End effector trajectory controller for UVMS whole-body control | ||
| </description> | ||
| </class> | ||
| </library> |
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.
Uh oh!
There was an error while loading. Please reload this page.