ros2_controllers icon indicating copy to clipboard operation
ros2_controllers copied to clipboard

[JTC] Add Parameter to Toggle State Setting on Activation (backport #1231)

Open mergify[bot] opened this issue 1 year ago • 1 comments

This pull request introduces a new parameter in the JointTrajectoryController that enables toggling whether the last command interface value should be set as both the current_state and last_commanded_state upon activation.

Motivation

Consider a scenario where there is a transition from a JTC to another controller and back to a JTC. Due to the implementation specifics of the intermediary controller, it is possible that the command interface values from the first JTC remain. This can lead to dangerous situations where, upon reactivation, the second JTC inadvertently uses these stale command values to command the hardware.

To mitigate this risk, I have added an option within the JTC that ensures command values are reliably reset to reflect the current state upon activation, enhancing system safety.


This is an automatic backport of pull request #1231 done by Mergify.

mergify[bot] avatar Oct 26 '24 14:10 mergify[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 65.07%. Comparing base (b78380c) to head (051e64f). Report is 1 commits behind head on iron.

Additional details and impacted files
@@            Coverage Diff             @@
##             iron    #1319      +/-   ##
==========================================
- Coverage   65.09%   65.07%   -0.03%     
==========================================
  Files         103      103              
  Lines       11336    11899     +563     
  Branches     7159     7305     +146     
==========================================
+ Hits         7379     7743     +364     
- Misses       1469     1535      +66     
- Partials     2488     2621     +133     
Flag Coverage Δ
unittests 65.07% <100.00%> (-0.03%) :arrow_down:

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

Files with missing lines Coverage Δ
...ory_controller/src/joint_trajectory_controller.cpp 80.47% <100.00%> (+0.36%) :arrow_up:

... and 84 files with indirect coverage changes

codecov[bot] avatar Oct 26 '24 15:10 codecov[bot]