Interface (driver) software, including ROS node, for inertial sensors from MicroStrain by HBK, developed in Williston, VT.
Implemented using the MicroStrain Inertial Protocol SDK (mip_sdk
)
- ROS Wiki
- ROS vs ROS2 versions
- Packages
- Install Instructions
- Building From Source
- Run Instructions
- Docker Development
- Shared Codebases
- Previous Versions
- Licenses
For more information on the data published and services available see our ROS wiki page
Note that this branch contains the ROS implementation for the packages. If you are looking for the ROS2 version, you should go to the ros2
branch
This repo contains the following packages:
microstrain_inertial_driver
-- ROS node that will communicate with the devicesmicrostrain_inertial_msgs
-- Collection of messages produced by themicrostrain_inertial_driver
nodemicrostrain_inretial_examples
-- Collection of examples that show how to interact with themicrostrain_inertial_driver
node. Currently contains one simple C++ and python subscriber nodemicrostrain_inertial_rqt
-- Collection of RQT plugins to view the status of inertial devices when running themicrostrain_inertial_driver
As of v2.0.5
this package is being built and distributed by the ROS build farm. If you do not need to modify the source, it is recommended to install directly from the buildfarm by running the following commands where ROS_DISTRO
is the version of ROS you are using such as noetic
:
Driver:
sudo apt-get update && sudo apt-get install ros-ROS_DISTRO-microstrain-inertial-driver
RQT:
sudo apt-get update && sudo apt-get install ros-ROS_DISTRO-microstrain-inertial-rqt
For more information on the ROS distros and platforms we support, please see index.ros.org
If you need to modify the source of this repository, or are running on a platform that we do not support, you can build from source by following the Building From Source guide below.
This repo takes advantage of git submodules in order to share code between ROS versions. When cloning the repo, you should clone with the --recursive
flag to get all of the submodules.
If you have already cloned the repo, you can checkout the submodules by running git submodule update --init --recursive
from the project directory
The CMakeLists.txt will automatically checkout the submodule if it does not exist, but it will not keep it up to date. In order to keep up to date, every
time you pull changes you should pull with the --recurse-submodules
flag, or alternatively run git submodule update --recursive
after you have pulled changes
-
Install ROS and create a workspace: Installing and Configuring Your ROS Environment
-
Clone the repository into your workspace:
git clone --recursive --branch ros https://github.com/LORD-MicroStrain/microstrain_inertial.git ~/your_workspace/src/microstrain_inertial
-
Install rosdeps for this package:
rosdep install --from-paths ~/your_workspace/src -i -r -y
-
Build your workspace:
cd ~/your_workspace catkin_make source ~/your_workspace/devel/setup.bash
The source command will need to be run in each terminal prior to launching a ROS node.
NOTE: If installing from the buildfarm, the udev rules will be installed automatically
This driver comes with udev rules that will create a symlink for all microstrain devices.
To install the rules. Download the udev file from this repo and copy it to
/etc/udev/rules.d/100-microstrain.rules
Once the udev rules are installed, the devices will appear as follows in the file system, where {serial} is the serial number of the device:
/dev/microstrain_main
- Most recent non-GQ7 device, or the main port of a GQ7 connected. NOTE: Do not use this rule with multiple devices as it gets overridden with multiple devices./dev/microstrain_aux
- Most recent GQ7 aux port connected. NOTE: Do not use this rule with multiple devices as it gets overridden with multiple devices./dev/microstrain_main_{serial}
- All non-GQ7 devices, and the main port of GQ7 devices/dev/microstrain_aux_{serial}
- The aux port of GQ7 devices
The following command will launch the driver. Keep in mind each instance needs to be run in a separate terminal.
roslaunch microstrain_inertial_driver microstrain.launch
The node has some optional launch parameters that can be specified from the command line in the format param:=value
namespace
: namespace that the driver will run in. All services and publishers will be prepended with this, default:/
node_name
: name of the driver, default:microstrain_inertial_driver
debug
: output debug logs, default:false
params_file
: path to a parameter file to override the default parameters stored inparams.yml
, default: empty
- Create the following files somewhere on your system (we will assume they are stored in the
~
directory):~/sensor_a_params.yml
with the contents:port: /dev/ttyACM0
~/sensor_b_params.yml
with the contents:port: /dev/ttyACM1
- In two different terminals:
roslaunch microstrain_inertial_driver microstrain.launch node_name:=sensor_a_node namespace:=sensor_a params_file:="~/sensor_a_params.yml"
roslaunch microstrain_inertial_driver microstrain.launch node_name:=sensor_b_node namespace:=sensor_b params_file:="~/sensor_b_params.yml"
This will launch two nodes that publish data to different namespaces:
/sensor_a
, connected over port:/dev/ttyACM0
/sensor_b
, connected over port:/dev/ttyACM1
An example subscriber node can be found in the MicroStrain Examples package.
The easiest way to develop in docker while still using an IDE is to use VSCode. Follow the steps below to develop on this repo in a docker container.
- Install the following dependencies:
- Open VSCode and install the following plugins:
- Open this directory in a container:
- Open the
microstrain_inertial
directory in VSCode - Click the green
><
icon in the bottom left corner of the window - Choose
Reopen In Container
- Open the
- Once the project is open in the container, it will take some time to automatically install the rosdeps inside the container, you can then build and run the container by following step 4 of Building from source
If you are comfortable working from the command line, or want to produce your own runtime images, the Makefile in the .devcontainer
directory can be used to build docker images, run a shell inside the docker images and produce a runtime image. Follow the steps below to setup your environment to use the Makefile
- Install the following dependencies:
- Make
- Docker
- qemu-user-static (only for multiarch builds)
- Run the following command to register the qemu binaries with docker:
docker run --rm --privileged multiarch/qemu-user-static:register
- Run the following command to register the qemu binaries with docker:
The Makefile
exposes the following tasks. They can all be run from the .devcontainer
directory:
make build-shell
- Builds the development docker image and starts a shell session in the image allowing the user to develop and build the ROS project using common commands such ascatkin_make
make image
- Builds the runtime image that contains only the required dependencies and the ROS node.make clean
- Cleans up after the above two tasks
Both the ros
and ros2
branches share most of their code by using git submodules. The following submodules contain most of the actual implementations:
- microstrain_inertial_driver_common submoduled in this repo at
microstrain_inertial_driver/microstrain_inertial_driver_common
- microstrain_inertial_msgs_common submoduled in this repo at
microstrain_inertial_msgs/microstrain_inertial_msgs_common
- microstrain_inertial_rqt_common submoduled in this repo at
microstrain_inertial_rqt/microstrain_inertial_rqt_common
Previous versions of the driver were released as tags on Github. They can also be found in specific branches:
ros-3.x.x
contains the most recent code before the standardizing refactorros-2.x.x
contains the most recent code before the MIP SDK refactormaster
contains the most recent code before the common codebase refactor (prior to2.0.0
)
Different packages in this repo are released under different licenses. For more information, see the LICENSE files in each of the package directories.
Here is a quick overview of the licenses used in each package:
Package | License |
---|---|
microstrain_inertial_driver | MIT |
microstrain_inertial_msgs | MIT |
microstrain_inertial_rqt | BSD |
microstrain_inertial_examples | MIT |