Skip to content

Commit

Permalink
ROS 2 Jazzy への対応 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
KuraZuzu authored Oct 24, 2024
1 parent 6db4f04 commit 77ff34c
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 30 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/industrial_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ jobs:
industrial_ci:
strategy:
matrix:
env:
- { ROS_DISTRO: humble, ROS_REPO: ros }
ROS_DISTRO: [jazzy]
ROS_REPO: [ros]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "ros-industrial/industrial_ci@master"
env: ${{ matrix.env }}
env:
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
ROS_REPO: ${{ matrix.ROS_REPO }}
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# raspimouse_description

[![industrial_ci](https://github.com/rt-net/raspimouse_description/actions/workflows/industrial_ci.yml/badge.svg?branch=ros2)](https://github.com/rt-net/raspimouse_description/actions/workflows/industrial_ci.yml)

ROS package with URDF description macro for [Raspberry Pi Mouse](https://rt-net.jp/products/raspberrypimousev3/)

![display_launch](https://rt-net.github.io/images/raspberry-pi-mouse/display_launch.png)

This ROS package was separated from [rt-net/raspimouse_sim](https://github.com/rt-net/raspimouse_sim).
This ROS package was separated from [rt-net/raspimouse_sim](https://github.com/rt-net/raspimouse_sim).
See details from [rt-net/raspimouse_sim#42](https://github.com/rt-net/raspimouse_sim/pull/42).

The main development branch for ROS 1 is [`master`](https://github.com/rt-net/raspimouse_description/tree/master).
The main development branch for ROS 1 is [`master`](https://github.com/rt-net/raspimouse_description/tree/master).
The main development branch for ROS 2 is [`ros2`](https://github.com/rt-net/raspimouse_description/tree/ros2).

## Supported ROS distributions

- Melodic ([`melodic-devel`](https://github.com/rt-net/raspimouse_description/tree/melodic-devel))
- Foxy ([`foxy-devel`](https://github.com/rt-net/raspimouse_description/tree/foxy-devel))
- Humble ([`humble-devel`](https://github.com/rt-net/raspimouse_description/tree/humble-devel))
- Humble ([`humble`](https://github.com/rt-net/raspimouse_description/tree/humble))
- Jazzy ([`jazzy`](https://github.com/rt-net/raspimouse_description/tree/jazzy))

## Installation

```sh
# Clone raspimouse_description and install dependencies
cd ~/ros2_ws/src
git clone -b $ROS_DISTRO-devel https://github.com/rt-net/raspimouse_description
git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_description
rosdep install -r -y -i --from-paths .

# Build the package
Expand Down Expand Up @@ -66,7 +67,7 @@ ros2 launch raspimouse_description display.launch.py use_rgb_camera:=true camera

(C) 2016-2022 RT Corporation

This repository is licensed under the MIT license, see [LICENSE](./LICENSE).
This repository is licensed under the MIT license, see [LICENSE](./LICENSE).
Unless attributed otherwise, everything in this repository is under the MIT license.

### Acknowledgements
Expand Down
5 changes: 2 additions & 3 deletions launch/display.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@


from ament_index_python.packages import get_package_share_directory
from raspimouse_description.robot_description_loader import RobotDescriptionLoader
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
from launch_ros.actions import Node
from launch_ros.actions import PushRosNamespace
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node, PushRosNamespace
from raspimouse_description.robot_description_loader import RobotDescriptionLoader


def generate_launch_description():
Expand Down
5 changes: 3 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
<maintainer email="[email protected]">RT Corporation</maintainer>

<license>MIT</license>

<author email="[email protected]">Daisuke Sato</author>
<author email="[email protected]">Shota Aoki</author>
<author email="[email protected]">Yusuke Kato</author>
<author email="[email protected]">Kazushi Kurasawa</author>

<buildtool_depend>ament_cmake</buildtool_depend>

Expand All @@ -21,7 +22,7 @@
<depend>urdf</depend>
<depend>xacro</depend>
<depend>launch</depend>
<depend>ign_ros2_control</depend>
<depend>gz_ros2_control</depend>
<depend>realsense2_description</depend>

<test_depend>ament_lint_auto</test_depend>
Expand Down
9 changes: 6 additions & 3 deletions test/test_robot_description_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

from raspimouse_description.robot_description_loader import RobotDescriptionLoader
import math

from launch.launch_context import LaunchContext
import pytest
import math

from raspimouse_description.robot_description_loader import \
RobotDescriptionLoader


def exec_load(loader):
Expand Down Expand Up @@ -89,7 +92,7 @@ def test_use_gazebo():
rdl.use_gazebo = 'true'
rdl.gz_control_config_package = 'raspimouse_description'
rdl.gz_control_config_file_path = 'test/dummy_controllers.yaml'
assert 'ign_ros2_control/IgnitionSystem' in exec_load(rdl)
assert 'gz_ros2_control/GazeboSimSystem' in exec_load(rdl)


def test_use_rgb_camera():
Expand Down
4 changes: 2 additions & 2 deletions urdf/raspimouse.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<xacro:arg name="camera_downward" default="false" />
<xacro:arg name="gz_control_config_package" default="" />
<xacro:arg name="gz_control_config_file_path" default="" />

<material name="black">
<color rgba="0.2 0.2 0.2 1.0"/>
</material>
Expand Down Expand Up @@ -109,7 +109,7 @@
<xacro:if value="$(arg use_gazebo)">
<xacro:gazebo_diffdrive_settings
use_gazebo="$(arg use_gazebo)"
config_file_package="$(arg gz_control_config_package)"
config_file_package="$(arg gz_control_config_package)"
config_file_path="$(arg gz_control_config_file_path)" />

<xacro:diffdrive_gazebo_ros2_control_settings
Expand Down
2 changes: 1 addition & 1 deletion urdf/sensors/lidar.gazebo.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<gazebo reference="${sensor_link_name}">
<sensor type="gpu_lidar" name="${sensor_link_name}_sensor">
<pose relative_to='${sensor_link_name}'>0 0 0 0 0 0</pose>
<ignition_frame_id>${sensor_link_name}</ignition_frame_id>
<gz_frame_id>${sensor_link_name}</gz_frame_id>
<frame_id>${sensor_link_name}</frame_id>
<topic>scan</topic>
<always_on>1</always_on>
Expand Down
4 changes: 2 additions & 2 deletions urdf/sensors/lightsens.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<geometry>
<box size="0.01 0.005 0.007" />
</geometry>
<material name="Gray">
<color rgba="0.2 0.2 0.2 1" />
<material name="Red">
<color rgba="1.0 0.0 0.0 1" />
</material>
</visual>
<inertial>
Expand Down
8 changes: 4 additions & 4 deletions urdf/sensors/rgb_camera.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
<origin xyz="0.08 0.0 0.055" rpy="0 0 0"/>
</xacro:sensor_d435>
</xacro:unless>

<xacro:if value="${use_gazebo}">
<gazebo>
<plugin filename="ignition-gazebo-sensors-system" name="ignition::gazebo::systems::Sensors">
<plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>

<gazebo reference="camera_link">
<sensor name="camera_link" type="camera">
<update_rate>30.0</update_rate>
<always_on>true</always_on>
<ignition_frame_id>camera_link</ignition_frame_id>
<gz_frame_id>camera_link</gz_frame_id>
<xacro:if value="${camera_downward}">
<pose>0 0 0 0 ${DOWNWARD_CAMERA_ANGLE} 0</pose>
</xacro:if>
Expand Down
4 changes: 2 additions & 2 deletions urdf/wheel/diffdrive.gazebo.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<gazebo>
<xacro:if value="${use_gazebo}">
<plugin filename="libign_ros2_control-system.so" name="ign_ros2_control::IgnitionROS2ControlPlugin">
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
<ros>
<remapping>diff_drive_controller/cmd_vel_unstamped:=cmd_vel</remapping>
<remapping>diff_drive_controller/cmd_vel:=cmd_vel</remapping>
<remapping>diff_drive_controller/odom:=odom</remapping>
</ros>
<parameters>$(find ${config_file_package})/${config_file_path}</parameters>
Expand Down
2 changes: 1 addition & 1 deletion urdf/wheel/diffdrive.gazebo_ros2_control.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ros2_control name="${name_hardware}" type="system">
<hardware>
<plugin>ign_ros2_control/IgnitionSystem</plugin>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</hardware>

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

0 comments on commit 77ff34c

Please sign in to comment.