インストール

foxy

sudo apt install ros-$ROS_DISTRO-ecl-devices \\
                 ros-$ROS_DISTRO-ecl-sigslots \\
                 ros-$ROS_DISTRO-ecl-time \\
                 ros-$ROS_DISTRO-ecl-build \\
                 ros-$ROS_DISTRO-ecl-geometry

humble

source /opt/ros/humble/setup.bash
cd ~/ros2_ws/src
git clone <https://github.com/stonier/ecl_core> -b devel
git clone <https://github.com/stonier/ecl_tools> -b devel
git clone <https://github.com/stonier/ecl_lite> -b devel

git clone <https://github.com/fateshelled/wit_node> -b ros2

cd ~/ros2_ws
colcon build --symlink-install

権限付与

sudo chmod 666 /dev/ttyUSB0

実行

ros2 launch wit_node wit_visualize.launch.py

# ROS2ノードのボーレートを変更する場合
ros2 launch wit_node wit_visualize.launch.py baud_rate:=9600

認識しないとき

sudo apt autoremove brltty

Ubuntu 22.04 で USB-シリアル (/dev/ttyUSB0) が認識されない問題の対応

参考サイト

9軸IMUモジュールWT901CをROS Foxyで使用する - Qiita

https://github.com/fateshelled/wit_node