Interface (driver) software, including ROS node, for inertial sensors compatible with the Microstrain Communication Library (MSCL).
MSCL is developed by LORD Sensing - Microstrain in Williston, VT.
MSCL is now installed in the CMakeLists.txt. The version installed can be changed by passing the flag -DMSCL_VERSION="62.0.0"
We do our best to keep ROS-MSCL up-to-date with the latest MSCL changes, but sometimes there is a delay. The currently supported version of MSCL is v62.0.0
-
Install ROS and create a workspace: Installing and Configuring Your ROS Environment
-
Move the entire ROS-MSCL folder (ros_mscl and mscl_msgs for just source) to the your_workspace/src directory.
-
Locate and register the ros_mscl package:
rospack find ros_mscl
-
Build your workspace:
cd ~/your_workspace catkin_make source ~/your_workspace/devel/setup.bash
The source command may need to be run in each terminal prior to launching a ROS node.
The following command will launch the driver. Keep in mind each instance needs to be run in a separate terminal.
roslaunch ros_mscl microstrain.launch
Optional launch parameters:
- name: namespace the node will publish messages to, default: gx5
- port: serial port name to connect to the device over, default: /dev/ttyACM0
- baudrate: baud rate to open the connection with, default: 115200
- imu_rate: sample rate for IMU data (hz), default: 100
- debug: output debug info? default: false
- diagnostics: output diagnostic info? default: true
To check published topics:
rostopic list
Example: Connect to and publish data from two devices simultaneously
In two different terminals:
roslaunch ros_mscl microstrain.launch name:=sensor1234
roslaunch ros_mscl microstrain.launch name:=bestSensor port:=/dev/ttyACM1
This will launch two nodes that publish data to different namespaces:
- sensor1234, connected over port: /dev/ttyACM0
- bestSensor, connected over port: /dev/ttyACM1
An example subscriber node can be found here: ROS-MSCL Examples
The easiest way to use docker while still using an IDE is to use VSCode as an IDE. 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 by following this guide
- Due to a bug in the remote container plugin, you will need to refresh the window once it comes up. To do this, type
Ctrl+Shift+p
and typeReload Window
and hit enter. Note that this will have to be repeated every time the container is rebuilt
- Due to a bug in the remote container plugin, you will need to refresh the window once it comes up. To do this, type
- Once the folder is open in VSCode, you can build the project by running
Ctrl+Shift+B
to trigger a build, orCtrl+p
to open quick open, then typetask build
and hit enter - You can run the project by following this guide
If you are comfortable working from the command line, or want to produce 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 (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 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. The resulting image is namesros-mscl
make clean
- Cleans up after the above two tasks
ROS-MSCL is released under the MIT License - see the LICENSE
file in the source distribution.
Copyright (c) 2021, Parker Hannifin Corp.