ros_control update rate vs gazebo update rate

asked 2022-09-16 05:04:56 -0500

I'm working with the panda simualor package, which allows to simulate the franka panda manipulator in gazebo.

Due to the poor computational power of my machine, (7th generation Intel core i7 U series, 16 Gbs or ram, and I'm using a virtual machine...) I cannot run gazebo (version 11.11, ROS-noetic) with its default update rate of 0.001. Still, I am required to run the simulation with a real time factor of 1 because I should do real time telecontrol operations. So, I've modified the gazebo physics setup as follows:

<physics type="ode">                  

real_time_update_rate * max_step_size gives a real time factor of 1.

First problem, with these settings the panda robot starts moving randomly as soon as it spawn. I think the issue is with the PID control gain and/or gravity compensation (even though I have disabled gravity as advised in the panda simulator github docs). I have really no idea on how to tune PID values to make the robot stable again with the slower update rate, so any suggestion is truly welcome. Anyway, I don't think this forum is the right place to ask about that, since it may be more related to the panda robot itself.

Second problem, the control period of the manipulator model runs at 1KHz. How does gazebo manage this fact, since it only runs at 100Hz with my current settings? If I keep sending command at 1Khz, will I definitely lose 90% of my commands each second? Or there's a buffering mechanism which allows gazebo to execut every command anyway, just requiring more time to fullfil their execution? If the commands are lost, a possible solution could be to manually bufferize commands outside gazebo and sending them from the buffer with the proper frequency of 100Hz. Does this idea make sense?

Finally, if you know other strategies to make gazebo exploiting less CPU resources, they would be very helpful.

edit retag flag offensive close merge delete