Skip to content

Commit

Permalink
gz_sim対応(crane_plus_descriptionパッケージ)
Browse files Browse the repository at this point in the history
  • Loading branch information
mizonon committed Nov 27, 2024
1 parent d0fa64a commit 9359f4d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
10 changes: 0 additions & 10 deletions crane_plus_description/test/test_robot_description_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ def test_use_gazebo():
assert 'gazebo_ros2_control/GazeboSystem' in exec_load(rdl)


def test_use_ignition():
# use_gazeboとuse_ignitionが変更され、xacroにign_ros2_controlがセットされることを期待
rdl = RobotDescriptionLoader()
rdl.use_gazebo = 'true'
rdl.use_ignition = 'true'
rdl.gz_control_config_package = 'crane_plus_description'
rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml'
assert 'ign_ros2_control/IgnitionSystem' in exec_load(rdl)


def test_use_camera():
# use_cameraが変更されて、xacroにcameraがセットされることを期待
rdl = RobotDescriptionLoader()
Expand Down
15 changes: 3 additions & 12 deletions crane_plus_description/urdf/crane_plus.gazebo.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,9 @@
">

<gazebo>
<xacro:if value="${use_ignition}">
<plugin filename="libign_ros2_control-system.so" name="ign_ros2_control::IgnitionROS2ControlPlugin">
<parameters>$(find ${config_package})/${config_file_path}</parameters>
</plugin>
</xacro:if>

<xacro:unless value="${use_ignition}">
<plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
<robot_sim_type>gazebo_ros2_control/GazeboSystem</robot_sim_type>
<parameters>$(find ${config_package})/${config_file_path}</parameters>
</plugin>
</xacro:unless>
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
<parameters>$(find ${config_package})/${config_file_path}</parameters>
</plugin>
</gazebo>

<gazebo reference="${name_link_base}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@

<ros2_control name="${name}" type="system">
<hardware>
<xacro:if value="${use_ignition}">
<plugin>ign_ros2_control/IgnitionSystem</plugin>
</xacro:if>

<xacro:unless value="${use_ignition}">
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</xacro:unless>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</hardware>

<joint name="${name_joint_1}">
Expand Down

0 comments on commit 9359f4d

Please sign in to comment.