-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
uXRCE - Allow to set the uORB polling rate per subscription #23473
base: main
Are you sure you want to change the base?
Conversation
We really need to introduce some runtime configurability here, by default we probably shouldn't be sending things at high rates. |
For the particular problem you want to solve would it work if we exposed an overall max rate as a PX4 parameter? |
A PX4 Parameter would work too, but doesn't it make sense to have those (rates, topics, default rate) together? |
I have just tried this, but I have the problem of having the parameter available when needed. The yaml data is used to initialize the subscribers structs, at a time we do not have access to the parameters yet. PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.h.em Lines 50 to 63 in 149963d
Another way would be to initialize the struct in the init function systematically, and still have access to the python generator data. This loop would then be unrolled and the precedent snippet effectively within PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.h.em Lines 74 to 80 in 149963d
A last method would be to use a magic number, such as
|
149963d
to
9b3d418
Compare
@dagar could you take a look? |
db0597f
to
2669f5a
Compare
2669f5a
to
d63fa78
Compare
Rebased on main |
3c54839
to
cacb74b
Compare
Change max_rate_hz to a float. Set 0Hz as a disabled topic.
cacb74b
to
109c09f
Compare
Solved Problem
Having a configurable polling rate can have 2 usages:
The main issue with latency is if we have a 100Hz topic with a 10ms interface, which means we will get a systematic delay between [0-10ms] which is different for each run.
This is especially important to have little/limited delays when using external control modes such as with Auterion/px4-ros2-interface-lib
Solution
max_rate_hz
parameter to thedds_topics.yaml
filedefault_max_rate_hz
parameter to thedds_topics.yaml
file or set it to 100max_rate_hz
parameter or the default rateChangelog Entry
For release notes:
Alternatives
We could make the default interval as a PX4 parameter, but that impacts every topic. Not all topics needs a low polling interval.
Closes: #21716
Closes: #21997