Skip to content

DaischSensor/im1r_ros2_driver

Repository files navigation

DAISCH Banner

IM1R_ROS2_Driver

GitHub issues GitHub pr GitHub GitHub release (with filter) GitHub Repo stars

English · 简体中文 · Global Official Site · 中文官网


Table of Contents

Project Description

This project aims to develop and maintain ROS2 drivers for the IM1R product.

Getting Started

System Requirements

  • Ubuntu 22.04 / ROS2 Humble
  • Ubuntu 20.04 / ROS2 Foxy

Installation Setups

  1. Install ROS2: Please refer to the ROS2 Documentation for detailed instructions.

  2. Install Dependencies:

    Run the following commands to install dependencies based on your system's Python version:

     ```shell
     sudo apt update
     sudo apt install python3-pip
     pip3 install pyserial
     ```
    
  3. Create ROS2 workspace:

    mkdir -p ~/ros2_ws/src
  4. Clone the project repository to the src directory of your catkin workspace:

    cd ~/ros2_ws/src
    git clone https://github.com/DAISCHSensor/im1r_ros2_driver.git
    git clone https://github.com/DAISCHSensor/im1r_ros2_interface.git
  5. Install ROS dependencies:

    cd ~/ros2_ws
    rosdep install --from-paths src --ignore-src -r -y
  6. Build the driver:

    cd ~/ros2_ws/
    colcon build
  7. Update the .bashrc file:

    ⚠️ Note: If you've already added these lines to your .bashrc, do not add them again to avoid duplicates.

    For ROS 2 Foxy

    echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
    echo "source ~/ros2_ws/install/setup.bash" >> ~/.bashrc
    source ~/.bashrc

    For ROS 2 Humble

    echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
    echo "source ~/ros2_ws/install/setup.bash" >> ~/.bashrc
    source ~/.bashrc

Usage Instructions

  1. Connect IM1R via UART1 data cable.

  2. Identify the serial port for the IM1R device:

    sudo dmesg | grep tty

    Assuming the IM1R device is connected to /dev/ttyUSB0:

    sudo chmod 666 /dev/ttyUSB0
  3. Confirm the baud rate of the IM1R device. The default baud rate is 115200, which can be modified via the host computer software DS_RVision.

  4. Launch the driver node:

    • Assume the serial port connected to the IM1R is /dev/ttyUSB0
    • Assume the baud rate used by the IM1R is 115200
    ros2 run im1r_ros2_driver im1r_node --ros-args -p serial_port:=/dev/ttyUSB0 -p baud_rate:=115200
  5. List all the topic:

    ros2 topic list
  6. echo the specific topic:

    ros2 topic echo /imu/data

Published Topics

Parameters Introductions

Standard Topic

imu/data

Variable Supported
time header.stamp ✔️
string header.frame_id ✔️
float64 orientation.x ✔️
float64 orientation.y ✔️
float64 orientation.z ✔️
float64 orientation.w ✔️
float64[9] orientation_covariance
float64 angular_velocity.x ✔️
float64 angular_velocity.y ✔️
float64 angular_velocity.z ✔️
float64[9] angular_velocity_covariance
float64 linear_acceleration.x ✔️
float64 linear_acceleration.y ✔️
float64 linear_acceleration.z ✔️
float64[9] linear_acceleration_covariance

temperature

Variable Supported
time header.stamp ✔️
string header.frame_id ✔️
float64 temperature ✔️
float64 variance

Custom Topic

im1r/extra

Variable Type Definition Unit Remarks
count uint8 Message counter - 0~255 cyclic increment
timestamp uint64 Timestamp of the measurement microseconds (µs) UNIX time
pitch float64 Pitch angle degrees (°)
roll float64 Roll angle degrees (°)
yaw float64 Yaw angle degrees (°)
imu_status uint8 IMU status indicator - Bit 0: Acceleration valid (0) / invalid (1)
Bit 2: Angular velocity valid (0) / invalid (1)
Higher bits are not defined
gyro_bias_x float64 Gyroscope bias along the X axis radians/second (rad/s)
gyro_bias_y float64 Gyroscope bias along the Y axis radians/second (rad/s)
gyro_bias_z float64 Gyroscope bias along the Z axis radians/second (rad/s)
gyro_static_bias_x float64 Static gyroscope bias along the X axis radians/second (rad/s)
gyro_static_bias_y float64 Static gyroscope bias along the Y axis radians/second (rad/s)
gyro_static_bias_z float64 Static gyroscope bias along the Z axis radians/second (rad/s)

Contributing

License

BSD-3-Clause

About

ROS2 driver for daisch im1r sensor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages