コンテンツにスキップ

6 コントローラ操作

概要

実機のRaspberry Pi Catをコントローラによって操作する方法を説明します。 予めPCの設定Raspberry Piの設定 を完了してからこちらに進んでください。

必要な物

Software Version
ノートPC Ubuntu 22.04(ROS 2 Humble)
Raspberry Pi Cat(Raspberry Pi 4B+) Ubuntu 22.04(ROS 2 Humble)
Hardware
ノートPC
Raspberry Pi Cat(Raspberry Pi 4B+)
(LANケーブル)
(Joystick Controller)

コントローラで操作

Raspberry Piのみで実行する場合

Raspberry Piの場合、serverのイメージを使用しているため
GUIが使えないので、ジョイスティックコントローラのみです。

コントローラはRaspberry Piに接続

ros2 launch raspicat raspicat.launch.py
ros2 service call /motor_power std_srvs/SetBool '{data: true}'
ros2 launch raspicat_bringup teleop.launch.py teleop:=joy

ノートPCから操作する場合

# Raspberry Pi
ros2 launch raspicat raspicat.launch.py
# PC
ros2 service call /motor_power std_srvs/SetBool '{data: true}'
ros2 launch raspicat_bringup teleop.launch.py teleop:=key

コントローラはPCに接続

# Raspberry Pi
ros2 launch raspicat raspicat.launch.py
# PC
ros2 service call /motor_power std_srvs/SetBool '{data: true}'
ros2 launch raspicat_bringup teleop.launch.py teleop:=joy

次のページへ進む