diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 3cd4641..71b8aae 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,22 @@ Changelog for package raspimouse_description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1.2.0 (2024-03-05) +------------------ +* シミュレータ環境でscanトピックをpublish (`#52 `_) +* camera_downwardがtrueのときRGBカメラが斜め下を向くように変更 (`#50 `_) + Co-authored-by: Shota Aoki +* READMEにRGBカメラを表示するコマンドを追記 (`#47 `_) +* Gazebo上で画像トピックを配信できるように変更 (`#46 `_) +* RGBカメラのモデルを表示できるように変更 (`#45 `_) + Co-authored-by: Shota Aoki +* cmd_velとodomのトピック名をremapping (`#44 `_) +* controller managerが起動するように変更 (`#43 `_) + Co-authored-by: Shota Aoki +* robot_description_loaderを実装 (`#42 `_) + Co-authored-by: Daisuke Sato +* Contributors: YusukeKato + 1.1.0 (2023-11-07) ------------------ * READMEにRGBカメラを表示するコマンドを追記 (`#47 `_) diff --git a/README.md b/README.md index fc1490b..0666014 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,16 @@ Similarly, display a RGB Camera mounted robot model with the following command: ```sh ros2 launch raspimouse_description display.launch.py use_rgb_camera:=true ``` +![](https://rt-net.github.io/images/raspberry-pi-mouse/mouse_with_rgb_camera.png) + +RGB Camera can be pointed down with the following command: + +```sh +ros2 launch raspimouse_description display.launch.py use_rgb_camera:=true camera_downward:=true +``` + +![](https://rt-net.github.io/images/raspberry-pi-mouse/mouse_with_rgb_camera_downward.png) + ## LICENSE diff --git a/launch/display.launch.py b/launch/display.launch.py index 64f0fb4..6370c74 100644 --- a/launch/display.launch.py +++ b/launch/display.launch.py @@ -44,11 +44,16 @@ def generate_launch_description(): 'use_rgb_camera', default_value='false', description='Set "true" to mount rgb camera.') + declare_arg_camera_downward = DeclareLaunchArgument( + 'camera_downward', + default_value='false', + description='Set "true" to point the camera downwards.') description_loader = RobotDescriptionLoader() description_loader.lidar = LaunchConfiguration('lidar') description_loader.lidar_frame = LaunchConfiguration('lidar_frame') description_loader.use_rgb_camera = LaunchConfiguration('use_rgb_camera') + description_loader.camera_downward = LaunchConfiguration('camera_downward') push_ns = PushRosNamespace([LaunchConfiguration('namespace')]) @@ -78,6 +83,7 @@ def generate_launch_description(): declare_arg_namespace, declare_arg_use_rviz, declare_arg_use_rgb_camera, + declare_arg_camera_downward, push_ns, rsp, jsp, diff --git a/package.xml b/package.xml index 58ffc79..17ec39a 100644 --- a/package.xml +++ b/package.xml @@ -2,7 +2,7 @@ raspimouse_description - 1.1.0 + 1.2.0 The raspimouse_description package RT Corporation diff --git a/raspimouse_description/robot_description_loader.py b/raspimouse_description/robot_description_loader.py index db0218e..96cf3b7 100644 --- a/raspimouse_description/robot_description_loader.py +++ b/raspimouse_description/robot_description_loader.py @@ -36,6 +36,7 @@ def __init__(self): self.lidar_frame = 'laser' self.use_gazebo = 'false' self.use_rgb_camera = 'false' + self.camera_downward = 'false' self.gz_control_config_package = '' self.gz_control_config_file_path = '' @@ -47,6 +48,7 @@ def load(self): ' lidar_frame:=', self.lidar_frame, ' use_gazebo:=', self.use_gazebo, ' use_rgb_camera:=', self.use_rgb_camera, + ' camera_downward:=', self.camera_downward, ' 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 a2aa567..cebc055 100644 --- a/test/test_robot_description_loader.py +++ b/test/test_robot_description_loader.py @@ -22,6 +22,7 @@ from raspimouse_description.robot_description_loader import RobotDescriptionLoader from launch.launch_context import LaunchContext import pytest +import math def exec_load(loader): @@ -108,3 +109,15 @@ def test_camera_link(): rdl.gz_control_config_package = 'raspimouse_description' rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml' assert 'camera_link' in exec_load(rdl) + + +def test_camera_downward(): + # camera_downwardが変更され、カメラが斜め30度下を向くことを期待 + rdl = RobotDescriptionLoader() + rdl.use_gazebo = 'true' + rdl.use_rgb_camera = 'true' + rdl.camera_downward = 'true' + rdl.gz_control_config_package = 'raspimouse_description' + rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml' + camera_angle = math.radians(30) + assert '0 0 0 0 ' + str(camera_angle) + ' 0' in exec_load(rdl) diff --git a/urdf/raspimouse.urdf.xacro b/urdf/raspimouse.urdf.xacro index f183eaf..47ccc63 100644 --- a/urdf/raspimouse.urdf.xacro +++ b/urdf/raspimouse.urdf.xacro @@ -14,6 +14,7 @@ + @@ -102,7 +103,8 @@ + use_rgb_camera="$(arg use_rgb_camera)" + camera_downward="$(arg camera_downward)" /> + + + + diff --git a/urdf/sensors/lidar.gazebo.xacro b/urdf/sensors/lidar.gazebo.xacro index 93fa678..0c90e2b 100644 --- a/urdf/sensors/lidar.gazebo.xacro +++ b/urdf/sensors/lidar.gazebo.xacro @@ -3,8 +3,12 @@ - - 0 0 0 0 0 0 + + 0 0 0 0 0 0 + ${sensor_link_name} + ${sensor_link_name} + scan + 1 $(arg laser_visual) 10 @@ -27,10 +31,6 @@ 0.03 - - scan - ${sensor_link_name} - diff --git a/urdf/sensors/rgb_camera.xacro b/urdf/sensors/rgb_camera.xacro index 3084d45..6cd3c06 100644 --- a/urdf/sensors/rgb_camera.xacro +++ b/urdf/sensors/rgb_camera.xacro @@ -3,51 +3,71 @@ + + - - - - - - - - - - - ogre2 - - - - - - 30.0 - true - camera_link - 0 0 0 0 0 0 - /camera/color/image_raw - - 1.20428 - - 1920 - 1080 - R8G8B8 - - - 0.02 - 300 - - - - - - + + + + + + + + + + + + + + + + + + ogre2 + + + + + + 30.0 + true + camera_link + + 0 0 0 0 ${DOWNWARD_CAMERA_ANGLE} 0 + + + 0 0 0 0 0 0 + + /camera/color/image_raw + + 1.20428 + + 1920 + 1080 + R8G8B8 + + + 0.02 + 300 + + + + + + + - + \ No newline at end of file