1
1

備忘録 ラズパイ5 ROS2 ② Ubuntu Desktop 24.04LTSでROS2環境 rqt_graphとturtlesim

Last updated at Posted at 2024-07-24

 前回、ROS2 Jazzyをインストールしました。

環境

  • Raspberry Pi 5 8GB
  • 追加ボード;NVMe Base for Raspberry Pi 5 (NVMe Base by Pimoroni)
  • Crucial クルーシャル P2シリーズ 500GB 3D NAND NVMe PCIe M.2 SSD CT500P2SSD8
  • 初期;RaspberryPi OS Desktop 64bit (Debian version: 12 (bookworm) Release date: March 15th 2024)
  • 現在;Ubuntu Desktop 24.04LTS(64-bit)
  • ROS2 HumbleではなくJazzy
ROSノードとROSトピックの送受信の関係をGUIで図示

 ROSには、いくつかのツールがあるので動かします。
 Ubuntuマシンのターミナルで実行しています。
仮想Pythonの状態で動かしますが、ここでは、pythonは使っていない。。。

$ source /opt/ros/jazzy/setup.bash

(ros2) yoshi@yoshi:~$ rqt_graph

Screenshot from 2024-06-24 08-05-26.png

 カメのプログラムです。

(ros2) yoshi@yoshi:~$ source /opt/ros/jazzy/setup.bash
(ros2) yoshi@yoshi:~$ ros2 run turtlesim turtlesim_node

Screenshot from 2024-06-29 20-15-11.png

 動かしてみます。

(ros2) yoshi@yoshi:~/ros2_ws$ ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 5.0}}"
publisher: beginning loop
publishing #1: geometry_msgs.msg.Twist(linear=geometry_msgs.msg.Vector3(x=2.0, y=0.0, z=0.0), angular=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=5.0))

 何度か動かしました。

Screenshot from 2024-06-29 20-37-24.png

 ここで、rqt_graphの左上のリフレッシュ・アイコンをクリックします。
 ROSノードのturtlesimが表示されました。たぶん。

Screenshot from 2024-06-29 20-39-36.png

 キーボードからメッセージを送るパッケージteleop_twist_keyboardはインストールされているようです。

(ros2) yoshi@yoshi:~$ ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/turtle1/cmd_vel

 ここで、rqt_graphの左上のリフレッシュ・アイコンをクリックします。
 ROSノードのteleop_twist_keyboardからturtlesimへメッセージが送られている様子が表示されました。たぶん。

Screenshot from 2024-06-29 20-53-47.png

 ただ、亀は動いていないように見えます。


備忘録 ラズパイ5 ROS2

① ハードの用意とUbuntu Desktop 24.04LTS

② Ubuntu Desktop 24.04LTSでROS2環境 rqt_graphとturtlesim

③ Ubuntu Desktop 24.04LTSでROS2環境 Python その1 responder(セットアップ)

④ Ubuntu Desktop 24.04LTSでROS2環境 Pythonその2responder(コーディングと実行;失敗)

⑤ Ubuntu Desktop 24.04LTSでROS2環境 C++ その1 セットアップ main.c

⑥ Ubuntu Desktop 24.04LTSでROS2環境 C++ その2 セットアップ pub.cpp rqt_graph


1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1