This commandline program establishes connection to a motion capture system, processes the rigid-body pose information and publishes them for use with different robotics systems.
┌─────────┐ ┌────────────────────────┐
│ Motion │────────────►│ │ various ┌──────────┐
│ Capture │ TCP / UDP │ Unified Mocap Router ┼───────────► | Agent(s) |
│ System │◄────────────┤ │ protocols └──────────┘
└─────────┘ └────────────────────────┘
- NaturalPoint, Inc. "OptiTrack" via its
NatNet SDK
(stable) - Qualisys, vis its
Qualisys CPP SDK
(experimental)
Agent | Means of Publishing | Launch Command (Example) |
---|---|---|
ROS2 |
On two ros2 topics /mocap/pose and /mocap/twist |
./mocap-router optitrack ros2 -f 100 -c enu -r far -s 1 -n far |
ROS2PX4 |
As above + the published on the required PX4 topic /fmu/in/vehicle_visual_odometry |
./mocap-router optitrack ros2px4 -f 100 -c enu -r far -s 1 -n far |
udp |
Data as a UDP stream (see agents/udp_agent.hpp for the structs) |
./mocap-router optitrack udp -f 100 -c enu -r far -s 1 -n far -i 192.168.209.100 -p 1234 |
ivy |
Publish to an IVY bus | ./mocap-router optitrack ivy -f 100 -c enu -r far -s 1 -n far |
mavlink (experimental) |
Publish mavlink messages to a UDP endpoint (use mavlink-router to uplink to vehicle!) | ./mocap-router optitrack mavlink -f 100 -c enu -r far -s 1 -n far --autopilot px4 |
console |
Only to the terminal (if activated) | ./mocap-router test console --test_freq 100 -f 10 -c enu -r far -s 1 -n far |
log |
Log to a file (csv only so far) | ./mocap-router test log --test_freq 100 -f 10 -c enu -r far -s 1 -n far -o ./output.csv |
Ubuntu >= 22.04 on x86
Prerequisites vary per agent. Currently, these are known:
Agent | Known Prerequisites |
---|---|
all |
libboost-all-dev installed with apt |
ivy |
ivy-c-dev installed from ppa:paparazzi-uav/ppa |
ros2 |
ros-$ROS_DISTRO-base , needs to be sourced for compilation (execute . scripts/source_ros_and_msgs.sh ) |
ros2px4 |
As above + px4_msgs must be sourced to run (execute . scripts/source_ros_and_msgs.sh ) |
Build for all agents with:
mkdir build && cd build
cmake .. && make
Build only for some agents with (for example):
mkdir build && cd build
cmake -D'MOCAPS=test;optitrack' -D'AGENTS=console;ivy;ros2;ros2px4' .. && make
Run with (see table at beginning on this readme)
./mocap-router --help
To add support for your own agent it has to inheret from the base class Agent
defined in agent.hpp
and needs to implement the
void publish_data()
function. It can also implement
void add_extra_po(boost::program_options::options_description &desc)
void parse_extra_po(const boost::program_options::variables_map &vm)
Afterward, the agent needs to be added to the CMakeList.txt
file. A simple example of how to do this is the ConsoleAgent
defined in agents/console_agent.hpp
.
Please open an Issue and we'll support you!
- 2025-02-28 -- 1.1.0 -- Second Release
- Anton Bredenbeck (@antbre, Delft University of Technology, a.bredenbeck - @ - tudelft.nl)
- Till Blaha (@tblaha, Delft University of Technology, t.m.blaha - @ - tudelft.nl)
.
├── agents # contains the agent definitions
├── include # headers
├── scripts # utility scripts
├── src # implementation of data receiving and pose calculations
├── CMakeLists.txt
└── README.md
The contents of this repository are licensed under GNU General Public License v3.0 (see LICENSE
file).
Technische Universiteit Delft hereby disclaims all copyright interest in the program “Unified Mocap Router" (one line description of the content or function) written by the Author(s).
Henri Werij, Dean of the Faculty of Aerospace Engineering
© 2024,2025 Anton Bredenbeck, Till Blaha