Skip to content

Use new Command/State Interfaces API for tests - #2476

Open
saikishor wants to merge 28 commits into
ros-controls:masterfrom
pal-robotics-forks:use/new/handle/api
Open

Use new Command/State Interfaces API for tests#2476
saikishor wants to merge 28 commits into
ros-controls:masterfrom
pal-robotics-forks:use/new/handle/api

Conversation

@saikishor

@saikishor saikishor commented Jul 14, 2026

Copy link
Copy Markdown
Member

Description

This is to migrate from the old API of the handles to the new one where is no more reference of the variables

Is this user-facing behavior change?

NO

Did you use Generative AI?

YES, for failing tests

Additional Information

TODOs

To send us a pull request, please:

  • Fork the repository.
  • Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

@saikishor
saikishor marked this pull request as draft July 14, 2026 21:43
@saikishor
saikishor marked this pull request as ready for review July 15, 2026 17:09
@github-actions
github-actions Bot requested a review from bmagyar July 15, 2026 17:09
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.74037% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.96%. Comparing base (c7b97ca) to head (23a91e0).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...ntroller/test/test_trajectory_controller_utils.hpp 90.00% 6 Missing ⚠️
...ectory_controller/test/test_trajectory_actions.cpp 81.25% 3 Missing ⚠️
...clude/chained_filter_controller/chained_filter.hpp 0.00% 2 Missing ⚠️
...or_broadcaster/force_torque_sensor_broadcaster.hpp 0.00% 2 Missing ⚠️
.../imu_sensor_broadcaster/imu_sensor_broadcaster.hpp 0.00% 2 Missing ⚠️
..._drive_controller/src/mecanum_drive_controller.cpp 33.33% 1 Missing and 1 partial ⚠️
...llers_library/src/steering_controllers_library.cpp 0.00% 2 Missing ⚠️
...test/test_motion_primitives_forward_controller.cpp 0.00% 0 Missing and 1 partial ⚠️
...ive_controller/src/omni_wheel_drive_controller.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2476      +/-   ##
==========================================
+ Coverage   86.83%   86.96%   +0.13%     
==========================================
  Files         148      151       +3     
  Lines       16273    16529     +256     
  Branches     1368     1377       +9     
==========================================
+ Hits        14131    14375     +244     
- Misses       1635     1644       +9     
- Partials      507      510       +3     
Flag Coverage Δ
unittests 86.96% <95.74%> (+0.13%) ⬆️

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

Files with missing lines Coverage Δ
...roller/test/test_ackermann_steering_controller.hpp 88.39% <100.00%> (ø)
...nce_controller/test/test_admittance_controller.cpp 100.00% <100.00%> (ø)
...nce_controller/test/test_admittance_controller.hpp 94.65% <100.00%> (ø)
...ntroller/test/test_bicycle_steering_controller.hpp 85.71% <100.00%> (ø)
...ned_filter_controller/test/test_chained_filter.cpp 98.38% <100.00%> (+0.05%) ⬆️
...ned_filter_controller/test/test_chained_filter.hpp 100.00% <ø> (ø)
...r_controller/test/test_multiple_chained_filter.cpp 98.18% <100.00%> (+0.14%) ⬆️
...r_controller/test/test_multiple_chained_filter.hpp 100.00% <ø> (ø)
...ive_controller/test/test_diff_drive_controller.cpp 95.12% <100.00%> (+0.16%) ⬆️
...ster/test/test_force_torque_sensor_broadcaster.cpp 98.13% <100.00%> (+0.11%) ⬆️
... and 31 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christophfroehlich christophfroehlich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall LGTM and mostly straight forward. Some comments, then good to be merged.

traction_joints_names_[0], traction_interface_name_,
&joint_command_values_[CMD_TRACTION_RIGHT_WHEEL]));
traction_joints_names_[0], traction_interface_name_));
std::ignore = command_itfs_.back()->set_value(joint_command_values_[CMD_TRACTION_RIGHT_WHEEL]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

joint_command_values_ et.al can be constants now. Maybe we can cleanup the member variables of the test fixtures in a follow-up PR.

std::vector<hardware_interface::StateInterface::SharedPtr> on_export_state_interfaces_list()
override;

std::vector<hardware_interface::CommandInterface::SharedPtr> on_export_reference_interfaces_list()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will this be a mandatory override? or why this change, this is exactly the default implementation in chainable_controller_interface.cpp

std::vector<hardware_interface::StateInterface::SharedPtr> on_export_state_interfaces_list()
override;

std::vector<hardware_interface::CommandInterface::SharedPtr> on_export_reference_interfaces_list()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

std::vector<hardware_interface::StateInterface::SharedPtr> on_export_state_interfaces_list()
override;

std::vector<hardware_interface::CommandInterface::SharedPtr> on_export_reference_interfaces_list()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

joint_state_vel_[i] = INITIAL_VEL_JOINTS[i];
joint_state_acc_[i] = INITIAL_ACC_JOINTS[i];
}
(void)pos_state_interfaces_.back()->set_value(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we use std::ignore to have consistent style in this repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants