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]

Cherry-pick of f96d2fc0fbf94537f769cffcf844858f7a085671 has failed:

On branch mergify/bp/humble/pr-1231
Your branch is up to date with 'origin/humble'.

You are currently cherry-picking commit f96d2fc.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   doc/release_notes.rst
	modified:   joint_trajectory_controller/src/joint_trajectory_controller.cpp

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   joint_trajectory_controller/src/joint_trajectory_controller_parameters.yaml

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

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.17%. Comparing base (2c2a47c) to head (b4b9f16). Report is 1 commits behind head on humble.

Additional details and impacted files
@@            Coverage Diff             @@
##           humble    #1320      +/-   ##
==========================================
+ Coverage   65.16%   65.17%   +0.01%     
==========================================
  Files         103      103              
  Lines       11995    11997       +2     
  Branches     7399     7400       +1     
==========================================
+ Hits         7816     7819       +3     
  Misses       1550     1550              
+ Partials     2629     2628       -1     
Flag Coverage Δ
unittests 65.17% <100.00%> (+0.01%) :arrow_up:

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.89% <100.00%> (+0.17%) :arrow_up:

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

@bmagyar any idea why the ABI check for iron did not complain, but here it does? Is this a reason to not merge this?

christophfroehlich avatar Oct 26 '24 21:10 christophfroehlich