Skip to content

Commit

Permalink
use_head_cameraオプションをuse_gazebo_head_cameraに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuwamai committed Nov 21, 2023
1 parent 1c2f5fb commit 3ac6d65
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions sciurus17_description/robot_description_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def __init__(self):
self.timeout_seconds = '1.0'
self.manipulator_config_file_path = ''
self.use_gazebo = 'false'
self.use_head_camera = 'false'
self.use_chest_camera = 'false'
self.use_gazebo_head_camera = 'false'
self.use_gazebo_chest_camera = 'false'
self.gz_control_config_package = ''
self.gz_control_config_file_path = ''

Expand All @@ -32,8 +32,8 @@ def load(self):
' timeout_seconds:=', self.timeout_seconds,
' manipulator_config_file_path:=', self.manipulator_config_file_path,
' use_gazebo:=', self.use_gazebo,
' use_head_camera:=', self.use_head_camera,
' use_chest_camera:=', self.use_chest_camera,
' use_gazebo_head_camera:=', self.use_gazebo_head_camera,
' use_gazebo_chest_camera:=', self.use_gazebo_chest_camera,
' gz_control_config_package:=', self.gz_control_config_package,
' gz_control_config_file_path:=', self.gz_control_config_file_path
])
12 changes: 6 additions & 6 deletions test/test_robot_description_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,21 @@ def test_use_gazebo():
assert 'ign_ros2_control/IgnitionSystem' in exec_load(rdl)


def test_use_head_camera():
# use_head_cameraが変更され、xacroにhead_camera_linkがセットされることを期待
def test_use_gazebo_head_camera():
# use_gazebo_head_cameraが変更され、xacroにhead_camera_linkがセットされることを期待
rdl = RobotDescriptionLoader()
rdl.use_gazebo = 'true'
rdl.use_head_camera = 'true'
rdl.use_gazebo_head_camera = 'true'
rdl.gz_control_config_package = 'sciurus17_description'
rdl.gz_control_config_file_path = 'config/dummy_controllers.yaml'
assert 'reference="head_camera_color_frame"' in exec_load(rdl)


def test_use_chest_camera():
# use_chest_cameraが変更され、xacroにchest_camera_linkがセットされることを期待
def test_use_gazebo_chest_camera():
# use_gazebo_chest_cameraが変更され、xacroにchest_camera_linkがセットされることを期待
rdl = RobotDescriptionLoader()
rdl.use_gazebo = 'true'
rdl.use_chest_camera = 'true'
rdl.use_gazebo_chest_camera = 'true'
rdl.gz_control_config_package = 'sciurus17_description'
rdl.gz_control_config_file_path = 'config/dummy_controllers.yaml'
assert 'reference="chest_camera_link"' in exec_load(rdl)
8 changes: 4 additions & 4 deletions urdf/sciurus17.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
<xacro:include filename="$(find sciurus17_description)/urdf/sciurus17.gazebo_ros2_control.xacro"/>

<xacro:arg name="use_gazebo" default="false" />
<xacro:arg name="use_head_camera" default="false" />
<xacro:arg name="use_chest_camera" default="false" />
<xacro:arg name="use_gazebo_head_camera" default="false" />
<xacro:arg name="use_gazebo_chest_camera" default="false" />
<xacro:arg name="port_name" default="/dev/sciurus17spine" />
<xacro:arg name="baudrate" default="3000000" />
<xacro:arg name="timeout_seconds" default="1.0" />
<xacro:arg name="manipulator_config_file_path" default="" />
<xacro:arg name="gz_control_config_package" default="" />
<xacro:arg name="gz_control_config_file_path" default="" />
<xacro:property name="USE_HEAD_CAMERA" value="$(arg use_head_camera)"/>
<xacro:property name="USE_CHEST_CAMERA" value="$(arg use_chest_camera)"/>
<xacro:property name="USE_GAZEBO_HEAD_CAMERA" value="$(arg use_gazebo_head_camera)"/>
<xacro:property name="USE_GAZEBO_CHEST_CAMERA" value="$(arg use_gazebo_chest_camera)"/>
<xacro:property name="PORT_NAME" value="$(arg port_name)"/>
<xacro:property name="BAUDRATE" value="$(arg baudrate)"/>
<xacro:property name="TIMEOUT_SECONDS" value="$(arg timeout_seconds)"/>
Expand Down
4 changes: 2 additions & 2 deletions urdf/sciurus17_gazebo.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</plugin>
</gazebo>

<xacro:if value="${USE_HEAD_CAMERA}">
<xacro:if value="${USE_GAZEBO_HEAD_CAMERA}">
<gazebo reference="${NAME_HEAD_CAMERA_PREFIX}_color_frame">
<sensor name="sim_realsense_d415" type="rgbd_camera">
<update_rate>10</update_rate>
Expand Down Expand Up @@ -108,7 +108,7 @@
</gazebo>
</xacro:if>

<xacro:if value="${USE_CHEST_CAMERA}">
<xacro:if value="${USE_GAZEBO_CHEST_CAMERA}">
<gazebo reference="${NAME_LINK_CHEST_CAMERA}">
<sensor name="${NAME_CHEST_CAMERA_PREFIX}" type="camera">
<pose relative_to="${NAME_LINK_CHEST_CAMERA}">0 0 0 ${radians(90)} ${radians(-90)} 0</pose>
Expand Down

0 comments on commit 3ac6d65

Please sign in to comment.