How to record the drone state at 1000Hz? #3206
-
QuestionWhat's your question?How to record the drone state at 1000Hz? Include context on what you are trying to achieveI'm trying to track the response curve of an angular rate controller. Context detailsOS: Ubuntu 18.04 Include details of what you already did to find answersBefore the experiment I run this code to determine the minimum simulation interval:
The output of this code are either 0.0 or 3.0 ms, which is far away from my expectation. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @wangwwno1, Have you tried to change the simulation's ClockSpeed? I tried running your test code with ClockSpeed = 1 and ClockSpeed = 0.1 and there was a noticeable difference in the readings which means this might work for you. |
Beta Was this translation helpful? Give feedback.
-
I rewrite my code as:
And test it with ClockSpeed = 0.03333333333 (roughly as 1/30), the output is satisfied:
Update: The best result is ClockSpeed = 0.3333(1/3 with 4 digit precision) and 0.003ms in
For a simulation interval of 2.5ms, the best setting is ClockSpeed=0.8333 with an error of 0.0064% |
Beta Was this translation helpful? Give feedback.
-
So the conclusion is:
For example, with the ClockSpeed = 0.01(the minimum interval would be 0.3ms) and time interval in
The code is running but no advancement in timestamp, which means the simulation is "freezed". Would be very confusing as there is no warning or exception. Since the original question is solved, I will bring this discussion to another issue and close this one. |
Beta Was this translation helpful? Give feedback.
Hi @wangwwno1, Have you tried to change the simulation's ClockSpeed?
I would assume that slowing down the simulation would allow for more API calls per 'simulated second' (for a fixed real API call response rate).
I tried running your test code with ClockSpeed = 1 and ClockSpeed = 0.1 and there was a noticeable difference in the readings which means this might work for you.