diff --git a/README.en.md b/README.en.md index bb4aca5..ebce2b4 100644 --- a/README.en.md +++ b/README.en.md @@ -4,50 +4,63 @@ [![industrial_ci](https://github.com/rt-net/raspimouse_sim/actions/workflows/industrial_ci.yml/badge.svg?branch=ros2)](https://github.com/rt-net/raspimouse_sim/actions/workflows/industrial_ci.yml) -ROS 2 package suite for Raspberry Pi Mouse Simulator runs on Gazebo +ROS 2 package suite for simulating the Raspberry Pi Mouse in Gazebo ![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_color_objects_world.png) -**This branch is intended for ROS 2 Jazzy. For other distributions, please refer to the corresponding branches listed below.** +## Table of Contents -- ROS 2 Humble ([humble](https://github.com/rt-net/raspimouse_sim/tree/humble)) +- [raspimouse\_sim](#raspimouse_sim) + - [Table of Contents](#table-of-contents) + - [Supported ROS distributions](#supported-ros-distributions) + - [Requirements](#requirements) + - [Installation](#installation) + - [Binary Installation](#binary-installation) + - [Source Build](#source-build) + - [QuickStart](#quickstart) + - [Packages](#packages) + - [How to Use Examples](#how-to-use-examples) + - [License](#license) + - [Contributing](#contributing) + - [Acknowledgements](#acknowledgements) +## Supported ROS distributions -## Requirements +### ROS 2 + +- [Humble Hawksbill](https://github.com/rt-net/raspimouse_sim/tree/humble) +- [Jazzy Jalisco](https://github.com/rt-net/raspimouse_sim/tree/jazzy) -requires the following to run: +## Requirements -* Ubuntu - * Ubuntu 24.04 Noble Numbat -* ROS 2 - * ROS 2 Jazzy Jalisco -* Gazebo - * Gazebo Sim 8.x -* ROS 2 Package - * ros-jazzy-desktop-full +- OS + - Ubuntu Desktop 24.04 +- ROS 2 + - ROS 2 Jazzy Jalisco +- Gazebo + - Gazebo Sim 8.x ## Installation -Download this ROS 2 package. +### Binary Installation -```sh -cd ~/ros2_ws/src -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_sim.git +```bash +sudo apt install ros-jazzy-raspimouse-sim ``` -Download the dependent ROS 2 packages. +### Source Build -```sh -cd ~/ros2_ws/src -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_ros2_examples.git -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_slam_navigation_ros2.git -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_description.git -rosdep install -r -y -i --from-paths raspimouse* -``` +```bash +# Create workspace directory +mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src -Build this package using `colcon`. +# Clone package +git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_sim.git -```sh +# Install dependencies +rosdep install -r -y -i --from-paths . + +# Build & Install cd ~/ros2_ws colcon build --symlink-install source ~/ros2_ws/install/setup.bash @@ -55,167 +68,64 @@ source ~/ros2_ws/install/setup.bash ## QuickStart -After building this package, run the following commands. +The following command launches the Gazebo simulator and displays the Raspberry Pi Mouse model. ```sh ros2 launch raspimouse_gazebo raspimouse_with_emptyworld.launch.py ``` -## Examples - -These exsamples require [raspimouse_ros2_examples](https://github.com/rt-net/raspimouse_ros2_examples) to operate. - -### Joystick Controll - -Terminal 1: - -```sh -ros2 launch raspimouse_gazebo raspimouse_with_emptyworld.launch.py -``` - -Terminal 2: - -```sh -ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false -``` - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_joystick.gif) - -### Object Tracking - -Terminal 1: - -```sh -ros2 launch raspimouse_gazebo raspimouse_with_color_objects.launch.py use_rgb_camera:=true -``` - -Terminal 2: - -```sh -ros2 launch raspimouse_ros2_examples object_tracking.launch.py mouse:=false use_camera_node:=false -``` - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_object_tracking.gif) - -### camera_line_follower - -Terminal 1: - -```sh -ros2 launch raspimouse_gazebo raspimouse_with_line_follower_field.launch.py use_rgb_camera:=true camera_downward:=true -``` - -Terminal 2: - -```sh -ros2 launch raspimouse_ros2_examples camera_line_follower.launch.py mouse:=false use_camera_node:=false -``` - -Terminal 3: Start - -```sh -ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: false, switch1: false, switch2: true}" -``` - -Terminal 3: Stop -```sh -ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: true, switch1: false, switch2: false}" -``` - -For information on parameters in camera line follower, click [here](https://github.com/rt-net/raspimouse_ros2_examples/blob/master/README.en.md#parameters). +## Packages -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_camerafollower_short.gif) +- raspimouse_sim + - Manages meta-information for the packages in this repository. +- raspimouse_fake + - This package simulates the motor control interface of the Raspberry Pi Mouse. +- raspimouse_gazebo + - This package provides models and scripts to set up a simulation environment on [Gazebo](https://gazebosim.org). -### SLAM & Navigation +## How to Use Examples -This exsample requires [raspimouse_slam_navigation_ros2](https://github.com/rt-net/raspimouse_slam_navigation_ros2) to operate. - -#### SLAM - -Terminal 1: -```sh -ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg -``` -The lidar option supports `urg`, `lds`, and `rplidar`. - -Terminal 2: -```sh -ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false -``` - -Terminal 3: -```sh -ros2 launch raspimouse_slam pc_slam.launch.py -``` +Detailed usage of the sample program is explained in the [README](./raspimouse_gazebo/README.en.md) of the `raspimouse_gazebo` package. -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_slam.png) +- Examples + - Joystick Control + - Object Tracking + - Camera Line Follower + - SLAM & Navigation -Terminal 4: -```sh -ros2 run nav2_map_server map_saver_cli -f ~/MAP_NAME -``` - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_slam_short.gif) - -#### Navigation - -Terminal 1: -```sh -ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg -``` -The lidar option supports `urg`, `lds`, and `rplidar`. - -Terminal 2: -```sh -ros2 launch raspimouse_navigation pc_navigation.launch.py use_sim_time:=true map:=$HOME/MAP_NAME.yaml -``` - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_navigation_short.gif) - -## Model data list - -### course_curve_50x50cm -Curve course panel for line following. -Panel size is 50 cm x 50 cm and line width is 4 cm. - -![](./raspimouse_gazebo/models/course_curve_50x50cm/meshes/course_curve.jpg) - -### course_straight_50x50cm -Straight course panel for line following. -Panel size is 50 cm x 50 cm and line width is 4 cm. - -![](./raspimouse_gazebo/models/course_straight_50x50cm/meshes/course_straight.jpg) - -### cube_*cm_color-name -Each cube is 5 cm, 7.5 cm, 10 cm, and 15 cm, 30 cm on a side. -The cube colors are red, yellow, blue, green and black. +## License -![](https://rt-net.github.io/images/raspberry-pi-mouse/color_objects.png) +(C) 2016 RT Corporation \ -### about dae files -The dae file is edited in Blender 4.0. +Each file is licensed as stated in their headers. +If no license is specified, the file is licensed under the MIT License. +The full license text is available in the [LICENSE](./LICENSE) file or at [https://opensource.org/license/MIT](https://opensource.org/license/MIT). -## License +## Contributing -This repository is licensed under the MIT license, see [LICENSE]( ./LICENSE ). -Unless attributed otherwise, everything in this repository is under the MIT license. +- This software is open source, but its development is not open. +- This software is essentially provided as open source software on an “AS IS” (in its current state) basis. +- No free support is available for this software. +- Requests for bug fixes and corrections of typographical errors are always accepted; however, requests for additional features will be subject to our internal guidelines. For further details, please refer to the [Contribution Guidelines](https://github.com/rt-net/.github/blob/master/CONTRIBUTING.md). ### Acknowledgements -* [CIR-KIT/fourth_robot_pkg]( https://github.com/CIR-KIT/fourth_robot_pkg ) - * author - * RyodoTanaka - * maintainer - * RyodoTanaka - * BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) - * See [package.xml](https://github.com/CIR-KIT/fourth_robot_pkg/blob/indigo-devel/fourth_robot_control/package.xml) for details. -* [yujinrobot/kobuki]( https://github.com/yujinrobot/kobuki ) - * authors - * Daniel Stonier - * Younghun Ju - * Jorge Santos Simon - * Marcus Liebhardt - * maintainer - * Daniel Stonier - * BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) - * See [package.xml](https://github.com/yujinrobot/kobuki/blob/melodic/kobuki/package.xml) for details。 +This repository is developed based on files from the following repository. + +- [CIR-KIT/fourth_robot_pkg]( https://github.com/CIR-KIT/fourth_robot_pkg ) + - author + - RyodoTanaka + - maintainer + - RyodoTanaka + - BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) + - For details, see [package.xml](https://github.com/CIR-KIT/fourth_robot_pkg/blob/indigo-devel/fourth_robot_control/package.xml). +- [yujinrobot/kobuki]( https://github.com/yujinrobot/kobuki ) + - authors + - Daniel Stonier + - Younghun Ju + - Jorge Santos Simon + - Marcus Liebhardt + - maintainer + - Daniel Stonier + - BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) + - For details, see [package.xml](https://github.com/yujinrobot/kobuki/blob/melodic/kobuki/package.xml). \ No newline at end of file diff --git a/README.md b/README.md index 8bfda49..a56dc3e 100644 --- a/README.md +++ b/README.md @@ -4,49 +4,63 @@ [![industrial_ci](https://github.com/rt-net/raspimouse_sim/actions/workflows/industrial_ci.yml/badge.svg?branch=ros2)](https://github.com/rt-net/raspimouse_sim/actions/workflows/industrial_ci.yml) -Gazebo上でシミュレートできるRaspberry Pi MouseのROS 2パッケージです。 +Gazebo上でRaspberry Pi Mouseの動作をシミュレーションするためのROS 2パッケージです。 ![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_color_objects_world.png) -**本ブランチはROS 2 Jazzy向けです。他のディストリビューションについては、以下にリストされた対応するブランチを参照してください。** +## Table of Contents -- ROS 2 Humble ([humble](https://github.com/rt-net/raspimouse_sim/tree/humble)) +- [raspimouse\_sim](#raspimouse_sim) + - [Table of Contents](#table-of-contents) + - [Supported ROS distributions](#supported-ros-distributions) + - [Requirements](#requirements) + - [Installation](#installation) + - [Binary Installation](#binary-installation) + - [Source Build](#source-build) + - [QuickStart](#quickstart) + - [Packages](#packages) + - [How to Use Examples](#how-to-use-examples) + - [License](#license) + - [Contributing](#contributing) + - [Acknowledgements](#acknowledgements) -## 動作環境 +## Supported ROS distributions -以下の環境を前提として動作確認しています。 +### ROS 2 -* Ubuntu - * Ubuntu 24.04 Noble Numbat -* ROS 2 - * ROS 2 Jazzy Jalisco -* Gazebo - * Gazebo Sim 8.x -* ROS 2 Package - * ros-jazzy-desktop-full +- [Humble Hawksbill](https://github.com/rt-net/raspimouse_sim/tree/humble) +- [Jazzy Jalisco](https://github.com/rt-net/raspimouse_sim/tree/jazzy) -## インストール方法 +## Requirements -このROS 2パッケージをダウンロードします。 +- OS + - Ubuntu Desktop 24.04 +- ROS 2 + - ROS 2 Jazzy Jalisco +- Gazebo + - Gazebo Sim 8.x -```sh -cd ~/ros2_ws/src -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_sim.git -``` +## Installation -依存しているROS 2パッケージをインストールします。 +### Binary Installation -```sh -cd ~/ros2_ws/src -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_ros2_examples.git -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_slam_navigation_ros2.git -git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_description.git -rosdep install -r -y -i --from-paths raspimouse* +```bash +sudo apt install ros-jazzy-raspimouse-sim ``` -`colcon`を使用してパッケージをビルドします。 +### Source Build -```sh +```bash +# Create workspace directory +mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src + +# Clone package +git clone -b $ROS_DISTRO https://github.com/rt-net/raspimouse_sim.git + +# Install dependencies +rosdep install -r -y -i --from-paths . + +# Build & Install cd ~/ros2_ws colcon build --symlink-install source ~/ros2_ws/install/setup.bash @@ -54,173 +68,65 @@ source ~/ros2_ws/install/setup.bash ## QuickStart -パッケージビルド後、次のコマンドを実行するとGazeboシミュレータが起動します。 +次のコマンドを実行し、Gazeboシミュレータを起動してRaspberry Pi Mouseのモデルを表示します。 ```sh ros2 launch raspimouse_gazebo raspimouse_with_emptyworld.launch.py ``` -## サンプル動作例 - -各サンプルの動作には、[raspimouse_ros2_examples](https://github.com/rt-net/raspimouse_ros2_examples)が必要です。 - -### ジョイスティックコントローラによる操縦サンプル - -端末1で次のコマンドを実行すると、Gazeboシミュレータが起動します。 - -```sh -ros2 launch raspimouse_gazebo raspimouse_with_emptyworld.launch.py -``` - -端末2で次のコマンドを実行すると、Raspberry Pi Mouseをジョイスティックコントローラで操作できます。 - -```sh -ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false -``` - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_joystick.gif) - -### RGBカメラを用いた色検出による物体追従サンプル - -端末1で次のコマンドを実行すると、色付きの立方体が配置されたワールドが表示されます。 - -```sh -ros2 launch raspimouse_gazebo raspimouse_with_color_objects.launch.py use_rgb_camera:=true -``` - -端末2で次のコマンドを実行すると、Raspberry Pi Mouseがオレンジ色(赤色)の物体を追従します。 - -```sh -ros2 launch raspimouse_ros2_examples object_tracking.launch.py mouse:=false use_camera_node:=false -``` - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_object_tracking.gif) - -### RGBカメラを用いたライントレースサンプル - -端末1で次のコマンドを実行すると、ライントレースのサンプルコースが配置されたワールドが表示されます。 -```sh -ros2 launch raspimouse_gazebo raspimouse_with_line_follower_field.launch.py use_rgb_camera:=true camera_downward:=true -``` - -端末2で次のコマンドを実行すると、カメラライントレースのノードが起動します。 -```sh -ros2 launch raspimouse_ros2_examples camera_line_follower.launch.py mouse:=false use_camera_node:=false -``` - -端末3で次のコマンドを実行すると、Raspberry Pi Mouseが走行を開始します。 -```sh -ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: false, switch1: false, switch2: true}" -``` - -次のコマンドを実行すると、Raspberry Pi Mouseが停止します。 -```sh -ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: true, switch1: false, switch2: false}" -``` - -カメラライントレースにおけるパラメータは[こちら](https://github.com/rt-net/raspimouse_ros2_examples?tab=readme-ov-file#parameters)を参照してください。 - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_camerafollower_short.gif) - -### LiDARを用いたSLAMとNavigationのサンプル - -本サンプルの動作には、[raspimouse_slam_navigation_ros2](https://github.com/rt-net/raspimouse_slam_navigation_ros2) が必要です。 - -#### SLAM - -端末1で次のコマンドを実行すると、`Lake House`のモデルが配置されたワールドが表示されます。 -```sh -ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg -``` -`lidar`は`urg`、`lds`、`rplidar`のいずれかを指定してください。 - -端末2で次のコマンドを実行すると、Raspberry Pi Mouseをジョイスティックコントローラで操作できます。 -```sh -ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false -``` - -端末3で次のコマンドを実行すると、SLAMが実行されます。 -```sh -ros2 launch raspimouse_slam pc_slam.launch.py -``` - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_slam.png) - -端末4で次のコマンドを実行すると、作成した地図を保存できます。 -```sh -ros2 run nav2_map_server map_saver_cli -f ~/MAP_NAME -``` -`MAP_NAME`は任意の名前を指定できます。 - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_slam_short.gif) - -#### Navigation - -端末1で次のコマンドを実行すると、`Lake House`のモデルが配置されたワールドが表示されます。 -```sh -ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg -``` -`lidar`は`urg`、`lds`、`rplidar`のいずれかを指定してください。 - -端末2で次のコマンドを実行すると、Navigationが実行されます。 -```sh -ros2 launch raspimouse_navigation pc_navigation.launch.py use_sim_time:=true map:=$HOME/MAP_NAME.yaml -``` -引数`map`にはSLAMで作成した地図ファイルのパスを指定してください。 - -![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_navigation_short.gif) - -## モデルデータ一覧 - -### course_curve_50x50cm - -ライントレース用の曲線コースパネルです。 -パネルサイズは50cm x 50cm、線の幅は4cmです。 - -![](./raspimouse_gazebo/models/course_curve_50x50cm/meshes/course_curve.jpg) +## Packages -### course_straight_50x50cm +- raspimouse_sim + - 本リポジトリに含まれる複数のパッケージに関するメタ情報を管理します。 +- raspimouse_fake + - Raspberry Pi Mouseのモータ制御インターフェースを模擬するパッケージです。 +- raspimouse_gazebo + - [Gazebo](https://gazebosim.org)上でシミュレーション環境を構築するためのモデルやスクリプトを提供するパッケージです。 -ライントレース用の直線コースパネルです。 -パネルサイズは50cm x 50cm、線の幅は4cmです。 +## How to Use Examples -![](./raspimouse_gazebo/models/course_straight_50x50cm/meshes/course_straight.jpg) +サンプルプログラムの詳細な動作方法は、`raspimouse_gazebo`パッケージの[README](./raspimouse_gazebo/README.md)で説明しています。 -### cube_*cm_color-name -それぞれ一辺5cm、7.5cm、10cm、15cm、30cmの立方体です。 -色は赤、黄、青、緑、黒です。 +- Examples + - Joystick Control + - Object Tracking + - Camera Line Follower + - SLAM & Navigation -![](https://rt-net.github.io/images/raspberry-pi-mouse/color_objects.png) +## License -### daeファイルについて -daeファイルはBlender 4.0で編集しています。 +(C) 2016 RT Corporation \ -## ライセンス +各ファイルはライセンスがファイル中に明記されている場合、そのライセンスに従います。特に明記されていない場合は、MIT Licenseに基づき公開されています。 +ライセンスの全文は[LICENSE](./LICENSE)または[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)から確認できます。 -このリポジトリはMITライセンスに基づいて公開されています。 -MITライセンスについては[LICENSE]( ./LICENSE )を確認してください。 +## Contributing -※このソフトウェアは基本的にオープンソースソフトウェアとして「AS IS」(現状有姿のまま)で提供しています。本ソフトウェアに関する無償サポートはありません。 -バグの修正や誤字脱字の修正に関するリクエストは常に受け付けていますが、それ以外の機能追加等のリクエストについては社内のガイドラインを優先します。 +- 本ソフトウェアはオープンソースですが、開発はオープンではありません。 +- 本ソフトウェアは基本的にオープンソースソフトウェアとして「AS IS」(現状有姿のまま)で提供しています。 +- 本ソフトウェアに関する無償サポートは行っていません。 +- バグの修正や誤字脱字の修正に関するリクエストは常に受け付けていますが、 +それ以外の機能追加等のリクエストについては社内のガイドラインを優先します。 +詳しくは[コントリビューションガイドライン](https://github.com/rt-net/.github/blob/master/CONTRIBUTING.md)に従ってください。 -### 謝辞 +### Acknowledgements -以下のリポジトリのファイルをベースに開発されています。 +本リポジトリは、以下のリポジトリのファイルをベースに開発されています。 -* [CIR-KIT/fourth_robot_pkg]( https://github.com/CIR-KIT/fourth_robot_pkg ) - * author - * RyodoTanaka - * maintainer - * RyodoTanaka - * BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) - * 詳細は [package.xml](https://github.com/CIR-KIT/fourth_robot_pkg/blob/indigo-devel/fourth_robot_control/package.xml) を参照してください。 -* [yujinrobot/kobuki]( https://github.com/yujinrobot/kobuki ) - * authors - * Daniel Stonier - * Younghun Ju - * Jorge Santos Simon - * Marcus Liebhardt - * maintainer - * Daniel Stonier - * BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) - * 詳細は [package.xml](https://github.com/yujinrobot/kobuki/blob/melodic/kobuki/package.xml) を参照してください。 +- [CIR-KIT/fourth_robot_pkg](https://github.com/CIR-KIT/fourth_robot_pkg) + - author + - RyodoTanaka + - maintainer + - RyodoTanaka + - BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) + - 詳細は [package.xml](https://github.com/CIR-KIT/fourth_robot_pkg/blob/indigo-devel/fourth_robot_control/package.xml) を参照してください。 +- [yujinrobot/kobuki]( https://github.com/yujinrobot/kobuki ) + - authors + - Daniel Stonier + - Younghun Ju + - Jorge Santos Simon + - Marcus Liebhardt + - maintainer + - Daniel Stonier + - BSD ([BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)) + - 詳細は [package.xml](https://github.com/yujinrobot/kobuki/blob/melodic/kobuki/package.xml) を参照してください。 diff --git a/raspimouse_gazebo/README.en.md b/raspimouse_gazebo/README.en.md new file mode 100644 index 0000000..95d19de --- /dev/null +++ b/raspimouse_gazebo/README.en.md @@ -0,0 +1,202 @@ +[English](README.en.md) | [日本語](README.md) + +# raspimouse_gazebo + +This package provides models and scripts to set up a simulation environment in Gazebo. + +![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_color_objects_world.png) + +## Table of Contents + +- [raspimouse\_gazebo](#raspimouse_gazebo) + - [Table of Contents](#table-of-contents) + - [How To Use Examples](#how-to-use-examples) + - [Joystick Control](#joystick-control) + - [Object Tracking](#object-tracking) + - [Camera Line Follower](#camera_line_follower) + - [SLAM & Navigation](#slam--navigation) + - [Model data list](#etc-lifecycle-description等) + +## How to Use Examples + +### Joystick Control + +Operates using a joystick controller. + + + +Run the following command in Terminal 1 to launch the Gazebo simulator. + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_emptyworld.launch.py +``` + +Run the following command in Terminal 2 to control the Raspberry Pi Mouse using a joystick controller. + +```sh +ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false +``` + +[back to example list](#how-to-use-examples) + +--- + +### Object Tracking + +Follows an orange (red) object. + + + + +Run the following command in Terminal 1 to launch a world with colored cubes. + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_color_objects.launch.py use_rgb_camera:=true +``` + +Run the following command in Terminal 2 to make the Raspberry Pi Mouse follow an orange (red) object. + +```sh +ros2 launch raspimouse_ros2_examples object_tracking.launch.py mouse:=false use_camera_node:=false +``` + +[back to example list](#how-to-use-examples) + +--- + +### camera_line_follower + +Follows a black line. + +For parameters used in camera-based line tracing, please refer to this [section](https://github.com/rt-net/raspimouse_ros2_examples?tab=readme-ov-file#parameters). + + + + + +Run the following command in Terminal 1 to launch a world with a sample course for line tracing. + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_line_follower_field.launch.py use_rgb_camera:=true camera_downward:=true +``` + +Run the following command in Terminal 2 to start the camera-based line tracing node. + +```sh +ros2 launch raspimouse_ros2_examples camera_line_follower.launch.py mouse:=false use_camera_node:=false +``` + +Run the following command in Terminal 3 to start the Raspberry Pi Mouse's movement. + +```sh +ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: false, switch1: false, switch2: true}" +``` + +Run the following command to stop the Raspberry Pi Mouse. + +```sh +ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: true, switch1: false, switch2: false}" +``` + +[back to example list](#how-to-use-examples) + +--- + +### SLAM & Navigation + +Runs SLAM and navigation using LiDAR. + +> [!NOTE] +> This sample requires [raspimouse_slam_navigation_ros2](https://github.com/rt-net/raspimouse_slam_navigation_ros2) to run. + +#### SLAM + +Runs SLAM for localization and mapping. + + + + + +Run the following command in Terminal 1 to launch a world with the `Lake House` model placed in it. + +> [!NOTE] +> The `lidar` option supports `urg`, `lds`, and `rplidar`. + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg +``` + +Run the following command in Terminal 2 to control the Raspberry Pi Mouse with a joystick controller. + +```sh +ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false +``` + +Run the following command in Terminal 3 to run SLAM. + +```sh +ros2 launch raspimouse_slam pc_slam.launch.py +``` + +Run the following command in Terminal 4 to save the created map. + +> [!NOTE] +> You can specify any name for `MAP_NAME`. + +```sh +ros2 run nav2_map_server map_saver_cli -f ~/MAP_NAME +``` + +#### Navigation + +Navigate using the created map. + + + +Run the following command in Terminal 1 to launch a world with the `Lake House` model placed in it. + +> [!NOTE] +> The `lidar` option supports `urg`, `lds`, and `rplidar`. + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg +``` + +Run the following command in Terminal 2 to run Navigation. + +> [!NOTE] +> Specify the path to the map file created by SLAM for the map argument. + +```sh +ros2 launch raspimouse_navigation pc_navigation.launch.py use_sim_time:=true map:=$HOME/MAP_NAME.yaml +``` + +[back to example list](#how-to-use-examples) + +--- + +## Model Data List + +This is a list of model data used in the various samples. + +> [!NOTE] +> The dae file is edited in Blender 4.0. + +- `course_curve_50x50cm` + - Curve course panel for line following. + - Panel size is 50 cm x 50 cm and line width is 4 cm. + + + +- `course_straight_50x50cm` + - Straight course panel for line following. + - Panel size is 50 cm x 50 cm and line width is 4 cm. + + + +- `cube_*cm_color-name` + - The cube colors are red, yellow, blue, green and black. + - Each cube is 5 cm, 7.5 cm, 10 cm, and 15 cm, 30 cm on a side. + + + diff --git a/raspimouse_gazebo/README.md b/raspimouse_gazebo/README.md new file mode 100644 index 0000000..34ab260 --- /dev/null +++ b/raspimouse_gazebo/README.md @@ -0,0 +1,198 @@ +[English](README.en.md) | [日本語](README.md) + +# raspimouse_gazebo + +Gazebo上でシミュレーション環境を構築するためのモデルやスクリプトを提供するパッケージです。 + +![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_color_objects_world.png) + +## Table of Contents + +- [raspimouse\_gazebo](#raspimouse_gazebo) + - [Table of Contents](#table-of-contents) + - [How To Use Examples](#how-to-use-examples) + - [Joystick Control](#joystick-control) + - [Object Tracking](#object-tracking) + - [Camera Line Follower](#camera_line_follower) + - [SLAM & Navigation](#slam--navigation) + - [Model data list](#etc-lifecycle-description等) + +## How to Use Examples + +### Joystick Control + +Raspberry Pi Mouseをジョイスティックコントローラで操作します。 + + + + +端末1で次のコマンドを実行し、Gazeboシミュレータを起動します。 + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_emptyworld.launch.py +``` + +端末2で次のコマンドを実行し、Raspberry Pi Mouseをジョイスティックコントローラで操作できます。 + +```sh +ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false +``` + +[back to example list](#how-to-use-examples) + +--- + +### Object Tracking + +Raspberry Pi Mouseがオレンジ色(赤色)の物体を追従します。 + + + + +端末1で次のコマンドを実行し、色付きの立方体が配置されたワールドを表示します。 + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_color_objects.launch.py use_rgb_camera:=true +``` + +端末2で次のコマンドを実行し、Raspberry Pi Mouseがオレンジ色(赤色)の物体を追従します。 + +```sh +ros2 launch raspimouse_ros2_examples object_tracking.launch.py mouse:=false use_camera_node:=false +``` + +[back to example list](#how-to-use-examples) + +--- + +### camera_line_follower + +Raspberry Pi Mouseが、黒いラインを追従します。 + +カメラライントレースにおけるパラメータは[こちら](https://github.com/rt-net/raspimouse_ros2_examples?tab=readme-ov-file#parameters)を参照してください。 + + + + +端末1で次のコマンドを実行し、ライントレースのサンプルコースが配置されたワールドを表示します。 +```sh +ros2 launch raspimouse_gazebo raspimouse_with_line_follower_field.launch.py use_rgb_camera:=true camera_downward:=true +``` + +端末2で次のコマンドを実行し、カメラライントレースのノードを起動します。 +```sh +ros2 launch raspimouse_ros2_examples camera_line_follower.launch.py mouse:=false use_camera_node:=false +``` + +端末3で次のコマンドを実行し、Raspberry Pi Mouseを走行させます。 +```sh +ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: false, switch1: false, switch2: true}" +``` + +次のコマンドを実行すると、Raspberry Pi Mouseが停止します。 +```sh +ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: true, switch1: false, switch2: false}" +``` + +[back to example list](#how-to-use-examples) + +--- + +### SLAM & Navigation + +Raspberry Pi MouseがLiDARを使用したSLAMとNavigationを行います。 + +> [!NOTE] +> 本サンプルの動作には、[raspimouse_slam_navigation_ros2](https://github.com/rt-net/raspimouse_slam_navigation_ros2) が必要です。 + +#### SLAM + +SLAMによる自己位置推定と地図作成を行います。 + + + + + +端末1で次のコマンドを実行し、`Lake House`のモデルが配置されたワールドを表示します。 + +> [!NOTE] +> `lidar`は`urg`、`lds`、`rplidar`のいずれかを指定してください。 + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg +``` + +端末2で次のコマンドを実行し、ジョイスティックコントローラでRaspberry Pi Mouseを手動操作します。 + +```sh +ros2 launch raspimouse_ros2_examples teleop_joy.launch.py joydev:="/dev/input/js0" joyconfig:=f710 mouse:=false +``` + +端末3で次のコマンドを実行し、SLAMを開始します。 + +```sh +ros2 launch raspimouse_slam pc_slam.launch.py +``` + +端末4で次のコマンドを実行し、作成した地図を保存します。 + +> [!NOTE] +> `MAP_NAME`は任意の名前を指定できます。 + +```sh +ros2 run nav2_map_server map_saver_cli -f ~/MAP_NAME +``` + +#### Navigation + +作成した地図をもとにNavigationを行います。 + + + +端末1で次のコマンドを実行し、`Lake House`のモデルが配置されたワールドを表示します。 + +> [!NOTE] +> `lidar`は`urg`、`lds`、`rplidar`のいずれかを指定してください。 + +```sh +ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg +``` + +端末2で次のコマンドを実行し、Navigationを開始します。 + +> [!NOTE] +> 引数`map`にはSLAMで作成した地図ファイルのパスを指定してください。 + +```sh +ros2 launch raspimouse_navigation pc_navigation.launch.py use_sim_time:=true map:=$HOME/MAP_NAME.yaml +``` + +[back to example list](#how-to-use-examples) + +--- + +## Model Data List + +各種サンプルで使用しているモデルデータ一覧です。 + +> [!NOTE] +> daeファイルはBlender 4.0で編集されています。 + +- `course_curve_50x50cm` + - ライントレース用の曲線コースパネルです。 + - パネルサイズは50cm x 50cm、線の幅は4cmです。 + + + +- `course_straight_50x50cm` + - ライントレース用の直線コースパネルです。 + - パネルサイズは50cm x 50cm、線の幅は4cmです。 + + + +- `cube_*cm_color-name` + - 色は赤、黄、青、緑、黒です。 + - それぞれ一辺5cm、7.5cm、10cm、15cm、30cmの立方体です。 + + +