Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
09fd49a
First changes to JTC accepting num_cmd_joints<dof
christophfroehlich Nov 28, 2023
eb64893
Map command joints to dof
christophfroehlich Nov 28, 2023
d1d55d3
Remove not needed included
christophfroehlich Nov 28, 2023
1327fd9
Add some comments to the tests
christophfroehlich Nov 28, 2023
474b04a
Fix typos
christophfroehlich Nov 28, 2023
28bfa80
Update comments
christophfroehlich Nov 28, 2023
aa67b0b
Use a function to reuse for tests
christophfroehlich Nov 28, 2023
7d62e83
Fix includes
christophfroehlich Nov 28, 2023
141f686
Use correct ff_velocity_scale parameter
christophfroehlich Nov 28, 2023
88ddb8f
Fix tests due to allow_nonzero..
christophfroehlich Nov 28, 2023
c5c2f01
Remove unnecessary warning
christophfroehlich Nov 28, 2023
23146d8
Use new update method for added tests
christophfroehlich Nov 28, 2023
ea50f0f
Fix rqt_jtc with num_cmd<dof
christophfroehlich Dec 10, 2023
bc606f7
Merge branch 'master' into jtc/dof_independent
christophfroehlich Jan 2, 2024
44ef204
Merge branch 'master' into jtc/dof_independent
christophfroehlich Jan 11, 2024
2456246
Merge branch 'master' into jtc/dof_independent
christophfroehlich Feb 17, 2024
f983bcf
Merge branch 'master' into jtc/dof_independent
christophfroehlich Mar 7, 2024
fefa494
Merge branch 'jtc/controller_plugin'
christophfroehlich Mar 7, 2024
6a0921a
Fix PID controller for less cmd_ifs than dofs
christophfroehlich Mar 7, 2024
20dbdfd
Parse traj_control gains before sending hold position
christophfroehlich Mar 7, 2024
a0d113a
add_pre_set_parameters_callback
christophfroehlich Mar 7, 2024
8578b89
Fix wrong text in test
christophfroehlich Feb 14, 2024
38e43ca
Properly initialize and update PIDs
christophfroehlich May 24, 2024
8aadf61
Reset traj_contrl in on_deactivate
christophfroehlich Jun 24, 2024
dbb6c30
Merge branch 'master' into jtc/dof_independent_plugins
christophfroehlich Jul 11, 2024
3f48f9b
Add missing backward_ros dependency
christophfroehlich Jul 16, 2024
e418e0c
Merge branch 'master' into jtc/dof_independent_plugins
christophfroehlich Jul 22, 2024
cc34e67
Fix the test code
christophfroehlich Jul 29, 2024
10eb5e6
rename get/set_state to get/set_lifecylce_state (#1250)
mamueluth Aug 26, 2024
9f5c47c
Merge commit '694d6f184b91d7d4c6f52052e298aa106a219253' into jtc/dof_…
christophfroehlich Feb 3, 2025
55f43ac
Use global cmake macros
christophfroehlich Feb 5, 2025
78b1dc6
Rename API to snake_case
christophfroehlich Mar 1, 2025
e65cb31
Remove visibility macros
christophfroehlich Mar 1, 2025
0ab8da8
Merge branch 'master' into jtc/dof_independent_plugins
christophfroehlich Mar 1, 2025
2ed7de2
Update API to snake_case
christophfroehlich Mar 1, 2025
7202f30
Use new GPL include path
christophfroehlich Mar 1, 2025
9d3caf0
We don't have to link the parameters again
christophfroehlich Mar 4, 2025
23f55b4
Add missing gmock dependency
christophfroehlich Mar 6, 2025
e34c025
Merge remote-tracking branch 'origin/master' into jtc/dof_independent…
christophfroehlich Jul 28, 2025
fa83a4e
Set precision in debug output
christophfroehlich Jul 28, 2025
a80e6f7
Fix command_joints override
christophfroehlich Jul 28, 2025
fefc38d
Implement effort feedforward
christophfroehlich Jul 28, 2025
48b6b56
Simplify code and remove debug output
christophfroehlich Jul 28, 2025
8cfbd91
Rework plugin API
christophfroehlich Jul 28, 2025
771d5bd
Use a simple std::atomic instead
christophfroehlich Jul 28, 2025
b6d6d63
Merge branch 'master' into jtc/controller_plugin
christophfroehlich Jul 31, 2025
2626265
Merge branch 'master' into jtc/controller_plugin
christophfroehlich Aug 13, 2025
8446966
Merge branch 'master' into jtc/controller_plugin
christophfroehlich Aug 29, 2025
d635c3e
Merge branch 'master' into jtc/controller_plugin
christophfroehlich Sep 8, 2025
d16ced8
Remove duplicate
christophfroehlich Sep 8, 2025
2211a6e
Merge branch 'master' into jtc/controller_plugin
christophfroehlich Sep 16, 2025
0909f6d
Add possibility to use optional state interfaces by the controller pl…
christophfroehlich Sep 16, 2025
2a2e610
Pass scaling factor to plugin
christophfroehlich Sep 16, 2025
8e4de92
Merge branch 'master' into jtc/controller_plugin
christophfroehlich Sep 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions joint_trajectory_controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS
tl_expected
trajectory_msgs
urdf
joint_trajectory_controller_plugins
)

