flexbe_behavior_engine
flexbe_behavior_engine copied to clipboard
How to change the frequency of execution
the default frequency is 10 Hz. how to make it higher?
Doing a quick "grep -r "rate" ." from flexbe_behavior_engine, it looks as if the 10Hz is hard coded into flexbe_mirror.py and flexbe_core / operatable_state_machine.py
I'd try changing those values and testing. Eventually those should be parameterized.
I will note that given vagaries of Ubuntu OS and Python as an interpreted script, I would not count on FlexBE for high rate (e.g. 1kHz) safety checks. It is intended more for high level behaviors, but I suspect you can get reasonable performance if you increase toward 20, 50, maybe even 100hz. I have not tested this however. Please report back on your experience
If I write a publisher in execution loop, the topic will be published every 10Hz. As the tutorial said, the default periodically of execution is 10 Hz. That is far not enough for us. Is there no method that we can make it higher such as 1KHz?
Von meinem iPhone gesendet
Am 14.02.2019 um 16:06 schrieb dcconner <[email protected]mailto:[email protected]>:
Doing a quick "grep -r "rate" ." from flexbe_behavior_engine, it looks as if the 10Hz is hard coded into flexbe_mirror.py and flexbe_core / operatable_state_machine.py
I'd try changing those values and testing. Eventually those should be parameterized.
I will note that given vagaries of Ubuntu OS and Python as an interpreted script, I would not count on FlexBE for high rate (e.g. 1kHz) safety checks. It is intended more for high level behaviors, but I suspect you can get reasonable performance if you increase toward 20, 50, maybe even 100hz. I have not tested this however. Please report back on your experience
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/team-vigir/flexbe_behavior_engine/issues/68#issuecomment-463660866, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Alov49tpzr8pYwr5744CAL9MLT1xW81Yks5vNXuFgaJpZM4a7tZ4.
In those files I mentioned above, edit the Rate(10) and put it at what you desire .e.g. Rate(50).
I doubt 1kHz will give you consistent results, but try different values
It is actually possible to change the frequency of a state: Each state has an attribute called _rate, which is set to 10 by default as pointed out already.
To change it, simply assign a different value in the __init__ method of your newly implemented state, e.g.:
self._rate = Rate(50)