alvinsunyixiao / vrpn_mocap

MIT License
16 stars 7 forks source link

VRPN connection is bad #5

Closed mandralis closed 9 months ago

mandralis commented 10 months ago

I am getting a warning that VRPN connection is bad.

I am quite sure I am on the correct ip address and port. I am interfacing with optitrack and ros2.

Any advice ?

Thanks

alvinsunyixiao commented 10 months ago

Can you provide more detailed error traces? What is the exact error message you are seeing?

mandralis commented 10 months ago

Hi so I am seeing exactly the Warning: "VRPN connection is bad".

This occurs in client.cpp line 78: RCLCPP_WARN(this->get_logger(), "VRPN connection is bad");

I have setup optitrack to stream to the correct IP address and through the correct port, but I cannot get it to work...

I am working on foxy and built from source. I also previously tried installing directly from debian but both have the same behavior.

Thanks for your help !

alvinsunyixiao commented 10 months ago

There may be 2 IP addresses. Are you using the one setup in Motive or the IP address of the host machine (that is running Motive)?

mandralis commented 10 months ago

The IP address I am using is the IP of Motive. This works when using ROS1 with the original VRPN client.

alvinsunyixiao commented 10 months ago

Can you try setting the IP to be the host machine's local IP (dynamically allocated by the router) instead of the IP specified in Motive?

mandralis commented 10 months ago

I will try this tomorrow morning when I have access to opti-track again. Thanks for the help - I'll be in touch. I really need to get this to work - thanks for your work in making this possible !

mandralis commented 10 months ago

opti track is set to stream at IP X. I am setting the vrpn client to listen to the same IP X.

I can't debug this issue - any other ideas ?

Note: I am using ros foxy within a docker container - maybe this messes up things ?

alvinsunyixiao commented 10 months ago

The VRPN client should listen to the IP of the host computer. You can get this IP by running ipconfig in a windows terminal. From my experience, this IP is usually not the same IP as the one set in Motive.

mandralis commented 9 months ago

I managed to get it to work by using it outside Docker. We will have to figure out the appropriate settings to get this package to mesh well with docker. Thanks !

dnikitop commented 7 months ago

Running apt-get install netbase in the container adds the necessary /etc/protocols file to fix the vrpn_poll_for_accept: getprotobyname() failed error. Which I believe is the root cause of the problem. Make sure to run docker with --network=host as well.