Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mujoco Simulation is not running in real time. #217

Open
danielsanjosepro opened this issue Jan 7, 2025 · 0 comments
Open

Mujoco Simulation is not running in real time. #217

danielsanjosepro opened this issue Jan 7, 2025 · 0 comments

Comments

@danielsanjosepro
Copy link

danielsanjosepro commented Jan 7, 2025

Problem description

In the package cartesian_controllers_simulation the loop of the thread that runs mujoco is not running in realtime but much faster

 // Simulate in realtime
  while (true)
  {
    mj_step(m, d);

    // Provide fresh data for ROS2-control
    state_mutex.lock();
    syncStates();
    state_mutex.unlock();
  }

It needs a sleep command somewhere to really run in real time. The best choice would be to sync it with the ROS Clock.

@danielsanjosepro danielsanjosepro changed the title Mujoco Simulation is not running in Real Time Mujoco Simulation is not running in real time. Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant