For information on how to use VRPN and related plugins, please refer to "Section VI, Introduction to Views - (3) Data
Broadcasting - VRPN Broadcast Data".
In real-time mode, quickly create a Markerset or load data with a Markerset in post-processing mode. Refer to "
Section IX, Creating a Markerset" for instructions on how to create a Markerset.
In XINGYING software, open the Data Broadcasting panel and enable VRPN. For information on VRPN functionality, refer
to "Section VI, Introduction to Views - (3) Data Broadcasting - VRPN Broadcast Data".
You can run the test program "NokovVrpnClient.exe" to retrieve motion capture data (refer to "Section VI,
Introduction to Views - (3) Data Broadcasting - VRPN Broadcast Data" for specific instructions). If you are not
receiving data, check the VRPN configuration in XINGYING and ensure the IP address for data broadcasting is
correct. (If needed, "NokovVrpnClient.exe" is an executable test program; please consult a technical engineer for
access).
The installed Ros2 version is Foxy, and the Ubuntu version is 20.04. Use XINGYING software to transmit motion capture
Markerset or rigid body data to Ros2 using VRPN.
Start the Nokov virtual machine, open the terminal, and enter the following commands in sequence:
Navigate to the directory: ros2_ws/src/vrpn_client_ros/config. Enter gedit sample.params.yaml and press Enter. The
server's IP address is "192.168.0.107". Change the server's IP address to the broadcast address set in XINGYING. Save
the file and exit.
Open a terminal. After each terminal session, you need to enter the command "source /opt/ros/foxy/setup.bash".
Then, enter the command: "ros2 launch vrpn_client_ros sample.launch.py" and press Enter. In the terminal, you
should see three lines printed: "Connection established," "Found new sender: Tracker2," and "Creating new tracker
Tracker2." This indicates a successful connection and communication with the motion capture system has been
established. Ros2 has successfully received motion capture data, with "Tracker2" representing the name of the
Markerset in XINGYING software.
When starting vrpn_client-ros, it is important to ensure that the IP address is correctly set. It should be in the
same network segment as the host running XINGYING software and should be pingable.
Open a terminal and view the topics. Enter the command "ros2 topic list" to see the topic "/Tracker0/pose," where "
Tracker0" represents the name of the Markerset in XINGYING software.
Enter the command "ros2 topic echo /Tracker0/pose" and press Enter to see the received data. Again, "Tracker0"
represents the name of the Markerset in XINGYING software.
Data Explanation: "Pose" indicates the position and orientation of the Markerset. Under "Pose," "Position" represents
the position information of the Markerset, while "Orientation" represents the rotational information of the
Markerset. Only when the "Rigid Body" type is selected will Ros2 print out the "Orientation" data. Selecting "Marker"
or "Unlabeled Marker" types will not print out the "Orientation" data.
Instructions for using ROS with VRPN functionality
Enable VRPN in the data broadcasting settings. VRPN can be categorized into three types: Rigid Body, Markers, and
Unlabeled Markers.
Before selecting the different VRPN functionalities and adjusting values, pause the software playback. Uncheck "
Enable VRPN" in the data broadcasting settings, then proceed with selecting the desired functionalities and modifying
the values. After selecting the desired functionalities, re-enable "Enable VRPN" and resume software playback.
Rigid Body Type:
The Rigid Body type indicates the transmission of rigid body information data. In XINGYING, quickly create a rigid
body, select the "Rigid Body" type, enable VRPN, and play the motion capture software. In the terminal of Ros2,
enter "ros2 launch vrpn_client_ros sample.launch.py" to retrieve the motion capture data. Open another terminal
and enter "ros2 topic list" to view the printed topics concerning the rigid body. Enter "ros2 topic echo + topic
name" to view the data related to that topic in the terminal.
Marker Type:
When the Marker type is selected, it indicates the transmission of named marker point information data. After
creating a Markerset, select the "Marker" type, enable VRPN, and play the motion capture software. In the Ros2
terminal, start Ros2 using the appropriate command to retrieve the motion capture data. Then, open another
terminal and subscribe to the marker point topic. For example, in "Tracker0_Marker1," "Tracker0" represents the
Markerset name, and "Marker1" represents the name of the first point in the Markerset. If you need to retrieve
data for the second point of the Markerset, simply change "Marker1" to "Marker2," and so forth. Enter the
command "ros2 topic echo /Tracker0_Marker1/pose" to view the data for the "Marker1" point of "Tracker0."
Marker Point (Unnamed)
Marker points (unnamed) indicate that unnamed Marker point information data is emitted. Select the Marker Point (
unnamed) type, enable VRPN, and play the mocap software. After the ROS2 terminal enters the command to start ROS2,
after obtaining the mocap data, open another terminal input command to subscribe to the topic of unnamed points,
and enter the command "ros2 topic echo /U_Tracker0/pose" to enter, the data of the unnamed points will be printed
in the terminal. "U_Tracker0" indicates the first unnamed point, and to get the information data of the second
unnamed point, you can change "U_Tracker0" to "U_Tracker1" to represent the second unnamed point.
In the unit drop-down box, you can change different units, which are divided into "millimeters, centimeters, and
meters", and pause the motion capture → open DataRadio, select the unit you want to change in the Unit drop-down
list→ enable VRPN→ click Playback. After changing the unit, the unit of the "Position" data printed in Ros2 will also
be changed in real time, which can be used with the three types of VRPN;
Check "X, Y, Z" in "Invert", which means that the positive and negative signs of VRPN three types of position data
are reversed, if the data of "Position" in Ros2 before checking is positive, it will become negative after checking.
If checked, the X, Y, and Z coordinate data of "Position" in Ros will be reversed;
"qx, qy, qz" indicates the reversal of the direction rotation data, and the X, Y, and Z coordinate data of "
orientation" in Ros2 will be reversed after checking.
In the "Offset" section, you can set the coordinate offsets for variables data in "X, Y, Z" coordinates (as shown in
Figure 29). Pause the software playback → Open data broadcasting → Modify the coordinate offsets for X, Y, Z in the "
Offset" value input box → Enable VRPN → Click play. After adjusting the coordinate offset values, the modified values
will be added to the "Position" X, Y, Z coordinate values in Ros2.
After checking "Speed" in the XINGYING software, enter the command in the Ros2 terminal to retrieve the topic. "
twist" represents speed. Input the command "rostopic echo /Tracker4/twist" and press Enter. The terminal will then
print the data information of the speed of the "Tracker4" rigid body.
After checking "Acceleration" in the XINGYING software, enter the command in the Ros2 terminal to retrieve the
topic. "accel" represents acceleration. Input the command "rostopic echo /Tracker4/accel" and press Enter. The
terminal will then print the data information of the acceleration of the "Tracker4" rigid body.
Frames represent the frame factor used for speed calculation. You can adjust this value in the dropdown box to make
the actual speed value closely match the output speed value.