This package publishes IMU sensor data from a serial device as sensor_msgs/Imu. It supports common IMUs such as LSM6DSOX, BMI088, and BNO085 via the imu_i2c_to_serial_publisher firmware.
- Target OS: Ubuntu 24.04 (Noble Numbat)
- Target ROS 2: Jazzy Jellyfish (desktop)
- Python: system Python 3.12
Source the ROS 2 setup in every new shell (or add to your shell rc):
source /opt/ros/jazzy/setup.bash- Initialize rosdep (first time only):
sudo rosdep init
rosdep update- Create a workspace and clone the repo:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/Aeolus96/imu_serial_to_ros_publisher.git- Install dependencies with rosdep:
cd ~/ros2_ws
rosdep update
rosdep install --from-paths src --ignore-src -r -y- Install Python dependencies (if needed):
python3 -m pip install --user -r src/imu_serial_to_ros_publisher/requirements.txt- Build and source the workspace:
colcon build --symlink-install
source ~/ros2_ws/install/setup.bashFor reliable device naming across reboots, create a stable symlink such as /dev/my_imu.
To create a manual udev rule under /etc/udev/rules.d/99-imu.rules (use attributes from udevadm info --attribute-walk --name /dev/ttyACM0). Then reload udev rules and trigger (may require replugging device to take effect):
sudo udevadm control --reload
sudo udevadm triggerVerify the symlink:
ls -l /dev/edubot_imuAdd your user to the dialout group so you can access serial devices:
sudo usermod -aG dialout $USER
# then log out and log in againStart the IMU publisher with the provided launch file:
ros2 launch imu_serial_to_ros_publisher imu_publisher.launch.pyRun with custom parameters:
ros2 launch imu_serial_to_ros_publisher imu_publisher.launch.py \
serial_port:=/dev/edubot_imu \
baud_rate:=115200 \
topic:=imu/data_raw \
frame_id:=imu_linkserial_port(string) — default/dev/ttyACM0baud_rate(int) — default115200topic(string) — defaultimu/data_rawframe_id(string) — defaultimu_linkreconnect_interval_seconds(float) — default1.0no_telemetry_warn_seconds(float) — default3.0assert_dtr(bool) — defaultfalse
After launching the IMU publisher, run orientation check (interactive sign check):
ros2 run imu_serial_to_ros_publisher imu_orientation_check --ros-args -p topic:=/imu/data_rawData quality verifier:
ros2 run imu_serial_to_ros_publisher imu_verifierimu/data_raw(sensor_msgs/Imu): accelerations, angular velocities, optional orientation, covariance fields.
Created by Devson Butani, 2025
MIT License. See LICENSE file for details.
Contributing bug fixes and new features? Submit a pull request!