yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
10-axis IMU Navigation Module📖
1.Preparation
  • 1.1 Introduction to the IMU module
  • 1.2 Install the IMU module
  • 1.3 Precautions for use
2.PC Software tutorial
  • 2.1 Install serial driver
  • 2.2 Connect to the PC software
  • 2.3 Configuration parameters
  • 2.4 Calibrate the IMU module
  • 2.5 Graphically display data
  • 2.6 Connected to the GPS module
3.Basic application
  • 3.1 Raspberry Pi-USB application
  • 3.2 JetsonNano-USB application
4.ROS application
  • ROS1 application case tutorial
  • ROS2 application case tutorial
5.Communication protocol
  • Communication protocol
6.STM32 tutorial
  • 1. serial port application routine
  • 2. IIC application routine
7.RDK X3 tutorial
  • RDK X3 tutorial
8.MSPM0 tutorial
  • MSPM0G3507 serial port application
  • MSPM0G3519 serial port applicationnew
Download
  • Code
  • 3D_Model_File
  • Annex
Download ZIP

Welcome to 10-axis IMU Navigation Module repository

ROS1 application case tutorial

ROS application routine

ROS application routine1. ROS environment installation2. Bind the port3. IMU Ros package usage3.1 Compilation Workspace3.2 Modify parameter configuration3.3 Running the visual interface

1. ROS environment installation

This routine assumes that the system has already installed the ROS development environment by default. If the ROS environment is not installed, please install the ROS environment by yourself before running this routine.

Please run the corresponding command in the terminal

If you are using ubuntu 16.04, ROS kinetic, python2:

sudo apt-get install ros-kinetic-imu-tools ros-kinetic-rviz-imu-plugin
sudo apt-get install python-visual

If you are using ubuntu 18.04, ROS Melodic, python2:

xxxxxxxxxx
sudo apt-get install ros-melodic-imu-tools ros-melodic-rviz-imu-plugin

If you are using ubuntu 20.04, ROS Noetic, python3:

xxxxxxxxxx
sudo apt-get install ros-noetic-imu-tools ros-noetic-rviz-imu-plugin
pip3 install pyserial

Install ROS serial driver

xxxxxxxxxx
sudo apt-get install ros-$ROS_DISTRO-serial

The following content takes ubuntu 18.04, ROS Melodic version as an example.

2. Bind the port

First connect the IMU module to the USB port of the computer, and then copy the sample program ros_imu_ws.zip in the data to the user directory. Run the following command to unzip:

xxxxxxxxxx
unzip ros_imu_ws.zip
cd ~/ros_imu_ws
sudo bash bind_usb.sh

Restart the computer to make the bound port take effect

xxxxxxxxxx
sudo reboot

After restarting, check whether the port has been bound.

xxxxxxxxxx
ll /dev/imu_usb

image-20220610142311342

Note: This method is only suitable for the case that the external USB device has only one CP2102 serial port chip. If there are multiple USB devices driven by CP2102, please do not use this binding method.

3. IMU Ros package usage

3.1 Compilation Workspace

Open a command terminal and run the following command:

xxxxxxxxxx
  cd ~/ros_imu_ws/
  catkin_make -j
  cd src/scripts/
  sudo chmod 777 *.py
  echo "source ~/ros_imu_ws/devel/setup.sh" >> ~/.bashrc
  source ~/.bashrc

3.2 Modify parameter configuration

The baud rate is set according to the actual use. The default baud rate is 9600. If the user modifies the baud rate through the host computer, it needs to be modified accordingly to the modified baud rate.

Enter the workspace directory src/launch,

Open the configuration parameters in the rviz_and_imu.launch file.

xxxxxxxxxx
cd ~/ros_imu_ws/src/launch
vim rviz_and_imu.launch

image-20220610142748819

If you have already operated 2. Bind the port, skip to 3.3 to run the visual interface. If the 2. Binding port operation is not performed, you need to manually modify the USB device number corresponding to the module. The specific operations are as follows:

  1. Check the USB port number. Connect the inertial navigation module to the USB port of the computer through the USB-typeC data cable, and enter the following command in the terminal to detect the device port
xxxxxxxxxx
ls /dev/ttyUSB*

If the computer is connected to multiple USB devices, you can check the port once without inserting the inertial navigation module.

After inserting the inertial navigation module, check the port again, and compare the port numbers printed out twice before and after.

The second time, the extra port number is the USB device number of the inertial navigation module.

image-20220610111650722

  1. Modify parameter configuration. Parameters that need to be modified include the USB port number and baud rate.

    Enter the workspace directory src/launch,

    Open the configuration parameters in the rviz_and_imu.launch file.

    xxxxxxxxxx
    cd ~/ros_imu_ws/src/launch
    vim rviz_and_imu.launch

    The device number is /dev/ttyUSB0 (the code uses /dev/ttyUSB0 by default).

    If the number recognized by your computer is not USB0, change it to the number recognized by your computer.

    Note: If multiple USB serial devices are connected, it may be necessary to manually check and modify the corresponding serial number every time the device is turned on.

    image-20220610113235214

    Save and exit after modification is complete.

  1. If you are prompted that you do not have the USB permission, enter the following command in the terminal to increase the permission, or add the current user to the USB device permission list.

    xxxxxxxxxx
    sudo chmod 777 /dev/ttyUSB0

3.3 Running the visual interface

  1. Open the terminal, run the launch file, pay attention to open it on the actual desktop, or VNC remote, not in the SSH remote terminal.
xxxxxxxxxx
roslaunch wit_ros_imu rviz_and_imu.launch

image-20220610114053091

Open two new terminals and enter the following two lines of commands respectively to view the data.

xxxxxxxxxx
rostopic echo /wit/imu
rostopic echo /wit/mag

As shown below. Information output byrostopic echo

image-20220610114748858

 

 

JetsonNano-USB application
ROS2 application case tutorial

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文