Skip to content

Add ControllerInterfaceParams to initialize the Controllers #2390

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

This PR adds the ControllerInterfaceParams structure and uses it to pass various args to the ControllerInterface class. Right now, doing so we are able to pass the joint limits to the controllers

@saikishor saikishor added the backport-jazzy This label should be used by maintainers only! Label triggers PR backport to ROS 2 jazzy. label Jul 13, 2025
Copy link

codecov bot commented Jul 13, 2025

Codecov Report

Attention: Patch coverage is 96.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.92%. Comparing base (b315f2b) to head (b7aca1a).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...roller_interface/src/controller_interface_base.cpp 95.45% 0 Missing and 1 partial ⚠️
controller_manager/src/controller_manager.cpp 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2390      +/-   ##
==========================================
+ Coverage   88.90%   88.92%   +0.02%     
==========================================
  Files         148      149       +1     
  Lines       16950    16994      +44     
  Branches     1448     1449       +1     
==========================================
+ Hits        15069    15112      +43     
  Misses       1318     1318              
- Partials      563      564       +1     
Flag Coverage Δ
unittests 88.92% <96.42%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...controller_interface/controller_interface_base.hpp 91.66% <ø> (ø)
...ntroller_interface/controller_interface_params.hpp 100.00% <100.00%> (ø)
...oller_interface/test/test_controller_interface.cpp 100.00% <100.00%> (ø)
hardware_interface/src/resource_manager.cpp 78.01% <100.00%> (+0.12%) ⬆️
...roller_interface/src/controller_interface_base.cpp 87.67% <95.45%> (+1.41%) ⬆️
controller_manager/src/controller_manager.cpp 74.49% <88.88%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only a hint in the release notes is missing. can we remove (deprecate?) the old init method? This is only internal API, right?

@@ -43,16 +43,29 @@ return_type ControllerInterfaceBase::init(
const std::string & controller_name, const std::string & urdf, unsigned int cm_update_rate,
const std::string & node_namespace, const rclcpp::NodeOptions & node_options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could mark this function as deprecated already

Comment on lines +113 to +120
joint_limits::JointLimits joint_limits;
joint_limits.has_velocity_limits = true;
joint_limits.max_velocity = 1.0;
params.hard_joint_limits["joint1"] = joint_limits;
joint_limits::SoftJointLimits soft_joint_limits;
soft_joint_limits.min_position = -1.0;
soft_joint_limits.max_position = 1.0;
params.soft_joint_limits["joint1"] = soft_joint_limits;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you mind adding a new constructor to joint limits that allow a one-line initialization please? ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-jazzy This label should be used by maintainers only! Label triggers PR backport to ROS 2 jazzy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants