Simulation running slow, quarter real time
Gazebo with an empty world runs at 0.25x real time.
Gazebo with an empty world runs at 0.25x real time.
Other symptoms include:
The following code has 4 ms intervals
#include <sys/time.h>
#include <time.h>
#include <stdio.h>
main()
{
struct timeval tv;
struct timeval tv_old;
gettimeofday(&tv, NULL);
tv_old = tv;
while(1)
{
gettimeofday(&tv, NULL);
if (tv_old.tv_usec != tv.tv_usec)
{
printf("%ld %ld\n", tv.tv_sec, tv.tv_usec);
tv_old = tv;
// sleep 1 nano second
struct timespec nsleep;
nsleep.tv_sec = 0;
nsleep.tv_nsec = 1;
nanosleep(&nsleep, NULL);
}
}
}
##Solution
- Edit /etc/default/grub
and remove acpi=off
- sudo update-grub
- restart
also documented in issue #178, and patch to bypass clock when kernel resolution is too large is implemented in pull request #72.
I have the same problem too. The real problem is that it is not constant, i.e. it varies over time (the real time factor). Is there a way to set it as 1.0?
Just for clarification, this thread is just about a linux system configuration problem that causes the linux kernel to behave improperly when nanosleeping. The default behavior of Gazebo > 1.2 is to throttle to 1.0 realtime. Gazebo may still run slower than real time.
Asked: 2012-10-31 21:06:45 -0600
Seen: 554 times
Last updated: Nov 06 '12