実現したいこと
Raspberry Pi 4 Model B の Ubuntu 22.04.2 LTS のROS2 HumbleでDynamixelSDKをインストールして動かしたい。
前提
ROBOTIS
のDynamixel
はXL430-W250-T
を1つ繋いでいます。
通信は3線のTTL
です。
インターフェースはU2D2
を使ってます。
電源はACアダプターとSMPS2Dynamixel
を使用。
現在、Raspberry Pi 4 Model B
のUbuntu 22.04.2 LTS
のROS2 Humble
にDynamixelSDK
をインストールしました。
しかし、以下のエラーが発生しパッケージがありませんと言われます。
ちなみに、私は~/ros2_ws/src/oss
をワークスペースとして使用しています。
なので、この~/ros2_ws/src/oss
内にDynamixelSDK
がクローンされています。
発生している問題・エラーメッセージ
DynamixelSDKをインストールしたワークスペースからdynamixel_sdk_examplesのサンプルプログラムread_write_nodeを実行しようとすると次のエラーがでます。
Linux
1$ ros2 run dynamixel_sdk_examples read_write_node 2Package 'dynamixel_sdk_examples' not found
試したこと
このQiitaとYouTubeを参考にインストールしました。
まず、ワークスペースにDynamixelSDK
をクローンし、インストールします。
Linux
1$ cd ~/ros2_ws/src/oss 2$ git clone -b $ROS_DISTRO-devel https://github.com/ROBOTIS-GIT/DynamixelSDK 3$ cd ~/ros2_ws 4$ colcon build --symlink-install 5$ source /opt/ros/humble/setup.bash 6$ . install/local_setup.bash
Linux
1$ sudo usermod -aG dialout <linux_account>(自分のRPiのyukiと入れた)
デバイス名を調べる。
Linux
1root@yuki-RPi:/home/yuki# sudo su 2root@yuki-RPi:/home/yuki# dmesg | grep tty 3[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 4snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 5video=HDMI-A-1:720x480M@60 smsc95xx.macaddr=DC:A6:32:DB:A2:DC 6vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 zswap.enabled=1 7zswap.zpool=z3fold zswap.compressor=zstd dwc_otg.lpm_enable=0 console=tty1 8root=LABEL=writable rootfstype=ext4 rootwait fixrtc quiet splash 9[ 0.000434] printk: console [tty1] enabled 10[ 0.880312] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 19, base_baud = 0) is a 11PL011 rev2 12[ 7.402851] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0 13[ 80.457996] input: ELECOM TK-FBP102 Keyboard as 14/devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:056E:1068.0005/input/i 15nput8 16[ 4777.088469] input: ELECOM TK-FBP102 Keyboard as 17/devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:056E:1068.0006/input/i 18nput9 19[ 4899.391092] input: ELECOM TK-FBP102 Keyboard as 20/devices/platform/soc/fe201000.serial/tty/ttyAMA0/hci0/hci0:11/0005:056E:1068.0007/input/i 21nput10
これより、デバイス名は/dev/ttyUSB0
とわかる。
次にサンプルプログラムを修正。
dynamixel_sdk_examples/src
にあるread_write_node.cpp
のデフォルトセッティングのうちボーレートとシリアル通信のデバイス名を変更。
50行目あたり
cpp
1// Default setting 2#define DXL1_ID 1 // DXL1 ID 3#define DXL2_ID 2 // DXL2 ID 4#define BAUDRATE 57600 // Default Baudrate of DYNAMIXEL X series 5#define DEVICE_NAME "/dev/ttyUSB0" // [Linux] To find assigned port, use "$ ls /dev/ttyUSB*" command
今回はそのまま
それから、実際に動作させてみる。
Linux
1$ ros2 run dynamixel_sdk_examples read_write_node 2Package 'dynamixel_sdk_examples' not found 3~$ ros2 topic pub -1 /set_position dynamixel_sdk_custom_interfaces/SetPosition "{id: 1, 4position: 1000}" 51694594854.798480 [1] ros2: config: 6//CycloneDDS/Domain/Internal/MinimumSocketReceiveBufferSize: setting moved to 7//CycloneDDS/Domain/Internal/SocketReceiveBufferSize[@min] 8(/home/yuki/cyclonedds_config/cyclonedds_config.xml line 6) 9Waiting for at least 1 matching subscription(s)... 10Waiting for at least 1 matching subscription(s)... 11^C
一応パッケージはないけど、メモ代わりにtopicの方も載せてます。
補足情報(FW/ツールのバージョンなど)
・Raspberry Pi 4 Model B 8GB
・Ubuntu 22.04.2 LTS
・ROS2 Humble

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。