How to accelerate a simulated robot and get the same result as when I use real time factor?
Hi all,
I have a robot (any body), which I can control through a Twist message. Let's say I put the robot in position (0,0) with world as reference. From my code, I publish a topic which makes the robot moves at 1 m/s during 1 second, like:
rostopic pub -1 /cmd_vel geometry_msgs/Twist '{linear: {x: 1.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}'
So, after a second I publish another topic like:
rostopic pub -1 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}',
to stop the robot. This is successful and the robot moves 1 meter forward (to position 1,0).
The problem is that the robot must move a lot of times to cover an area (thousand of movements). So I want to accelerate the simulation with the physics include (to check collisions). But, if I modify the real time factor to 0, to be as faster as possible, of course the robot moves faster but the same published messages will make the robot moves further than (1,0). So the result of Twist messages will be different.
I would like to know if there is a way to accelerate the simulation, in an independent way of the commands I send: So if I have, let's say, 100 messages published to make the robot moves forward, the robot will delay 100 seconds to move 100 meters. With these same messages parameters, I would like to know If I can accelerate the simulation to shorter times.
PD: I decreased the time for which I stop the robot. So I can have a movement of 100 m/s during 0.01 seconds. But the same as before happens. If I modify the real time factor, the robot moves really faster (which is what I want), but with different result as if I use the real time factor set to normal time. Instead of moves 100 m, it moves 120/130 or different things.
I really appreciate your help
Thank you