Ask Your Question

Communication between ROS and Optitrack

asked 2013-02-04 10:00:15 -0600

nemesis gravatar image

updated 2014-01-28 17:15:05 -0600

ngrennan gravatar image


I am new to ROS and I needed some help/guidance. I am using ROS(Fuerte) on a Virtual Machine. I am trying to understand how to transmit data(coordinates of a bot) from Optitrack(NatNet), installed on a different machine, to ROS (on a separate machine). I wish to understand this myself so if anyone can guide me or provide me with links to understand this, I would appreciate it. Please let me know if any other information is required from me.

edit retag flag offensive close merge delete


Hello @nemesis how did you solve I am getting the same error like you used to get. Can you tell me how u were able to solve it?

UbuntuROs gravatar imageUbuntuROs ( 2017-06-27 13:30:49 -0600 )edit

@UbuntuROs I already have an answer to this question.

nemesis gravatar imagenemesis ( 2017-06-27 15:59:10 -0600 )edit

Can you help me in solving the error? This is the steps I followed to connect Motive with Ros 1. I git clone the file from 2. exported it using the export command export VRPN_ROOT=path to where VRPN is located 3.install the necessary package

UbuntuROs gravatar imageUbuntuROs ( 2017-06-27 16:10:53 -0600 )edit

4.Run catkin_make 5. Launch using $roslaunch vrpn_client_ros sample.launch server:= when i ran it, it says the connection is established but when i tried to run $rostopic command it says that the topic didnt established yet. What did I get wrong? I really need your help.

UbuntuROs gravatar imageUbuntuROs ( 2017-06-27 16:13:56 -0600 )edit

Can you guide me through on how to create a connection between motive and ROS? I appreciate your help.

UbuntuROs gravatar imageUbuntuROs ( 2017-06-27 16:19:09 -0600 )edit

@nemesis did u use Natnet or VRPN?

UbuntuROs gravatar imageUbuntuROs ( 2017-06-28 14:17:02 -0600 )edit

@nemesis what is the link I opened but there are many files over there which specifically did u use?

UbuntuROs gravatar imageUbuntuROs ( 2017-06-28 14:27:30 -0600 )edit

6 Answers

Sort by ยป oldest newest most voted

answered 2013-02-07 09:00:12 -0600

nemesis gravatar image

updated 2013-02-21 06:56:32 -0600

I am using this post/answer to describe the procedure I followed, as a reference in case someone else has an issue -

@balto -

  1. In the "workspace" folder that you generally create (given in ROS tutorials) I used to the command "svn co link" to get/download the ros_vrpn_client. The link here refers to the gt-ros-pkg repository (I can't post the exact link right now because of low karma points)

  2. Now, using either "rosdep install ros_vrpn_client" or "rosmake ros_vrpn_client" I "built" the package (this is where I was confused, what exactly to use)

  3. Just in case, I used the "source ~/workspace/setup.bash" command after building the package.

  4. go to the ros_vrpn_client/ folder and execute the file (command line -> go to folder containing file -> ./ )

  5. Start streaming in Tracking Tools after creating the trackable.

  6. runs "roscore" and in a separate terminal run the command given on the ros_vrpn_client wiki page (to run the node).


a) I got the error - "from Trackable1: No response from server" (This was because of an ip address problem)

b) Upon putting the correct address I got the same issue but this time I also got the message which notified me of a difference in version (7_28 and 7_20). I assumed that there is a connection with the server although no data is being sent.

