Skip to content

Commit

Permalink
Update docs and cleanup member of GazeboSimROS2ControlPluginPrivate (
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich authored Jul 8, 2024
1 parent c4b3a55 commit 9257ad3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
25 changes: 19 additions & 6 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,30 @@ robot hardware interfaces between *ros2_control* and Gazebo.
.. code-block:: xml
<gazebo>
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
<robot_param>robot_description</robot_param>
<robot_param_node>robot_state_publisher</robot_param_node>
<parameters>$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters>
</plugin>
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
<parameters>$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters>
</plugin>
</gazebo>
The *gz_ros2_control* ``<plugin>`` tag also has the following optional child elements:

* ``<parameters>``: YAML file with the configuration of the controllers
* ``<parameters>``: A YAML file with the configuration of the controllers. This element can be given multiple times to load multiple files.
* ``<hold_joints>``: if set to true (default), it will hold the joints' position if their interface was not claimed, e.g., the controller hasn't been activated yet.
* ``<controller_manager_name>``: Set controller manager name (default: ``controller_manager``)

Additionally, one can specify a namespace and remapping rules, which will be forwarded to the controller_manager and loaded controllers. Add the following ``<ros>`` section:

.. code-block:: xml
<gazebo>
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
...
<ros>
<namespace>my_namespace</namespace>
<remapping>/robot_description:=/robot_description_full</remapping>
</ros>
</plugin>
</gazebo>
Default gz_ros2_control Behavior
-----------------------------------------------------------
Expand Down
5 changes: 0 additions & 5 deletions gz_ros2_control/src/gz_ros2_control_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ class GazeboSimROS2ControlPluginPrivate
/// \brief Timing
rclcpp::Duration control_period_ = rclcpp::Duration(1, 0);

/// \brief Interface loader
std::shared_ptr<pluginlib::ClassLoader<
gz_ros2_control::GazeboSimSystemInterface>>
robot_hw_sim_loader_{nullptr};

/// \brief Controller manager
std::shared_ptr<controller_manager::ControllerManager>
controller_manager_{nullptr};
Expand Down

0 comments on commit 9257ad3

Please sign in to comment.