Skip to content

hpaul360/natnet_bridge_ros2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mocap ROS 2 - NatNet Bridge

A ROS 2 package to publish Motion Capture (MoCap) data over the NatNet protocol.

This package connects to a machine running OptiTrack Motive and publishes the pose data of all rigid bodies configured in the software, including their IDs. The connection settings can be modified in the parameter file inside the config folder.

The package is based on the NatNet SDK sample: NatNet SDK.
This project includes work derived from the NatNet SDK by OptiTrack. Redistribution or reuse of this code may be restricted—please contact the original copyright holder.


Overview

The mocap_ros2 package provides a ROS 2 node that publishes rigid body pose data using the MoCap NatNet protocol. It connects to a given IP and port (where Motive is running) and publishes pose and ID information for all rigid bodies set up in the Motive environment.


Prerequisites

  • ROS 2 (Humble)
  • OptiTrack Motive (on a Windows machine) (This package is tested with Motive v1.10.1 and Motive v3.3.1)
  • Rigid bodies configured in Motive

Installation

  1. Clone the repository and build it in your ROS 2 workspace:

    mkdir -p mocap_ws/src && cd mocap_ws/src
    git clone https://github.com/hpaul360/natnet_bridge_ros2.git
    cd ..
    colcon build --symlink-install
  2. Edit the parameter file to set the correct IP and port for your OptiTrack Motive setup. Important parameter to edit is server_address

File location:mocap_ws/src/natnet_bridge_ros2/mocap_client/config/params.yaml

```yaml
# Dummy mode (for testing without Motive)
dummy_send: false  # Set to true to send dummy data
send_rate: 100
number_of_bodies: 1
dummy_x: 0.0
dummy_y: 0.0
dummy_z: 1.0
dummy_qx: 0.0
dummy_qy: 0.0
dummy_qz: 0.0
dummy_qw: 1.0

# Network settings
server_address: "192.168.0.98" # IP of the Windows PC running Motive software
multicast_address: "239.255.42.99" 
connection_type: 0  # 0 = multicast, 1 = unicast
server_command_port: 1510
server_data_port: 1511

# ROS 2 topic and options
pub_topic: "/mocap/rigid_bodies"
record: false
record_file_name: ""
```

Usage

  1. Ensure Motive is running on the Windows PC, and the machine is on the same network.

  2. Launch the node:

    source ~/mocap_ws/install/setup.bash
    ros2 launch mocap_client mocap.launch.py
  3. The node will connect to Motive, publish pose data for all rigid bodies, and output their IDs.


Configuration

All runtime parameters can be adjusted in: mocap_ros2/mocap_client/config/params.yaml


Author


Acknowledgments

This package uses the NatNet SDK provided by OptiTrack.
Redistribution or reuse may be restricted. Please consult the NatNet SDK license or contact OptiTrack for permission.


Issues and Contributions

To report issues or contribute to development, visit the GitHub repository.


Contact

For questions or support, contact the author:
Hannibal Paul

About

MOCAP (NATNET protocol) position publisher in ROS2.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published