c) As per your suggestion I changed the name of the trackable to "Tracker" in both: Tracking Tools as well as in the rosrun command. There is no "error" mentioning "No response from server" anymore but there is still the message about the different versions. After displaying this message, it shows nothing (and doesn't end either). So I dunno how to proceed. Or is there some other way to view the data that is being transmitted on these nodes??

*Note - * In a separate terminal I used "rostopic echo /Tracker/pose" and I think it's displaying the coordinates correctly. Thank you so much for your time and help :)

@Ryan -

I downloaded and built the mocap_optitrack package in a similar manner like I have explained above. I faced the following issues after running the "rosrun mocap_optitrack mocap_node" command.


It displays a bunch of lines starting with [Info] and the last line mentioning "Enabling non blocking I/O". I initially thought it was because of the address given in the "Multicast Interface" under Streaming Properties of the Tracking Tools software. I tried changing it to some other address but it doesn't give me anything else either. Is there something that needs to be set separately? Like setting a particular Port in this case or something else? Or is there some other way to view the data that is being transmitted on these nodes??

Note - In Tracking Tools put the "Multicast Interface" address as the IP address of the system you have your ROS on. You can then display the coordinates using "rostopic echo /Husky_1/pose". I am still nto sure why it's called "Husky_1" instead ... (more)

edit flag offensive delete link more


Yes, our method uses Tracking Tools

Ryan gravatar imageRyan ( 2013-02-10 14:09:55 -0600 )edit

We use mocap_optitrack with a virtual machine as well. I will point another person on our team to this thread.

Ryan gravatar imageRyan ( 2013-02-19 09:03:56 -0600 )edit

Thank you!

nemesis gravatar imagenemesis ( 2013-02-19 09:10:51 -0600 )edit

Good to hear. Is all working now?

tonybaltovski gravatar imagetonybaltovski ( 2013-02-19 10:13:39 -0600 )edit

@balto - Yes! I think I will just have to modify the code a little bit to match with my Tracking Tools results - The axes are bit different; and get Yaw,Pitch,Roll as outputs too. That should be possible right? @Ryan - Apart from a certain variation, mocap is working for me too. Thanks!

nemesis gravatar imagenemesis ( 2013-02-21 06:14:59 -0600 )edit

Anybody uses Motive? I think Tracking Tools is outdated.

ZiyangLI gravatar imageZiyangLI ( 2014-02-26 22:16:11 -0600 )edit

Motive works with NatNet great.

tonybaltovski gravatar imagetonybaltovski ( 2014-02-27 02:39:52 -0600 )edit

Do you mean I can just rosmake mocap_optitrack and the node will works perfectly with the latest Motive software? Does Motive use the latest NatNet? Then it should transmit data in a different format, like having more fields. Am I wrong?

ZiyangLI gravatar imageZiyangLI ( 2014-02-27 20:34:02 -0600 )edit

answered 2013-02-07 14:24:39 -0600

Ryan gravatar image

We use mocap_optitrack with NatNet. A more full-featured and stable version that publishes poses, odometry, and tfs is here, but we haven't updated the ROS wiki to point to it yet.

edit flag offensive delete link more


Ryan gravatar imageRyan ( 2013-02-28 11:03:47 -0600 )edit

answered 2013-02-04 12:10:33 -0600

Do you need to use NatNet? I use VRPN with OptiTrack system which is documented here: http: //

edit flag offensive delete link more


Sure. Did you download the package?

tonybaltovski gravatar imagetonybaltovski ( 2013-02-11 12:53:41 -0600 )edit

@Ryan is the mocap_optitrack able to work with ROS electric? Since I noticed it was for the Husky, I assume it is on groovy.

tonybaltovski gravatar imagetonybaltovski ( 2013-02-11 12:57:48 -0600 )edit

@nemesis Setup the tracking tools to broadcast the pose and name the trackable "Tracker". Then run the ROS command.

tonybaltovski gravatar imagetonybaltovski ( 2013-02-19 04:27:20 -0600 )edit

@balto - I don't know if I should start a separate post for this or not, but, how can I get the node to display the "Yaw,Pitch & Roll" instead of the Quartenions?

nemesis gravatar imagenemesis ( 2013-03-04 12:39:59 -0600 )edit

You must convert them using the bullet commands something like this: tf::quaternionMsgToTF(msg->transform.rotation, q);

tonybaltovski gravatar imagetonybaltovski ( 2013-03-04 13:47:07 -0600 )edit

You must convert them using the bullet commands something like this:

tonybaltovski gravatar imagetonybaltovski ( 2013-03-04 13:47:08 -0600 )edit

@balto - Oh ok. The code is bit confusing (not used to all of this), so still trying to figure out how to go about "implementing" what you mentioned above.

nemesis gravatar imagenemesis ( 2013-03-06 09:53:03 -0600 )edit

Is that a question? I can send you a more detailed snippet of code if you want.

tonybaltovski gravatar imagetonybaltovski ( 2013-03-09 04:33:59 -0600 )edit

answered 2017-05-08 03:18:06 -0600

neu gravatar image

I want to send the data of posision of the cameras optitrack (windows pc) to ros (ubuntu pc). I was reading many forums and decided to choose the method vrpn_client_ros. In Motive I have the vrpn broadcast option with ip ( and a port: 3883. I made a LAN with a router where the windows pc has an ip ( and the Ubuntu pc has an ip ( When I run the launch file (roslaunch vrpn_client_ros sample.launch server: = on a terminal, I get the answers: "Connecting to VRPN server at" and "Connection established". My problem is that the topics published do not appear, and therefore I can not get the position data in ros. How can I solve this problem? Do I have to modify the launch file?

edit flag offensive delete link more


try roslaunch vrpn_client_ros sample.launch server: =

geds gravatar imagegeds ( 2017-05-08 03:48:49 -0600 )edit

I tried, not this problem

neu gravatar imageneu ( 2017-05-08 05:20:18 -0600 )edit

well,I don't know how to solve your problem,but I did complete the communication between ROS and Optitrack by using vrpn_client_ros package.The difference is that I direct use a network cable rather than a router, see:

geds gravatar imagegeds ( 2017-05-08 07:00:49 -0600 )edit

if you do enable the "Broadcast Frame Data" checkbox under "VRPN Streaming Engine" in Motive.After roslaunch sample.launch file, run rostopic list command ,you will find a topic with a rigid body name,such as "/vrpn_client_node/RigidBody1"

geds gravatar imagegeds ( 2017-05-08 07:06:14 -0600 )edit

then run command rostopic echo /vrpn_client_node/RigidBody1 ,you will find the position and orientation data stream of RigidBody1

geds gravatar imagegeds ( 2017-05-08 07:07:06 -0600 )edit

hi sir i have done all the steps as given by you , i have made connection between two computers using lan cable, yet i am not able to see the topic list . should i change the launch file,if yes then tell me the procedure to change the sample launch file. Thank you Abhishek

abhi15491 gravatar imageabhi15491 ( 2017-06-11 08:00:23 -0600 )edit

@abhi15491 were u able to solve the problem?

UbuntuROs gravatar imageUbuntuROs ( 2017-07-06 10:53:02 -0600 )edit

answered 2017-06-11 07:57:46 -0600

Dear sir, I have done the same steps as given by you, after running the sample.launch file i am getting this started roslaunch server http://abhishek-Lenovo-ideapad-Y700-1...


PARAMETERS * /rosdistro: indigo * /rosversion: 1.11.21 * /vrpn_client_node/broadcast_tf: True * /vrpn_client_node/frame_id: world * /vrpn_client_node/port: 3883 * /vrpn_client_node/refresh_tracker_frequency: 1.0 * /vrpn_client_node/server: localhost * /vrpn_client_node/update_frequency: 100.0 * /vrpn_client_node/use_server_time: False

NODES / vrpn_client_node (vrpn_client_ros/vrpn_client_node)

auto-starting new master process[master]: started with pid [17028] ROS_MASTER_URI=http://localhost:11311

setting /run_id to 44680bdc-4ea2-11e7-869a-c85b768ff82e process[rosout-1]: started with pid [17041] started core service [/rosout] process[vrpn_client_node-2]: started with pid [17045] and after running the rostopic lsit command (on another terminal) i am getting this /rosout /rosout_agg should i change the launch file, if yes then tell me how to modify the launch file and what to modify Please resolve the issue Regards, abhishek

edit flag offensive delete link more

answered 2017-06-26 16:45:07 -0600

UbuntuROs gravatar image

updated 2017-07-12 12:47:22 -0600

To give you more info on this. This is what I am getting right now: ubuntuxenial@ubuntuxenial-VirtualBox:~$ roslaunch vrpn_client_ros sample.launch server:= ... logging to /home/ubuntuxenial/.ros/log/ffb55d00-6724-11e7-b1f2-0800279f7859/roslaunch-ubuntuxenial-VirtualBox-18941.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntuxenial-VirtualBox:39717/


PARAMETERS * /rosdistro: kinetic * /rosversion: 1.12.7 * /vrpn_client_node/broadcast_tf: True * /vrpn_client_node/frame_id: world * /vrpn_client_node/port: 3883 * /vrpn_client_node/refresh_tracker_frequency: 1.0 * /vrpn_client_node/server: * /vrpn_client_node/update_frequency: 100.0 * /vrpn_client_node/use_server_time: False

NODES / vrpn_client_node (vrpn_client_ros/vrpn_client_node)

auto-starting new master process[master]: started with pid [18952] ROS_MASTER_URI=http://localhost:11311

setting /run_id to ffb55d00-6724-11e7-b1f2-0800279f7859 process[rosout-1]: started with pid [18965] started core service [/rosout] process[vrpn_client_node-2]: started with pid [18968] And I tried to run rostopic list on another terminal and got the following:

ubuntuxenial@ubuntuxenial-VirtualBox:~$ rostopic list /rosout /rosout_agg

So here you can see rigid body isnt published. I am guessing there might be a problem in my Ip address. I am using Ubuntu on virtual box. How should you think I have to create a network between the Ubuntu's virtual box and the host computer where Optitrack is operating?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-02-04 10:00:15 -0600

Seen: 3,117 times

Last updated: Jul 12 '17