Skip to content

DaischSensor/im1r_ros1_driver

Repository files navigation

DAISCH Banner

IM1R_ROS_Driver

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

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


Table of Contents

Project Description

The project aims to develop and maintain ROS drivers suitable for IM1R-FB-U, a compact 6-axis inertial measurement module designed by DAISCH.

Getting Started

System Requirements

  • Ubuntu 18.04 / ROS Melodic
  • Ubuntu 20.04 / ROS Noetic

Installation Setups

  1. Install ROS: Please refer to the ROS installation guide for detailed instructions.

  2. Install Dependencies:

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

    • For Ubuntu 18.04 / Python 2:

      sudo apt update
      sudo apt install python-pip
      pip install pyserial
    • For Ubuntu 20.04 / Python 3:

      sudo apt update
      sudo apt install python3-pip
      pip3 install pyserial
  3. Create catkin workspace:

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

    cd ~/catkin_ws/src
    git clone https://github.com/DaischSensor/im1r_ros1_driver.git
    • For Ubuntu 20.04 / Python 3, switch to the appropriate branch:
      cd im1r_ros1_driver
      git checkout ubuntu20.04-support
  5. Build the driver:

    cd ~/catkin_ws/
    catkin_make
  6. Update the .bashrc file:

    echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
    source ~/.bashrc

Usage Instructions

  1. Connect IM1R via UART1 data cable.

  2. Start the ROS master:

    roscore
  3. Identify the serial port for the IM1R device:

    dmesg | grep tty
  4. Set the serial port permissions: Assuming the IM1R device is connected to /dev/ttyUSB0:

    sudo chmod 666 /dev/ttyUSB0
  5. Launch the driver node:

    • Verify the serial port used by IM1R, e.g./dev/ttyUSB0
    • Verify the baud rate used by IM1R, e.g.115200
    rosrun im1r_ros_driver daisch_im1r_node.py /dev/ttyUSB0 115200
  6. List all the topic:

    rostopic list
  7. echo the specific topic:

    rostopic echo imu/data
  8. (Example Program) Subscribe to a topic:

    rosrun im1r_ros_driver subscriber_example.py

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)

FAQ

Issue 1: Script Not Found

Symptom: Running rosrun im1r_ros_driver subscriber_example.py results in the following error:

[rosrun] Couldn't find executable named subscriber_example.py below /home/daisch/catkin_ws/src/im1r_ros_driver
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /home/daisch/catkin_ws/src/im1r_ros_driver/scripts/subscriber_example.py

Solution: Grant executable permissions to the script:

chmod +x /home/daisch/catkin_ws/src/im1r_ros_driver/scripts/subscriber_example.py

If you have any other questions or need further assistance, feel free to ask.

Contributing

License

BSD-3-Clause