Motion Capture Instructions (Optitrack Motive) - EmaroLab/docs GitHub Wiki
How-To for the MoCap System @ EMAROlab
(abbr.:MoCap = motion capture)
Index
A. Start And Calibration B. Offline Recording C. Rigid-body creation in Motive D. Online rigid body pose publishing in Motive E. Reading the published pose using a ROS node
A. Start and Calibration
1. Connect the cameras hub power plug to the socket (verify that the cameras LED and screen are turning on)
2. On the dedicated desktop PC open the "Motive" program.
3. Click on "Perform Camera Calibration" (P.S.: if the condition between two successive tests have not changed you may skip this steps and jump to point 10)
4. With the Calibrating Wand (3-markers in line) move in the MoCap area, trying to cover all the area you want to use
5. Once you're done, click on "Calculate". The result of the calibration also returns the system's accuracy.
6. Click on "Apply" to accept the calibration and save it on the PC
7. Position the L-shaped calibrating tool (3-markers on a metal L) in the point you want to use as the origin of the World Reference Frame.
8. Click on "Set ground plane" and remove the calibrating L.
9. Click on "Help->Show Quick Start"
10. Click on "Open Camera Calibration", and select the calibration file saved at point## b
B. Offline Recording
1. Start positioning your markers in the MoCap area
2. Click on the typical red recording button :red_circle: to start an acquisition
3. ...RECORDING...
4. Click again on the button to stop recording
5. In the file tree are listed all the generated files, one for each marker
6. Right-click on the file you want to save and select -> "Export tracking data"
7. Select the "CSV" format (comma separated value) and save
Remark 1: It is possible to rename the markers and this is advised when you use more than one contemporarily. (Help section to be refined here)
Remark 2: Sometimes the system loses track of a marker, and when it tracks it again it is treated as a new marker. It is possible to merge the two acquisitions to reconstruct the whole history (Help section to be refined here)
Remark 3: You can group together sets of markers by creating Rigid bodies, check point C
C. Rigid-body creation in Motive
1. In Motive, under "View" select "Rigid Body Properties"
2. Select at least 3 markers and in the "Rigid Bodies" tab click on "Create From Selection"
3. Now the program creates a visual rigid body and associates a marker to the calculated center of mass. The ID of the bodies (you will need it in point E) is given incrementally, so keep track of the bodies you are adding. The ID is the number contained in the "Name" under "General Properties"
D. Online rigid body pose publishing in Motive
1. Here is a brief summary on how to set up the rigid body pose publishing, updated to the latest Motive version. You can also check http://wiki.ros.org/mocap_optitrack for some useful pictures as a reference (beware that on the website the "Rigid body" is called Trackable")
2. Open the "Streaming Properties" pane in Tracking Tools and enable the "Broadcast Frame Data" checkbox. Set the "Stream Rigid Bodies" option to "True" if it's not set already
3. Set "Type" to "Multicast", the ports should be left as-is
4. Unless the machine running Tracking Tools has multiple network interfaces, the "Local Interface" may be set as "Preferred". The "Multicast Interface" should be set to the IP address of the machine running the mocap_optitrack node (that we will set up in point E)
E. Reading the published pose using a ROS node
Set Up Network
If you are running a Virtual machine go to network settings and set the adapter to Bridged instead of NAT.
1. In your linux machine, got to "Network settings -> Edit Connection -> IPv4 settings".
2. Set IP address manually. Available IP address should be confirmed from lab.
3. Save the settings and reconnect to the network.
4. Type ipconfig
on a terminal to check that IP address has been updated correctly.
Configure and Launch the ROS Node
**********************************************************************************
WARNING: If you're using more than one rigid body please read the note at the end!
**********************************************************************************
1. Clone the https://github.com/ros-drivers/mocap_optitrack/tree/new-and-old-support repository in your catkin workspace (in the "src" folder)
2. Type:
$ roscd mocap_optitrack/config
$ gedit mocap.yaml
By editing this file you can change the topic name and the rigid bodies you want to publish
3. Compile using catkin_make
4. Use the launch file to launch the node:
$ roslaunch mocap_optitrack mocap.launch
5. With default configuration, following command should list position and orientation of rigid body on the screen
rostopic echo /Robot_1/pose
IMPORTANT!!! Note
In the file mocap_datapackets.cpp
, in the function parse(), the program does not add the counter for buffer exactly and this causes the program to crash. To fix this error we need to add seek(2)
after the seek(sizeof(float))
like this:
//skip mean marker error
seek(sizeof(float));
seek(2);