10 DOF ROS IMU (A)

From Waveshare Wiki
Jump to: navigation, search
10 DOF ROS IMU (A)
10 DOF ROS IMU (A)

10-axis IMU Sensor
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Introduction

10 DOF ROS IMU (A) is a 10-axis IMU sensor that integrates an ARM 32-bit DSP processor, BLE5.3 Bluetooth, high-precision accelerometer, gyroscope, magnetometer, and thermobarometer. When used together, it can collect surrounding acceleration, gyroscope, and magnetic field data, and detect the motion attitude of the robot.

Features

  • Adopts self-developed attitude estimation algorithm, it offers excellent real-time performance, high accuracy, and stability without drifting.
  • Supports UART and BLE 5.3 Bluetooth communication to assist motion attitude and orientation detection of robot.
  • Supports Android, iOS, Windows, Linux systems, and other BLE Bluetooth devices for connection and use.

Specifications

Product 10 DOF ROS IMU (A)
Power supply 3.3V ~ 5V
Baud rate 115200
Data return rate 0.5~250HZ
Interface package ZH1.5-4A
Communication format 8 data bits, 1 stop bit, no parity bit
Data packet format Preamble+Start Code+Address+Length+Data Body+Checksum+End Code
Data output Acceleration, angular velocity, magnetic field vector, temperature, barometric pressure, Euler angle, quaternion
Accelerometer Range: ±16g
Resolution: 0.00048g
Gyroscope Range: ±2000°/s
Resolution: 0.061°/s
Magnetometer Range: ±8Guass
Resolution: 0.12uT
Temperature sensor Range: -45℃~85℃
Resolution: 0.01℃(onboard temperature)
Barometer Range: 300~1200hPa
Resolution: 0.006hPa

Pinout Definition

Pin No. Identifier Description
1 5V 3.3V~5.0V power supply
2 G Connect to GND, ground pin
3 Rx Serial data receive pin
4 Tx Serial data transmit pin

Hardware Connection

1. Serial port connection, red wire VCC, black wire GND, blue wire TXD, yellow wire RXD
2. This product does not include a USB to UART serial port module

Assembly with same coordinate axes directions:

10 DOF ROS IMU(A) hardware connections.png

Axial Description

The axial orientation of the 10 DOF ROS IMU (A) is shown in the figure above and conforms to the right-hand coordinate system

Dimensions

10 DOF ROS IMU(A) product.jpg

Demo

Serial Communication

  1. Install the serial port driver, find the device port number
    Install the corresponding driver according to the type of serial port conversion module chip Take Windows as an example. The port number is shown in the following figure
    10 DOF ROS IMU (A)-3.png
  2. Install the required dependencies
    Windows, Linux:
    pip install pyserial numpy pygame PyOpenGL
  3. Initialize
    Replace the line 8 ser_port = "COM13" with the corresponding serial port, and rotate the Z-axis of the module more than a full circle perpendicular to the horizontal plane and the Z-axis balanced on the horizontal plane within 10 seconds
    Windows, Linux:
    python3 imu_init.py
  4. Execute data parsing code
    Replace the line 7 ser_port = "COM13" with the corresponding serial port
    • Windows: Usually COMx.
    python3 imu_uart.py
    • Linux: Different ports for different systems, for example /dev/ttyUSBx, /dev/ttySx, you can query the device for confirmation of newly added devices by hot-plugging the devices
    ls /dev/tty*
    python3 imu_uart.py
  5. GUI visualization interface
    Need to stop the data parsing program in the previous step and execute the following program
    python3 imu_uart_gui.py

    10 DOF ROS IMU (A) GUI.gif

Bluetooth Communication

  1. Install the Bluetooth debugging software and find the MAC address of the device
    • Install nRF Connect on Android
    • Install LightBlue on Apple
    Take Android as an example. The MAC address is shown in the figure below
    300px-10 DOF ROS IMU (A)-2.jpg
  2. Services available after Bluetooth connection
    Imu-ble-uuid.jpg
    It mainly includes the UUID of the service and service characteristic features. Users only need to focus on the following two functional services:
    • Only use the send and receive characteristics of service UUID: 0000ae30-0000-1000-8000-00805f9b34fb
    • Send characteristic value: 0000ae01-0000-1000-8000-00805f9b34fb (must use write no response method)
    • Receive characteristic value: 0000ae02-0000-1000-8000-00805f9b34fb (Notify needs to be enabled to receive data from the device)
    • Note: After connecting the module, send the Bluetooth connection retention command (i.e., 0x29 command) as soon as possible, otherwise the module will automatically disconnect after 30 seconds and note to use the write no response method when sending data
  3. Install the required dependencies
    • Windows:
    pip install bleak numpy
    • Linux:
    sudo apt-get install bluez libbluetooth-dev
    pip install gatt
  4. Execute the code
    Before use, it is recommended to perform the initialization steps in serial communication
    • Windows: Replace line 14 par_device_addr="70:53:B2:02:20:02" with the MAC address found in the first step
    python3 imu_ble.py
    • Linux: Replace with the MAC address found in the first step
    python3 imu_ble.py 70:53:B2:02:20:02

ROS Serial Communication

Take "/dev/ttyUSB0" as an example

  1. Find the device port number
    • Query the device for confirmation of newly added devices by hot-plugging the devices
    ls /dev/tty*
    • Grant serial port permissions:
    sudo chmod 666 /dev/ttyUSB0
  2. Install the required dependencies
    • ROS1 noetic:
    sudo apt update && sudo apt install ros-noetic-serial  ros-noetic-imu-tools
    • ROS2 humble:
    sudo apt update && sudo apt install libserial-dev  ros-humble-imu-tools
  3. Compile
    • ROS1 noetic:
    Go to the root directory of the workspace
    cd ros1_ws

    Compile

    catkin_make -DCATKIN_WHITELIST_PACKAGES="imu"

    Update environment variables

    source devel/setup.bash
    • ROS2 humble:

    Go to the root directory of the workspace

    cd ros2_ws

    Compile the serial port library first

    colcon build --packages-select serial

    Update environment variables

    source install/setup.bash

    Recompile

    colcon build --packages-select imu

    Update environment variables

    source install/setup.bash
  4. Execute data parsing code
    • ROS1 noetic:
    Need to have Roscore started, or have a launch file running in the system (Optional) Open a new window to start roscore
    roscore

    Open a new window to parse data

    rosrun imu imu_node _port_name:=/dev/ttyUSB0

    Open a new window to view data

    rostopic echo /imu/data
    • ROS2 humble:

    Open a new window to parse data

    ros2 run imu imu_node --ros-args --param port_name:=/dev/ttyUSB0

    Open a new window to view data

    ros2 topic echo /imu/data
  5. RVIZ visualization interface
    Need to stop the data parsing program in the previous step and execute the following program
    • ROS1 noetic:
    roslaunch imu imu_view.launch port_name:=/dev/ttyUSB0

    10 DOF ROS IMU (A) ros1 GUI.gif

    • ROS2 humble:
    ros2 launch imu imu_view.launch.py port_name:=/dev/ttyUSB0

    10 DOF ROS IMU (A) ros2 GUI.gif

Demo Download

1. Click to download 10_DOF_ROS_IMU_(A) Code
2. Please install the related libraries and then run the demo. For the ROS demo, please compile and use it on the ROS system

FAQ


Support




Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)