Streaming Mocap Data into ROS by OSC
Prerequisites
5
Last updated
ROS is an open-source framework for developing robotic applications. It allows you to connect sensors, control systems, visualization tools, and more within a unified architecture.
Motion data captured with MOVIN TRACIN and MOVIN Studio can be streamed in real time or played back from recorded files within a ROS 2 environment. The data can then be retargeted to a robot model, allowing you to visualize its movement in RViz2 or integrate it directly into your robot control pipeline for further development.
Before integrating with ROS, please make sure your environment is properly set up as described below.
ROS 2:
Humble (tested)
Required ROS 2 Packages:
robot_state_publisher
rvix2
xacro
tf2_ros
Required pip Packages:
numpy
scipy
movin-sdk-python (Required for BVH file loading and real-time mode)
cd ~/ros2_ws/src
git clone https://github.com/MOVIN3D/Motion-Player-ROSNavigate to the src folder of your ROS 2 workspace and clone the Motion-Player-ROS repository.
pip install git+https://github.com/MOVIN3D/MOVIN-SDK-Python.gitBefore proceeding, check that all required packages from the Prerequisites section are installed.
The movin-sdk-python package is necessary for BVH file loading and real-time live streaming.
For more information about MOVIN-SDK-Python, please refer to the repository link.
ros2 launch motion_player realtime.launch.pyLaunch real-time mode to receive motion data from MOVIN Studio.
In real-time mode, you can:
Real-time Retargeting: Retargeting motion data instantly to a robot model
Real-time Visualization: Visualize both the mocap skeleton and the retargeted robot motion simultaneously in RViz2
ros2 launch motion_player realtime.launch.py port:=11235 human_height:=1.80 skeleton_offset_x:=1.5You can customize parameters as needed:
port
11235
UDP port to listen for OSC mocap data
robot_type
unitree_g1
Target robot type (unitree_g1 or unitree_g1_with_hands)
human_height
1.75
Human height in meters for scaling
skeleton_offset_x
1.0
X offset to place skeleton beside robot
urdf_file
(package default)
Path to custom URDF file
rviz_config
(package default)
Path to custom RViz config file
You may also run the node directly using the --realtime flag:
ros2 run motion_player motion_player --realtime --ros-args -p port:=11235 -p human_height:=1.8Last updated