ros-controls / gazebo_ros2_control

Wrappers, tools and additional API's for using ros2_control with Gazebo Classic
Apache License 2.0
186 stars 118 forks source link

set the robot description parameter #277

Closed annaborn closed 4 months ago

annaborn commented 5 months ago

This merge resolves the issue with robot description parameter in controller manager and controllers. Some custom controllers require information about robot description, which are available normally over a parameter of controller manager and controllers in the ros2 control. However, this parameter was missing, if the controller manager (as well controllers) is started over gazebo ros2 control. Therefore, the custom controllers could not be used/tested with the gazebo. I tested this code with my custom controllers.

If you have some remarks, I would be glad to introduce some improvement.

Here is an output of parameter list before (without robot description parameter):

/controller_manager:
  forward_position_controller.type
  joint_state_broadcaster.type
  qos_overrides./clock.subscription.depth
  qos_overrides./clock.subscription.durability
  qos_overrides./clock.subscription.history
  qos_overrides./clock.subscription.reliability
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  update_rate
  use_sim_time

/forward_position_controller:
  interface_name
  joints
  qos_overrides./clock.subscription.depth
  qos_overrides./clock.subscription.durability
  qos_overrides./clock.subscription.history
  qos_overrides./clock.subscription.reliability
  update_rate
  use_sim_time

/joint_state_broadcaster:
  extra_joints
  interfaces
  joints
  map_interface_to_joint_state.effort
  map_interface_to_joint_state.position
  map_interface_to_joint_state.velocity
  qos_overrides./clock.subscription.depth
  qos_overrides./clock.subscription.durability
  qos_overrides./clock.subscription.history
  qos_overrides./clock.subscription.reliability
  update_rate
  use_local_topics
  use_sim_time

And here is the output with the fix:

/controller_manager:
  forward_position_controller.type
  joint_state_broadcaster.type
  qos_overrides./clock.subscription.depth
  qos_overrides./clock.subscription.durability
  qos_overrides./clock.subscription.history
  qos_overrides./clock.subscription.reliability
  qos_overrides./parameter_events.publisher.depth
  qos_overrides./parameter_events.publisher.durability
  qos_overrides./parameter_events.publisher.history
  qos_overrides./parameter_events.publisher.reliability
  robot_description
  update_rate
  use_sim_time

/forward_position_controller:
  interface_name
  joints
  qos_overrides./clock.subscription.depth
  qos_overrides./clock.subscription.durability
  qos_overrides./clock.subscription.history
  qos_overrides./clock.subscription.reliability
  robot_description
  update_rate
  use_sim_time

/joint_state_broadcaster:
  extra_joints
  interfaces
  joints
  map_interface_to_joint_state.effort
  map_interface_to_joint_state.position
  map_interface_to_joint_state.velocity
  qos_overrides./clock.subscription.depth
  qos_overrides./clock.subscription.durability
  qos_overrides./clock.subscription.history
  qos_overrides./clock.subscription.reliability
  robot_description
  update_rate
  use_local_topics
  use_sim_time

To get the robot description parameter value over cli returns the correct urdf.

annaborn commented 5 months ago

check format https://github.com/ros-controls/gazebo_ros2_control/actions/runs/7762574839/job/21217428831?pr=277

@ahcorde The trailing white space was removed and the curly brace placed on the same line with if condition.

annaborn commented 4 months ago

@ahcorde @christophfroehlich Hey guys! What is the procedure to finish this PR? Do you need smth from my side? The requested changes are done.

The PR was already verified last week: https://github.com/ros-controls/gazebo_ros2_control/actions/runs/7783361932

ahcorde commented 4 months ago

https://github.com/Mergifyio backport iron master

mergify[bot] commented 4 months ago

backport iron master

✅ Backports have been created

* [#284 set the robot description parameter (backport #277)](https://github.com/ros-controls/gazebo_ros2_control/pull/284) has been created for branch `iron` * [#285 set the robot description parameter (backport #277)](https://github.com/ros-controls/gazebo_ros2_control/pull/285) has been created for branch `master`