diff --git a/sciurus17_description/robot_description_loader.py b/sciurus17_description/robot_description_loader.py index e555f0b..1f7ebae 100755 --- a/sciurus17_description/robot_description_loader.py +++ b/sciurus17_description/robot_description_loader.py @@ -21,6 +21,7 @@ def __init__(self): self.use_gazebo_head_camera = 'false' self.use_gazebo_chest_camera = 'false' self.use_mock_components = 'false' + self.use_isaacsim = 'false' self.gz_control_config_package = '' self.gz_control_config_file_path = '' @@ -36,6 +37,7 @@ def load(self): ' use_gazebo_head_camera:=', self.use_gazebo_head_camera, ' use_gazebo_chest_camera:=', self.use_gazebo_chest_camera, ' use_mock_components:=', self.use_mock_components, + ' use_isaacsim:=', self.use_isaacsim, ' gz_control_config_package:=', self.gz_control_config_package, ' gz_control_config_file_path:=', self.gz_control_config_file_path ]) diff --git a/test/test_robot_description_loader.py b/test/test_robot_description_loader.py index e3a2237..4f0184c 100644 --- a/test/test_robot_description_loader.py +++ b/test/test_robot_description_loader.py @@ -88,3 +88,17 @@ def test_use_mock_components(): rdl.gz_control_config_package = 'sciurus17_description' rdl.gz_control_config_file_path = 'config/dummy_controllers.yaml' assert 'mock_components/GenericSystem' in exec_load(rdl) + + +def test_use_isaacsim(): + # use_isaacsimが変更され、xacroにIsaac Sim向けのpluginがセットされることを期待 + rdl = RobotDescriptionLoader() + rdl.use_isaacsim = 'true' + assert 'topic_based_ros2_control/TopicBasedSystem' in exec_load(rdl) + + +def test_use_isaacsim_head_camera(): + # use_isaacsimが変更され、xacroにhead_camera_color_frameがセットされることを期待 + rdl = RobotDescriptionLoader() + rdl.use_isaacsim = 'true' + assert 'name="head_camera_color_frame"' in exec_load(rdl) diff --git a/urdf/sciurus17.ros2_control.xacro b/urdf/sciurus17.ros2_control.xacro index 3a584ab..ee9f948 100644 --- a/urdf/sciurus17.ros2_control.xacro +++ b/urdf/sciurus17.ros2_control.xacro @@ -3,6 +3,7 @@ - - mock_components/GenericSystem + + topic_based_ros2_control/TopicBasedSystem + /joint_command + /joint_states - - sciurus17_hardware/Sciurus17Hardware - ${port_name} - ${baudrate} - ${timeout_seconds} - ${manipulator_config_file_path} + + + mock_components/GenericSystem + + + sciurus17_hardware/Sciurus17Hardware + ${port_name} + ${baudrate} + ${timeout_seconds} + ${manipulator_config_file_path} + diff --git a/urdf/sciurus17.urdf.xacro b/urdf/sciurus17.urdf.xacro index 5f0fe19..642c649 100644 --- a/urdf/sciurus17.urdf.xacro +++ b/urdf/sciurus17.urdf.xacro @@ -21,6 +21,7 @@ + @@ -118,6 +119,7 @@ + + + + @@ -152,4 +158,5 @@ +