find_package(ament_cmake REQUIRED)
Expand Down Expand Up @@ -47,6 +48,7 @@ target_link_libraries(joint_trajectory_controller PUBLIC
control_toolbox::control_toolbox
controller_interface::controller_interface
hardware_interface::hardware_interface
joint_trajectory_controller_plugins::pid_trajectory_plugin
pluginlib::pluginlib
rclcpp::rclcpp
rclcpp_lifecycle::rclcpp_lifecycle
Expand Down Expand Up @@ -119,4 +121,5 @@ install(TARGETS

ament_export_targets(export_joint_trajectory_controller HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})

ament_package()
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
#include "control_msgs/msg/joint_trajectory_controller_state.hpp"
#include "control_msgs/msg/speed_scaling_factor.hpp"
#include "control_msgs/srv/query_trajectory_state.hpp"
#include "control_toolbox/pid.hpp"
#include "controller_interface/controller_interface.hpp"
#include "hardware_interface/loaned_command_interface.hpp"
#include "hardware_interface/types/hardware_interface_type_values.hpp"
#include "joint_trajectory_controller/interpolation_methods.hpp"
#include "joint_trajectory_controller/tolerances.hpp"
#include "joint_trajectory_controller/trajectory.hpp"
#include "joint_trajectory_controller_plugins/trajectory_controller_base.hpp"
#include "pluginlib/class_loader.hpp"
#include "rclcpp/duration.hpp"
#include "rclcpp/subscription.hpp"
#include "rclcpp/time.hpp"
Expand All @@ -41,6 +42,7 @@
#include "realtime_tools/realtime_buffer.hpp"
#include "realtime_tools/realtime_publisher.hpp"
#include "realtime_tools/realtime_server_goal_handle.hpp"
#include "realtime_tools/realtime_thread_safe_box.hpp"
#include "trajectory_msgs/msg/joint_trajectory.hpp"
#include "trajectory_msgs/msg/joint_trajectory_point.hpp"

Expand Down Expand Up @@ -108,7 +110,10 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa

// Storing command joint names for interfaces
std::vector<std::string> command_joint_names_;

#if RCLCPP_VERSION_MAJOR >= 17
// TODO(anyone) remove this if there is another way to lock command_joints parameter
rclcpp_lifecycle::LifecycleNode::PreSetParametersCallbackHandle::SharedPtr lock_cmd_joint_names;
#endif
// Parameters from ROS for joint_trajectory_controller
std::shared_ptr<ParamListener> param_listener_;
Params params_;
Expand All @@ -135,6 +140,11 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
scaling_state_interface_;
std::optional<std::reference_wrapper<hardware_interface::LoanedCommandInterface>>
scaling_command_interface_;
std::vector<std::string> traj_ctr_state_interface_names_;
std::vector<std::reference_wrapper<hardware_interface::LoanedStateInterface>>
traj_ctr_state_interfaces_;
std::vector<double> traj_ctr_state_interfaces_values_;
realtime_tools::RealtimeThreadSafeBox<std::vector<double>> traj_ctr_state_interfaces_box_;

bool has_position_state_interface_ = false;
bool has_velocity_state_interface_ = false;
Expand All @@ -145,11 +155,13 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
bool has_effort_command_interface_ = false;

/// If true, a velocity feedforward term plus corrective PID term is used
bool use_closed_loop_pid_adapter_ = false;
using PidPtr = std::shared_ptr<control_toolbox::Pid>;
std::vector<PidPtr> pids_;
// Feed-forward velocity weight factor when calculating closed loop pid adapter's command
std::vector<double> ff_velocity_scale_;
bool use_external_control_law_ = false;
// class loader for actual trajectory controller
std::shared_ptr<
pluginlib::ClassLoader<joint_trajectory_controller_plugins::TrajectoryControllerBase>>
traj_controller_loader_;
// The actual trajectory controller
std::shared_ptr<joint_trajectory_controller_plugins::TrajectoryControllerBase> traj_contr_;
// Configuration for every joint if it wraps around (ie. is continuous, position error is
// normalized)
std::vector<bool> joints_angle_wraparound_;
Expand Down Expand Up @@ -226,7 +238,9 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
void sort_to_local_joint_order(
std::shared_ptr<trajectory_msgs::msg::JointTrajectory> trajectory_msg) const;
bool validate_trajectory_msg(const trajectory_msgs::msg::JointTrajectory & trajectory) const;
void add_new_trajectory_msg(
void add_new_trajectory_msg_nonRT(
const std::shared_ptr<trajectory_msgs::msg::JointTrajectory> & traj_msg);
void add_new_trajectory_msg_RT(
const std::shared_ptr<trajectory_msgs::msg::JointTrajectory> & traj_msg);
bool validate_trajectory_point_field(
size_t joint_names_size, const std::vector<double> & vector_field,
Expand Down Expand Up @@ -273,8 +287,6 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
std::shared_ptr<control_msgs::srv::QueryTrajectoryState::Response> response);

private:
void update_pids();

bool contains_interface_type(
const std::vector<std::string> & interface_type_list, const std::string & interface_type);

Expand Down
1 change: 1 addition & 0 deletions joint_trajectory_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<depend>tl_expected</depend>
<depend>trajectory_msgs</depend>
<depend>urdf</depend>
<depend>joint_trajectory_controller_plugins</depend>

<test_depend>ament_cmake_gmock</test_depend>
<test_depend>controller_manager</test_depend>
Expand Down
Loading
Loading