Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

idle and control_loop function in Simulation #8

#1

In GLRealtimeProgram class, there is a function named idle and control_loop. However, idle is called at 50 Hz but control_loop is never called. Controller has higher rate than 50 Hz, how to set controller at higher rate?

  • replies 1
  • views 36
  • likes 2
#2

Quote from Kris' reply

idle() is called whenever your program is idle, and will handle simulation + GUI redrawing. control_loop() is just a convenient place to put control code, specifically (for example, if you want to switch your code to do command-line simulation). If you don't call control_loop in idle(), then it won't be called.

One tip: if you switch to using GLSimulationPlugin as your superclass, the simStep method automatically calls control_loop. You can step through the program with [space], toggle simulation on and off using 's', and you don't have to override idle.