Skip to content
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

Fixes tests to work with use_global_arguments NodeOptions parameter #1256

Merged

Conversation

saikishor
Copy link
Member

@saikishor saikishor commented Aug 20, 2024

Needs: ros-controls/ros2_control#1701

Fixes: #1252
Fixes: #1253
Fixes: #1254
Fixes: #1255

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.

why don't we need the changes for admittance controller and range_sensor_broadcaster?
the tests succeed, which means that they load successfully without parameters?
Shouldn't we check if they initialized properly?

1: [ERROR] [1724184278.166220317] [load_admittance_controller]: Exception thrown during init stage with message: parameter 'joints' is not initialized 
1: 
1: [ERROR] [1724184278.166266164] [test_controller_manager]: Could not initialize the controller named 'load_admittance_controller'
1: [       OK ] TestLoadAdmittanceController.load_controller (40 ms)

range_sensor_broadcaster initializes fine, I guess it doesn't need non-default parameters.

@saikishor
Copy link
Member Author

@christophfroehlich it's probable that they are returning successful even without parameters. That's the only explanation. I could try fixing them tomorrow.

@christophfroehlich
Copy link
Contributor

@christophfroehlich it's probable that they are returning successful even without parameters. That's the only explanation. I could try fixing them tomorrow.

but it throws the exception, and CM::add_controller_impl should return nullptr..

Furthermore, I'm not sure why load_JTC succeeds. it should throw an error without paramaters, but I only see

1: [INFO] [1724185010.487326696] [test_controller_manager]: Subscribing to '/robot_description' topic for robot description.
1: [INFO] [1724185010.487412910] [test_controller_manager]: Loading controller 'test_joint_trajectory_controller'
1: [ERROR] [1724185010.496710000] [test_joint_trajectory_controller]: Unable to start transition 5 from current state shuttingdown: Could not publish transition: publisher's context is invalid, at ./src/rcl/publisher.c:423, at ./src/rcl_lifecycle.c:368
1: [WARN] [1724185010.496722342] [rclcpp_lifecycle]: Shutdown error in destruction of LifecycleNode: final state(unconfigured)
1: [       OK ] TestLoadJointStateController.load_controller (40 ms)

This is not really linked to this PR here. I suggest applying the same changes to admittance_ctrl and range_sensor_broadcaster (the only controllers using a yaml file which are not already addressed) and create a follow-up issue for those false-positive tests.

@saikishor
Copy link
Member Author

Ok. I'm outside right now. I'll try to do that sooner

@saikishor
Copy link
Member Author

@christophfroehlich applied the fix to both the controllers as well

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

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.43%. Comparing base (4a6456f) to head (e4de843).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1256      +/-   ##
==========================================
+ Coverage   80.40%   80.43%   +0.02%     
==========================================
  Files         105      105              
  Lines        9331     9353      +22     
  Branches      816      818       +2     
==========================================
+ Hits         7503     7523      +20     
  Misses       1556     1556              
- Partials      272      274       +2     
Flag Coverage Δ
unittests 80.43% <100.00%> (+0.02%) ⬆️

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

Files Coverage Δ
...r/test/test_load_ackermann_steering_controller.cpp 100.00% <100.00%> (ø)
...ontroller/test/test_load_admittance_controller.cpp 100.00% <100.00%> (ø)
...ler/test/test_load_bicycle_steering_controller.cpp 100.00% <100.00%> (ø)
...ontroller/test/test_load_diff_drive_controller.cpp 100.00% <100.00%> (ø)
...test/test_load_force_torque_sensor_broadcaster.cpp 100.00% <100.00%> (ø)
...adcaster/test/test_load_imu_sensor_broadcaster.cpp 100.00% <100.00%> (ø)
...t/test_load_parallel_gripper_action_controller.cpp 100.00% <100.00%> (ø)
...caster/test/test_load_range_sensor_broadcaster.cpp 100.00% <100.00%> (ø)
..._controller/test/test_load_tricycle_controller.cpp 100.00% <100.00%> (ø)
...er/test/test_load_tricycle_steering_controller.cpp 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

Thank you!

@bmagyar bmagyar merged commit 4ab22a5 into ros-controls:master Aug 22, 2024
19 checks passed
@bmagyar bmagyar deleted the fix/tests/use_global_arguments branch August 22, 2024 11:03
RobertWilbrandt pushed a commit to RobertWilbrandt/ros2_controllers that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants