alvinsunyixiao / vrpn_mocap

MIT License
18 stars 8 forks source link

Update Frequency fixed at 60Hz #10

Open Joao-G-Martins opened 6 months ago

Joao-G-Martins commented 6 months ago

Hello!

Congratulations on implementing the vrpn client for ros2. I was able to get it working with our system, but the update frequency was stuck at 60Hz, even with the camera refresh rate being at 360Hz or changing the value of the update_freq parameter.

I checked the code and didn't find the reason why it is happening, since a timer use this parameter. Do you have any clue what might be the problem? Have you faced this issue before?

alvinsunyixiao commented 6 months ago

Could it be that your motion capture device is running at 60Hz? The update_freq param determines how fast a VRPN tracker calls it's main loop function. However, it may not trigger a pose publisher every time the main loop gets called. For example, if your motion capture device runs at 60Hz, even if you have update_freq set to 200Hz, the actual publishing frequency is still approximately 60Hz.

aditya-penumarti commented 6 months ago

I have a similar problem. Setting the cameras to 120Hz and setting the update_freq to 100Hz does not translate to the nodes. They still run at 60Hz. I'm using an Optitrack Setup with the motive software.

Joao-G-Martins commented 6 months ago

Could it be that your motion capture device is running at 60Hz? The update_freq param determines how fast a VRPN tracker calls it's main loop function. However, it may not trigger a pose publisher every time the main loop gets called. For example, if your motion capture device runs at 60Hz, even if you have update_freq set to 200Hz, the actual publishing frequency is still approximately 60Hz.

@alvinsunyixiao no. I even changed the camera's output rate and there wasn't any change in the output rate, it was always at 60Hz.

aditya-penumarti commented 1 month ago

@alvinsunyixiao I was testing this again, and I've noticed if I change the mocap rate on the cameras (using OptiTrack Motive) to less than 60Hz the rate in ROS does change. But if I change the parameter in ROS to less than 60Hz, the node does not respond.

Ex. Motive Publishing at 240Hz, vrpn_mocap parameter at 20.0, ros2 topic hz shows 60Hz.