NRP simulation appears non-deterministic?


#1

When I run my simulation, I get ‘random’ jerks of movement which do not repeat when I re-run the exact same simulation.
I am wondering if anyone knows where this ‘stochastic’ behavior could originate from and if anyone else are seeing something similar?

My system consists of a plugin, 3 NRP TF’s and a Gazebo model, all communicating through topics or Gazebo API.

Initially my system relied on the generic_controller_plugin to publish JointStates, without using the plugin for anything else.
However, after spotting a lot of stochastic behavior with that setup, I included the JointState publisher in my own plugin and removed my dependency of the generic_controller_plugin. This helped to some degree, but I still get the occasional jerk, without any indicators of its origin.

Thanks in advance

  • Jakob

#2

Dear Jakob,

There are different reasons explaining why simulations are not deterministic, see e.g., the discussion started here.
The jerks that you mentioned suggests yet another culprit: the threshold values used by gzbridge in order to skip pose updates when the “amount of motion is small”, see line 28 of $HBP/gzweb/gzbridge/ws_server.js.

Jerks can be observed when the 3D objects of interest have sizes which are significantly different, as small objects will be updated less often than larger one. These threshold values can be configured in the .exc file of your experiment folder, see e.g., $HBP/Experiments/cdp1_mouse/ExDMouseCDP1.exc and its gzbridgesettings.

Best regards,
Luc


Simulation quality, solver settings and jumpy motion
#3

Hi @lguyot,

Thanks a lot. I’ve copied the settings from the cdp1_mouse experiment and will check if they helped with the jerky motion.

As for the other discussion you referred to, I see that that ROS/Gazebo appear to be fundamentally non-deterministic with their message passing. I guess this makes sense for a system meant for real robotics but I wonder how to handle it.

Are there any NRP projects or other examples that are handling message synchronization between ROS/Gazebo and NRP TF’s?