L2S-lab / natnet_ros2

ROS 2 driver for the NatNet 4.0 protocol used for the OptiTrack motion capture system and Motive application
GNU General Public License v3.0
0 stars 1 forks source link
driver motion-capture natnet natnet-sdk optitrack ros2

NatNet 4 ROS 2 driver (WIP)

GitHub Action Status GitHub Action Status GitHub Action Status

Static Badge

It is a continuation of the ROS 1 driver. Which can be found here.

If you are using software for any publication or article, we would be delighted if you could cite it from here.

Introduction

This package contains a ROS 2 driver for the NatNet protocol used by the OptiTrack motion capture system. It supports NatNet versions 4.0 (Motive 2.2 and higher). The NatNet SDK provided by the optitrack can be found here. It will be downloaded under deps/NatnetSDK while building it for the first time. NatNet protocol is used for streaming live motion capture data (rigid bodies, skeletons etc) across the shared network.

This package is only tested with the Natnet 4.0 and ROS 2 (Foxy and Humble) but probably will work with the other versions of Motive and ROS 2 as well.

Current Features:

Work under progress:

How to use it

Building the package

requirements

sudo apt install -y ros-$ROS_DISTRO-tf2* wget

Keep your system connected to the internet while building the package for the first time.

cd ~/ros2_ws/src
git clone https://github.com/L2S-lab/natnet_ros2
cd ..
colcon build --symlink-install
. install/setup.bash

Setup the Motive for this package

Here is an example of how your streaming settings should look.

alt text

Easy way

Using GUI tool Here, you can use simple tool and follow the instruction from the output area on the right bottom corner.

ros2 launch natnet_ros2 gui_natnet_ros2.launch.py

alt text

Difficult way

Using Non gui approach ros2 launch natnet_ros2 natnet_ros2.launch.py

Understanding the launch file

Launch file natnet_ros2.launch.py contains the several configurable arguments. The details are mentioned in the launch file. Following are several important argument for the connection and the data transfer. Other connection arguments are for the advanced option.

Publishing the single marker

It is possible to track the single marker as a rigid body with constant orientation. Go to the config/initiate.yaml It is suggested to make a copy of the file and rename the new file. The file contains the details on what to modify.

The question might arise on how to check the position of the single marker. For that, you can log the frames of the incoming data in the terminal. To do so, enable the log_frames in the launch file.

After configuring the initiate.yaml, in the launch file, enable the pub_individual_marker. Change the name of the config file in the argument conf_file if needed and launch the file.