Difference between revisions of "OptiTrack"
(→Configuring Tracking Tools) |
Mauferrari (talk | contribs) (→OptiTrack - Sistema de Captura de Movimento (MoCAp - Motion Capture)) |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | = OptiTrack = | + | = OptiTrack - Sistema de Captura de Movimento (MoCap - Motion Capture) = |
TODO: Importar documentação | TODO: Importar documentação | ||
| − | + | * Site Fabricante: https://optitrack.com/ | |
== Tutorial OptiTrack ROS == | == Tutorial OptiTrack ROS == | ||
| Line 43: | Line 43: | ||
For all computers, first check if the multicast feature is enabled using the following command. | For all computers, first check if the multicast feature is enabled using the following command. | ||
| − | cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts | + | <pre class="bash"> |
| + | $ cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts | ||
| + | </pre> | ||
If this command returns 0, the multicast feature is enabled and you can go ahead to the next section. To temporary enable the multicast feature, execute the following command, however, | If this command returns 0, the multicast feature is enabled and you can go ahead to the next section. To temporary enable the multicast feature, execute the following command, however, | ||
when the computer restarts, this configuration will be lost. | when the computer restarts, this configuration will be lost. | ||
| − | sudo sh -c "echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts" | + | <pre class="bash"> |
| + | $ sudo sh -c "echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts" | ||
| + | </pre> | ||
| − | To permanently enable the multicast feature, edit the /etc/sysctl.conf file and add the following line, or uncomment it, if it already exists, and change its default value. | + | To '''permanently enable''' the multicast feature, edit the '''/etc/sysctl.conf''' file and add the following line, or uncomment it, if it already exists, and change its default value. |
| + | <pre class="bash"> | ||
net.ipv4.icmp_echo_ignore_broadcasts=0 | net.ipv4.icmp_echo_ignore_broadcasts=0 | ||
| + | </pre> | ||
In order for the changes to take effect, execute the following command: | In order for the changes to take effect, execute the following command: | ||
| − | sudo service procps restart | + | <pre class="bash"> |
| + | $ sudo service procps restart | ||
| + | </pre> | ||
To check which multicast groups are already defined in a computer, execute the following command. | To check which multicast groups are already defined in a computer, execute the following command. | ||
| − | netstat -g | + | <pre class="bash"> |
| + | $ netstat -g | ||
| + | </pre> | ||
This command will report all the IP addresses enabled for multicast for each of the network interfaces available, both for IPv4 and IPv6. The standard IP address for multicast is 224.0.0.1, that should appear on the list provided by the last command, and it is the one we will use. | This command will report all the IP addresses enabled for multicast for each of the network interfaces available, both for IPv4 and IPv6. The standard IP address for multicast is 224.0.0.1, that should appear on the list provided by the last command, and it is the one we will use. | ||
| Line 66: | Line 76: | ||
At this point, to check whether the multicast feature is working or not, execute the following command, at any computer. | At this point, to check whether the multicast feature is working or not, execute the following command, at any computer. | ||
| − | ping 224.0.0.1 | + | <pre class="bash"> |
| + | $ ping 224.0.0.1 | ||
| + | </pre> | ||
If everything is configured properly, you should get a reply from each computer in the common network at each iteration. | If everything is configured properly, you should get a reply from each computer in the common network at each iteration. | ||
Latest revision as of 15:16, 27 October 2023
Contents
OptiTrack - Sistema de Captura de Movimento (MoCap - Motion Capture)
TODO: Importar documentação
- Site Fabricante: https://optitrack.com/
Tutorial OptiTrack ROS
This is an updated tutorial from the original ros wiki for OptiTrack.
Streaming of OptiTrack mocap data to tf ROS.
This package contains a node that translates motion capture data from an OptiTrack rig to tf transforms, poses and 2D poses. The node receives packets that are streamed by the Tracking Tools software, decodes them and broadcasts the poses of configured rigid bodies as tf transforms, poses, and/or 2D poses.
Currently, this node supports the NatNet streaming protocol v2.2
Installation
The easiest way to get the mocap_optitrack package in Ubuntu:
$ git clone https://github.com/ros-drivers/mocap_optitrack.git $ git checkout new-and-old-support-updated # use this branch, I tested the with commit 7723217 and it does not work $ cd .. $ catkin_make
To install Tracking Tools, see the instructions on the Natural Point website.
Configuring Tracking Tools
After installing Tracking Tools you will need to configure it for streaming of rigid bodies to the machine running the mocap_optitrack ROS node.
- 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.
- Set Type to Multicast, the ports should be left as-is.
- 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 address in the range
224.0.0.0 through 239.255.255.255. I used 230.0.0.1 (use the same in mocap.yaml on ROS), with command port in 1510 and data port in 1511.
Enable Linux multicast
For all computers, first check if the multicast feature is enabled using the following command.
$ cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
If this command returns 0, the multicast feature is enabled and you can go ahead to the next section. To temporary enable the multicast feature, execute the following command, however, when the computer restarts, this configuration will be lost.
$ sudo sh -c "echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts"
To permanently enable the multicast feature, edit the /etc/sysctl.conf file and add the following line, or uncomment it, if it already exists, and change its default value.
net.ipv4.icmp_echo_ignore_broadcasts=0
In order for the changes to take effect, execute the following command:
$ sudo service procps restart
To check which multicast groups are already defined in a computer, execute the following command.
$ netstat -g
This command will report all the IP addresses enabled for multicast for each of the network interfaces available, both for IPv4 and IPv6. The standard IP address for multicast is 224.0.0.1, that should appear on the list provided by the last command, and it is the one we will use.
At this point, to check whether the multicast feature is working or not, execute the following command, at any computer.
$ ping 224.0.0.1
If everything is configured properly, you should get a reply from each computer in the common network at each iteration.
Configuring mocap_optitrack
Once motion capture data is being streamed to the mocap_optitrack node, the mapping of trackables to ROS topics must be defined. A sample configuration file called "mocap.yaml" is included with the package, you can find it in the config directory of the package.
$ roscd mocap_optitrack/config $ nano mocap.yaml