Skip to content

Commit 4cf674f

Browse files
YusukeKatoShota Aoki
and
Shota Aoki
authored
カメラライントレースとSLAM&Navigationの説明を追加 (#38)
Co-authored-by: Shota Aoki <[email protected]>
1 parent 7af0d73 commit 4cf674f

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

Diff for: docs/raspimouse/ros/samples.md

+9
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ robot: Raspberry Pi Mouse
160160

161161
<iframe width="560" height="315" src="https://www.youtube.com/embed/oPm0sW2V_tY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
162162

163+
## カメラによるライントレース {: #camera-line-follower}
164+
165+
=== "ROS 2"
166+
実行手順は[ROS 2サンプル集のcamera_line_follower](https://github.com/rt-net/raspimouse_ros2_examples#camera_line_follower){target=_blank rel=noopener}
167+
を参照してください。
168+
PCから操縦する場合はネットワークと環境変数を設定してください。
169+
170+
<iframe width="560" height="315" src="https://www.youtube.com/embed/Rxa1UBMUgq4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
171+
163172
## LiDARでSLAM {: #slam}
164173

165174
=== "ROS"

Diff for: docs/raspimouse/simulator/install.md

+7
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@ Raspberry Pi Mouse Simulator([rt-net/raspimouse_sim](https://github.com/rt-net
6868

6969
```sh
7070
git clone -b humble-devel https://github.com/rt-net/raspimouse_ros2_examples.git
71+
git clone -b humble-devel https://github.com/rt-net/raspimouse_slam_navigation_ros2.git
7172
rosdep install -r -y -i --from-paths raspimouse*
7273
```
7374

75+
キーボードで操作するためのパッケージをインストール
76+
77+
```sh
78+
git clone -b dashing https://github.com/ros2/teleop_twist_keyboard.git
79+
```
80+
7481
パッケージをビルド
7582

7683
```sh

Diff for: docs/raspimouse/simulator/samples.md

+96
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,99 @@ robot: Raspberry Pi Mouse
6767
```
6868

6969
![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_object_tracking.gif)
70+
71+
## RGBカメラによるライントレース {: #camera_line_follower}
72+
73+
=== "ROS 2"
74+
次のコマンドを実行します。
75+
76+
シミュレータの起動
77+
78+
```sh
79+
ros2 launch raspimouse_gazebo raspimouse_with_line_follower_field.launch.py use_rgb_camera:=true camera_downward:=true
80+
```
81+
82+
カメラライントレースを実行
83+
84+
```sh
85+
ros2 launch raspimouse_ros2_examples camera_line_follower.launch.py mouse:=false use_camera_node:=false
86+
```
87+
88+
走行開始
89+
90+
```sh
91+
ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: false, switch1: false, switch2: true}"
92+
```
93+
94+
走行停止
95+
96+
```sh
97+
ros2 topic pub --once /switches raspimouse_msgs/msg/Switches "{switch0: true, switch1: false, switch2: false}"
98+
```
99+
100+
カメラライントレースにおけるパラメータは[こちら](https://github.com/rt-net/raspimouse_ros2_examples?tab=readme-ov-file#parameters)を参照してください。
101+
102+
![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_camerafollower_short.gif)
103+
104+
## SLAM {: #slam}
105+
106+
=== "ROS 2"
107+
次のコマンドを実行します。
108+
109+
シミュレータの起動
110+
111+
```sh
112+
ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg
113+
```
114+
115+
`lidar`は`urg`、`lds`、`rplidar`のいずれかを指定してください。
116+
117+
キーボードで操作
118+
119+
```sh
120+
ros2 run teleop_twist_keyboard teleop_twist_keyboard
121+
```
122+
123+
SLAMを実行
124+
125+
```sh
126+
ros2 launch raspimouse_slam pc_slam.launch.py
127+
```
128+
129+
Raspberry Pi Mouseを走らせて地図を作成
130+
131+
![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_slam.png)
132+
133+
作成した地図を保存
134+
135+
```sh
136+
ros2 run nav2_map_server map_saver_cli -f ~/MAP_NAME
137+
```
138+
139+
`MAP_NAME`は任意の名前を指定できます。
140+
141+
![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_slam_short.gif)
142+
143+
## Navigation {: #navigation}
144+
145+
=== "ROS 2"
146+
次のコマンドを実行します。
147+
148+
シミュレータの起動
149+
150+
```sh
151+
ros2 launch raspimouse_gazebo raspimouse_with_lakehouse.launch.py lidar:=urg
152+
```
153+
154+
`lidar`は`urg`、`lds`、`rplidar`のいずれかを指定してください。
155+
156+
Navigationを実行
157+
158+
```sh
159+
ros2 launch raspimouse_navigation pc_navigation.launch.py map:=$HOME/MAP_NAME.yaml
160+
```
161+
162+
引数`map`にはSLAMで作成した地図ファイルのパスを指定してください。
163+
164+
![](https://rt-net.github.io/images/raspberry-pi-mouse/raspimouse_sim_navigation_short.gif)
165+

0 commit comments

Comments
 (0)