Skip to content

Connecting Your Computer to IMU

Ellen Chen edited this page Sep 25, 2021 · 3 revisions

RSX's IMU (Inertial Measurement Unit) is the Inertial Sense EVB-1. The unit can determine various measurements such as GPS coordinates, magnetic fields, odometry, and barameter measurements. For the rover, we will primarily be using the odometry and the GPS measurements.

Hardware

The hardware comes in several pieces:

  • Micro USB A to USB cable
  • Inertial Sense EVB-1 unit (a small white rectangular device with various places to connect ports)
  • Tallysman Wireless single band antenna (small black rounded rectangular device with a cord attached)

Connecting the Hardware to Your Computer

Connecting the IMU to your computer will allow the measurements from the device be sent to your computer. This is beneficial for testing, or running your code.

  1. Connect the USB cable to a USB port on your computer
  2. Connect the other end of the USB cable, the micro USB A, to the port on the IMU. It will be on the side, next to the gold circular port. The IMU should start lighting up.
  3. Take the antenna and plug the circular end of the cord into the IMU. You'll need to twist the hex nut in to secure it.

More Information

For more information about the hardware, consult the Inertial Sense manuals: https://docs.inertialsense.com/user-manual/hardware/EVB1/.


Software

Inertial Sense has created a ROS wrapper for their devices, which can be found here: https://github.com/inertialsense/inertial-sense-ros. The wrapper sends the IMU measurements to ROS topics that we can connect to with our computer or our other hardware. Some of their commands are incorrect, or are not the most intuitive, especially when getting started.

1. Setting up the ROS Wrapper

Do not worry about the firmware update command that Inertial Sense has on the ReadMe. You should have the catkin workspace set up already from the ROS tutorials. If not, set up your catkin workspace here: http://wiki.ros.org/catkin/Tutorials/create_a_workspace. In addition, make sure that you have your Github set up already.

cd catkin_ws/src

git clone https://github.com/inertialsense/inertial_sense_ros

cd inertial_sense_ros

git submodule update --init --recursive

If you have any errors running the above command, follow the steps in the "Permission Denied Error" section under the "Errors" heading.

cd ~/catkin_ws

catkin_make

2. Running the ROS node

To run the ROS package:

rosrun inertial_sense_ros inertial_sense_node

Notice it's inertial_sense_ros, not inertial_sense as mentioned in the Inertial Sense documentation in their Github.

If you have any errors, refer to the "Rospack: Package not found" or the "Error: [FATAL]: Unable to open serial port" section under the "Errors" heading.

If you don't have any errors, you can echo the topic you want (refer to https://github.com/inertialsense/inertial-sense-ros for the names) by doing:

rostopic echo [topic_name]

If you have any errors echo-ing, refer to the "Cannot load message class" section under the "Errors" heading.

Errors

Error: Permission Denied

When you get to the submodule update command, you may get an error that says permission denied, or your computer wasn't able to update the submodule. Usually, this is because you haven't set up a Github SSH key.

Setting up SSH Keys

Follow the Github manual for setting up SSH keys here: https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh. The steps you will need to take are:

  1. Checking for existing SSH keys
  2. Generating a new SSH key and adding it to the ssh-agent
  3. Adding a new SSH key to your GitHub account

Setting up config settings for Github

You should also configure Github on your computer if you haven't already: git config --global user.name "John Smith" git config --global user.email "[email protected]"

Error: Rospack: Package not found

If you get an error saying something along the lines of "rospack: package not found":

cd ~/catkin_ws

source devel/setup.bash

If you find you need to do this for every terminal you open, check you set up your bash.rc file properly: https://stackoverflow.com/questions/27053334/ros-package-not-found-after-catkin-make.

Error: [FATAL]: Unable to open serial port

The entire error will be something along the lines of "[FATAL] [1623191922.831460301]: inertialsense: Unable to open serial port "/dev/ttyUSB0", at 921600 baud".

This means that you, as a non-root user, do not have access to the serial port dailout. You can fix this by following the steps here: https://websistent.com/fix-serial-port-permission-denied-errors-linux/

In some cases, the above was not enough. Try the below commands:

newgrp dialout

or

sudo chmod 666 /dev/ttyUSB0

Error: Cannot load message class

This error usually occurs when you try to echo a topic in a terminal eg. rostopic echo gps

If this happens, in that terminal, do:

cd ~/catkin_ws

source devel/setup.bash

Then, double check if you have your bash.rc file set up.

Clone this wiki locally