Open zcase opened 2 months ago
The default sim/PyBullet frequency is 240Hz, the control frequencies in the examples are between 30 and 240Hz. For low-level control, one might want to increase both for better numerical accuracy but making the control frequency greater than the simulation frequency will result in inputs/controls/actions being computed more often than the simulation state is updated which is unlikely to be useful.
Hi,
Is it possible to set a lower control frequency, such as 2 Hz? I am currently working on an imitation learning task and need to collect demonstrations from users using the repository firstly. In my mind, I want to map some keys on the keyboard to discrete velocity values and user can choose one of them to press to change to drone's fly state. Considering the response time of humans, I believe setting the control frequency to 2 Hz is reasonable.
However, when I arbitrarily changed the value of DEFAULT_CONTROL_FREQ_HZ to 2 and ran pid_velocity.py, all drones fell to the ground.
I look forward to your reply. Thank you.
In principle you can (only updating the velocity set points at a more corse rate) but I see a couple of potential pitfalls
pid_velocity.py
examples (as they are created based on the control frequency)
https://github.com/utiasDSL/gym-pybullet-drones/blob/3d7b12edd4915a27e6cec9f2c0eb4b5479f7735e/gym_pybullet_drones/examples/pid_velocity.py#L96 VelocityAviary
that also is affected by this change https://github.com/utiasDSL/gym-pybullet-drones/blob/3d7b12edd4915a27e6cec9f2c0eb4b5479f7735e/gym_pybullet_drones/envs/VelocityAviary.py#L158
@JacopoPan in a previous issue thread you said:
A lot of the default values are set at 30. Is this 30 in hertz? Also is sim frequency in hertz?
To your knowledge is there a case were you would want ctrl_freq > sim_freq?