Skip to content

Commit bfe0bc3

Browse files
KuraZuzuYusukeKato
andauthored
[Raspberry Pi Mouse]ROS 2 Jazzyのチュートリアルを追加 (#40)
Co-authored-by: YusukeKato <[email protected]>
1 parent 58dcda1 commit bfe0bc3

File tree

8 files changed

+251
-77
lines changed

8 files changed

+251
-77
lines changed
Loading
Loading

docs/raspimouse/driver/install.md

Lines changed: 57 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ Raspberry Pi MouseのLEDやモータを駆動するためには、
2727

2828
## OSのインストール {: #os-installation}
2929

30-
Raspberry Pi Mouseのデバイスドライバは"Ubuntu"と"Raspberry Pi OS"(旧称"Raspbian")に対応しています。
30+
Raspberry Pi Mouseのデバイスドライバは、"Ubuntu"と"Raspberry Pi OS"(旧称"Raspbian")に対応しています。
31+
ここではUbuntuとRaspberry Pi OSのインストール手順を紹介します。
3132

32-
ここではUbuntu(Ubuntu Server 22.04, Ubuntu Server 20.04)と、Raspberry Pi OSのインストール手順を紹介します。
33+
後ほどRaspberry Pi MouseでROSを扱う場合は、Ubuntuのインストールを推奨します。各種ROSとUbuntuのバージョン対応表は以下の通りです。
34+
35+
| ROS | Ubuntu |
36+
| ---- | ---- |
37+
| ROS Noetic | Ubuntu Server 20.04(64bit版) |
38+
| ROS 2 Humble | Ubuntu Server 22.04(64bit版) |
39+
| ROS 2 Jazzy | Ubuntu Server 24.04(64bit版)|
3340

34-
後ほどRaspberry Pi Mouseで**ROSを扱う場合はUbuntu Server 20.04(64bit版)を、ROS 2を扱う場合はUbuntu Server 22.04(64bit版)のインストールを推奨します**
3541

3642
!!! info
3743
出荷時に付属しているRaspberry Pi OSインストール済みのmicroSDカードを利用する場合は、OSインストール手順を飛ばしてそのまま[ソースファイルのダウンロードとインストール](#driver-installation)に進むことができます。
@@ -41,15 +47,29 @@ Raspberry Pi Mouseのデバイスドライバは"Ubuntu"と"Raspberry Pi OS"(
4147
Raspberry PiやRaspberry Pi Mouse本体を**故障させないように**注意してください。
4248
詳細はRaspberry Pi Mouseの**[製品マニュアル](https://rt-net.jp/products/raspberrypimousev3/#downloads)を参照してください**
4349

50+
=== "Ubuntu Server 24.04"
51+
1. [https://www.raspberrypi.org/software/](https://www.raspberrypi.org/software/){target=_blank rel=noopener} にアクセスします
52+
1. Raspberry Pi Imagerをダウンロードします
53+
![](../../img/raspimouse/driver/download_raspberry_pi_imager.png)
54+
1. SDカードをPCに接続します
55+
1. Raspberry Pi Imagerを起動します
56+
1. 書き込むOSを"Other general-purpose OS" -> "Ubuntu" -> "Ubuntu Server 24.04.* LTS"、書き込み先をSDカードに設定します __ROS 2を使う場合は64bit版__ を選択します
57+
![](../../img/raspimouse/driver/pi_imager_settings_ubuntu_24_64bit.png)
58+
1. "WRITE" を押して書き込みを開始します
59+
![](../../img/raspimouse/driver/pi_imager_settings_ubuntu_24.png)
60+
1. SDカードをRaspberry Piに取り付け、Raspberry Piの電源を入れます
61+
1. login:`ubuntu`、password:`ubuntu`でログインし、パスワードを変更します
62+
1. `$ sudo apt update && sudo apt upgrade`を実行します
63+
4464
=== "Ubuntu Server 22.04"
4565
1. [https://www.raspberrypi.org/software/](https://www.raspberrypi.org/software/){target=_blank rel=noopener} にアクセスします
4666
1. Raspberry Pi Imagerをダウンロードします
4767
![](../../img/raspimouse/driver/download_raspberry_pi_imager.png)
4868
1. SDカードをPCに接続します
4969
1. Raspberry Pi Imagerを起動します
50-
1. 書き込むOSを"Other general-purpose OS" -> "Ubuntu" -> "Ubuntu Server 22.04.* LTS"、書き込み先をSDカードに設定します __ROS 2を使う場合は64bit版__ を選択します
70+
1. 書き込むOSを"Other general-purpose OS" -> "Ubuntu" -> "Ubuntu Server 22.04.* LTS"、書き込み先をSDカードに設定します __ROS 2を使う場合は64bit版__ を選択します
5171
![](../../img/raspimouse/driver/pi_imager_settings_ubuntu_22_64bit.png)
52-
1. "書き込む" を押して書き込みを開始します
72+
1. "WRITE" を押して書き込みを開始します
5373
![](../../img/raspimouse/driver/pi_imager_settings_ubuntu_22.png)
5474
1. SDカードをRaspberry Piに取り付け、Raspberry Piの電源を入れます
5575
1. login:`ubuntu`、password:`ubuntu`でログインし、パスワードを変更します
@@ -61,9 +81,9 @@ Raspberry Pi Mouseのデバイスドライバは"Ubuntu"と"Raspberry Pi OS"(
6181
![](../../img/raspimouse/driver/download_raspberry_pi_imager.png)
6282
1. SDカードをPCに接続します
6383
1. Raspberry Pi Imagerを起動します
64-
1. 書き込むOSを"Other general-purpose OS" -> "Ubuntu" -> "Ubuntu Server 20.04.* LTS"、書き込み先をSDカードに設定します __ROSを使う場合は64bit版__ を選択します
84+
1. 書き込むOSを"Other general-purpose OS" -> "Ubuntu" -> "Ubuntu Server 20.04.* LTS"、書き込み先をSDカードに設定します __ROSを使う場合は64bit版__ を選択します
6585
![](../../img/raspimouse/driver/pi_imager_settings_ubuntu_64bit.png)
66-
1. "WRITE" を押して書き込みを開始します
86+
1. "WRITE" を押して書き込みを開始します
6787
![](../../img/raspimouse/driver/pi_imager_settings_ubuntu.png)
6888
1. SDカードをRaspberry Piに取り付け、Raspberry Piの電源を入れます
6989
1. login:`ubuntu`、password:`ubuntu`でログインし、パスワードを変更します
@@ -76,7 +96,7 @@ Raspberry Pi Mouseのデバイスドライバは"Ubuntu"と"Raspberry Pi OS"(
7696
![](../../img/raspimouse/driver/download_raspberry_pi_imager.png)
7797
1. SDカードをPCに接続します
7898
1. Raspberry Pi Imagerを起動します
79-
1. 書き込むOSを"Raspberry Pi OS (32-bit)"、書き込み先をSDカードに設定し、"WRITE"を押して書き込みを開始します
99+
1. 書き込むOSを"Raspberry Pi OS (32-bit)"、または"Raspberry Pi OS (64-bit)"、書き込み先をSDカードに設定し、"WRITE"を押して書き込みを開始します
80100
![](../../img/raspimouse/driver/pi_imager_settings.png)
81101
1. SDカードをRaspberry Piに取り付け、Raspberry Piの電源を入れます
82102
![](../../img/raspimouse/driver/raspi_os_settings.png)
@@ -89,7 +109,7 @@ Raspberry Pi Mouseのデバイスドライバは"Ubuntu"と"Raspberry Pi OS"(
89109
HDMIケーブルとHDMI入力付きのモニタ、USBキーボードとマウスをRaspberry Piに接続して設定する方法を紹介します。
90110

91111
[https://ubuntu.com/server/docs/network-configuration](https://ubuntu.com/server/docs/network-configuration)
92-
に詳細な説明が書かれています。
112+
に詳細な説明が書かれています。
93113
IPアドレスの固定については[Ubuntu ServerでWi-Fiに接続し、IPアドレスを固定する](#wifi-static-ip)を参照してください。
94114

95115
1. `$ sudo vim /etc/netplan/99_config.yaml`で設定ファイルを新規作成し、下記のように記述します。
@@ -123,39 +143,48 @@ Raspberry Pi Mouseのデバイスドライバのソースファイルは
123143
に公開されています。
124144

125145
=== "Ubuntu Server"
126-
1. パルスカウンタの動作を安定させるためI2Cのボーレートを変更します
127-
1. `/boot/firmware/config.txt`を編集し、`dtparam=i2c_baudrate=62500`を追記します
128-
1. Raspberry Pi を再起動します
129-
1. `$ printf "%d\n" 0x$(xxd -ps /sys/class/i2c-adapter/i2c-1/of_node/clock-frequency)`を実行し、`62500`と表示されたら設定完了です。
130-
1. 次のコマンドを実行し、デバイスドライバをインストールします
146+
1. 次のコマンドを実行し、デバイスドライバをダウンロードします
131147
```sh
132148
$ git clone https://github.com/rt-net/RaspberryPiMouse.git
149+
```
150+
2. 次のコマンドを実行し、Raspberry Pi Mouseを動かすための設定を行います
151+
```sh
152+
$ cd RaspberryPiMouse/utils
153+
$ ./set_configs.bash
154+
```
155+
3. 次のコマンドを実行し、Raspberry Piを再起動します
156+
```sh
157+
$ sudo reboot
158+
```
159+
4. 次のコマンドを実行し、デバイスドライバをインストールします
160+
```sh
133161
$ cd RaspberryPiMouse/utils
134162
$ sudo apt install linux-headers-$(uname -r) build-essential
135163
$ ./build_install.bash
136164
```
137-
1. コマンド実行後にブザーが鳴ればインストール完了です
165+
5. コマンド実行後にブザーが鳴ればインストール完了です
138166

139167

140168
=== "Raspberry Pi OS"
141-
1. パルスカウンタの動作を安定させるためI2Cのボーレートを変更します
142-
1. `/boot/config.txt`を編集し、`dtparam=i2c_baudrate=62500`を追記します
143-
1. Raspberry Pi を再起動します
144-
1. `$ printf "%d\n" 0x$(xxd -ps /sys/class/i2c-adapter/i2c-1/of_node/clock-frequency)`を実行し、`62500`と表示されたら設定完了です。
145-
1. `Raspberry Piの設定`を開きます
146-
![](../../img/raspimouse/driver/raspi_os_settings2.png)
147-
1. `インターフェイス`に進み、`SPI``I2C`の機能を有効にします
148-
![](../../img/raspimouse/driver/raspi_os_settings3.png)
149169
1. ターミナル(`LXTerminal`)を起動します
150170
![](../../img/raspimouse/driver/open_terminal.png)
151-
1. 次のコマンドを実行し、デバイスドライバをインストールします
171+
2. 次のコマンドを実行し、デバイスドライバをダウンロードします
152172
```sh
153173
$ git clone https://github.com/rt-net/RaspberryPiMouse.git
174+
```
175+
3. 次のコマンドを実行し、Raspberry Pi Mouseを動かすための設定を行います
176+
```sh
154177
$ cd RaspberryPiMouse/utils
155-
$ sudo apt install raspberrypi-kernel-headers build-essential
178+
$ ./set_configs.bash
179+
```
180+
4. Raspberry Piを再起動します
181+
5. 次のコマンドを実行し、デバイスドライバをインストールします
182+
```sh
183+
$ cd RaspberryPiMouse/utils
184+
$ sudo apt install linux-headers-$(uname -r) build-essential
156185
$ ./build_install.bash
157186
```
158-
1. コマンド実行後にブザーが鳴ればインストール完了です
187+
6. コマンド実行後にブザーが鳴ればインストール完了です
159188

160189
**デバイスドライバはOSを起動するたびにインストールしてください。** 上記インストール手順で設定した場合は以下のコマンドでインストールできます。
161190

@@ -169,12 +198,12 @@ $ ~/RaspberryPiMouse/utils/build_install.bash
169198
### Ubuntu ServerでWi-Fiに接続し、IPアドレスを固定する {: #wifi-static-ip}
170199

171200
[https://ubuntu.com/server/docs/network-configuration](https://ubuntu.com/server/docs/network-configuration)
172-
に詳細な説明が書かれています。
201+
に詳細な説明が書かれています。
173202

174203
!!! info
175204
IPアドレスを固定するとネットワークに影響が出る場合があります。会社等で利用する場合はネットワーク管理者にお問い合わせください。
176205

177-
1. `$ sudo vim /etc/netplan/99_config.yaml`で設定ファイルを新規作成し、下記のように`dhcp4: false`としてIPアドレスを記述します。
206+
1. `$ sudo vim /etc/netplan/99_config.yaml`で設定ファイルを新規作成し、下記のように`dhcp4: false`としてIPアドレスを記述します。
178207
この例では、IPアドレスを`192.168.11.89`に固定します。__この設定値は環境によって変わりますのでご注意ください__
179208
```yaml
180209
network:

docs/raspimouse/ros/install.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,27 @@ robot: Raspberry Pi Mouse
1919
* 組み立て済みRaspberry Pi Mouse本体
2020
* [製品マニュアル](https://rt-net.jp/products/raspberrypimousev3/#downloads)を読んで組み立て済みの状態を前提としています
2121
* OS(**Ubuntu Server**)がインストール済みであることを前提としています
22+
* `ROS 2 Jazzy`を使用する場合: **Ubuntu Server 24.04**
2223
* `ROS 2 Humble`を使用する場合: **Ubuntu Server 22.04**
2324
* `ROS Noetic`を使用する場合: **Ubuntu Server 20.04**
2425
* Raspberry Pi OSでのROSの動作は確認していません
2526
* Raspberry Pi Mouse用電源
2627
* バッテリでも電源変換ケーブルつきACアダプタでも可
2728
* ノートパソコン等のPC
2829
* OS(**Ubuntu Desktop**)がインストール済みであることを前提としています
30+
* `ROS 2 Jazzy`を使用する場合: **Ubuntu Desktop 24.04**
2931
* `ROS 2 Humble`を使用する場合: **Ubuntu Desktop 22.04**
3032
* `ROS Noetic`を使用する場合: **Ubuntu Desktop 20.04**
3133

32-
!!! info
33-
`ROS 2 Foxy`は2023年6月にEOL(サポート終了)を迎えたため、`ROS 2 Humble`の使用を推奨しています。
34-
3534
## ROS / ROS 2のインストール(公式のドキュメントに沿って進める場合) {: #official-document}
3635

3736
=== "ROS"
3837
[https://wiki.ros.org/noetic/Installation/Ubuntu](https://wiki.ros.org/noetic/Installation/Ubuntu){target=_blank rel=noopener}
3938
を参考に、`ROS Noetic`をインストールします。
4039

4140
GUIを使用する場合は`Desktop-Full`を、 使用しない場合は`ROS-Base`パッケージをインストールします。
42-
43-
=== "ROS 2 Humble(推奨)"
41+
42+
=== "ROS 2 Humble"
4443
[https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html){target=_blank rel=noopener}
4544
を参考に、`ROS 2 Humble`をインストールします。
4645

@@ -49,13 +48,13 @@ robot: Raspberry Pi Mouse
4948
[https://docs.ros.org/en/humble/Tutorials/Colcon-Tutorial.html](https://docs.ros.org/en/humble/Tutorials/Colcon-Tutorial.html){target=_blank rel=noopener}
5049
を参考に、パッケージビルドツールの`colcon`をインストールします。
5150

52-
=== "ROS 2 Foxy(非推奨)"
53-
[https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html){target=_blank rel=noopener}
54-
を参考に、`ROS 2 Foxy`をインストールします。
51+
=== "ROS 2 Jazzy"
52+
[https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html](https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html){target=_blank rel=noopener}
53+
を参考に、`ROS 2 Jazzy`をインストールします。
5554

5655
GUIを使用する場合は`Desktop`を、 使用しない場合は`ROS-Base`パッケージをインストールします。
5756

58-
[https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.html](https://docs.ros.org/en/foxy/Tutorials/Colcon-Tutorial.html){target=_blank rel=noopener}
57+
[https://docs.ros.org/en/humble/Tutorials/Colcon-Tutorial.html](https://docs.ros.org/en/humble/Tutorials/Colcon-Tutorial.html){target=_blank rel=noopener}
5958
を参考に、パッケージビルドツールの`colcon`をインストールします。
6059

6160
## ROS / ROS 2のインストール(インストールスクリプトを使う場合) {: #install-script}
@@ -95,7 +94,8 @@ robot: Raspberry Pi Mouse
9594
```sh
9695
$ source ~/.bashrc
9796
```
98-
=== "ROS 2 Humble(推奨)"
97+
98+
=== "ROS 2 Humble"
9999
このROS 2インストールスクリプトは`curl``git`を使用します。以下のコマンドでインストールします。
100100

101101
```sh
@@ -114,8 +114,8 @@ robot: Raspberry Pi Mouse
114114
スクリプトが問題なく実行できれば以下のメッセージが表示されます。
115115

116116
```txt
117-
Success installing ROS humble
118-
Run 'source ~/.bashrc'
117+
success installing ROS2 humble
118+
Run 'source /opt/ros/humble/setup.bash'
119119
```
120120

121121
以下のコマンドでインストールした設定を読み込みます。
@@ -124,7 +124,7 @@ robot: Raspberry Pi Mouse
124124
$ source ~/.bashrc
125125
```
126126

127-
=== "ROS 2 Foxy(非推奨)"
127+
=== "ROS 2 Jazzy"
128128
このROS 2インストールスクリプトは`curl``git`を使用します。以下のコマンドでインストールします。
129129

130130
```sh
@@ -137,14 +137,14 @@ robot: Raspberry Pi Mouse
137137
```sh
138138
$ git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git
139139
$ cd ros2_setup_scripts_ubuntu
140-
$ ./ros2-foxy-desktop-main.sh
140+
$ ./ros2-jazzy-desktop-main.sh
141141
```
142142

143143
スクリプトが問題なく実行できれば以下のメッセージが表示されます。
144144

145145
```txt
146-
Success installing ROS foxy
147-
Run 'source ~/.bashrc'
146+
success installing ROS2 jazzy
147+
Run 'source /opt/ros/jazzy/setup.bash'
148148
```
149149

150150
以下のコマンドでインストールした設定を読み込みます。
@@ -189,7 +189,7 @@ robot: Raspberry Pi Mouse
189189
$ source ~/.bashrc
190190
```
191191

192-
=== "ROS 2 Humble(推奨)"
192+
=== "ROS 2 Humble"
193193
このROS 2インストールスクリプトは`curl``git`を使用します。以下のコマンドでインストールします。
194194

195195
```sh
@@ -208,8 +208,8 @@ robot: Raspberry Pi Mouse
208208
スクリプトが問題なく実行できれば以下のメッセージが表示されます。
209209

210210
```txt
211-
Success installing ROS humble
212-
Run 'source ~/.bashrc'
211+
success installing ROS2 humble
212+
Run 'source /opt/ros/humble/setup.bash'
213213
```
214214

215215
以下のコマンドでインストールした設定を読み込みます。
@@ -218,7 +218,7 @@ robot: Raspberry Pi Mouse
218218
$ source ~/.bashrc
219219
```
220220

221-
=== "ROS 2 Foxy(非推奨)"
221+
=== "ROS 2 Jazzy"
222222
このROS 2インストールスクリプトは`curl``git`を使用します。以下のコマンドでインストールします。
223223

224224
```sh
@@ -231,14 +231,14 @@ robot: Raspberry Pi Mouse
231231
```sh
232232
$ git clone https://github.com/Tiryoh/ros2_setup_scripts_ubuntu.git
233233
$ cd ros2_setup_scripts_ubuntu
234-
$ ./ros2-foxy-ros-base-main.sh
234+
$ ./ros2-jazzy-ros-base-main.sh
235235
```
236236

237237
スクリプトが問題なく実行できれば以下のメッセージが表示されます。
238238

239239
```txt
240-
Success installing ROS foxy
241-
Run 'source ~/.bashrc'
240+
success installing ROS2 jazzy
241+
Run 'source /opt/ros/jazzy/setup.bash'
242242
```
243243

244244
以下のコマンドでインストールした設定を読み込みます。

0 commit comments

Comments
 (0)