-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
publish vehicle rates setpoint topic #24262
base: main
Are you sure you want to change the base?
Conversation
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 264 byte (0.01 %)]
px4_fmu-v6x [Total VM Diff: 248 byte (0.01 %)]
Updated: 2025-01-28T16:09:42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that it is useful for some applications, e.g. to smoothen the hand-over from a PX4-internally controlled flight mode to an external one that is interfacing over rate/thrust setpoints.
@beniaminopozzan anything to add from your side?
@sfuhrer given the quite high rate of the topic I'd double check that the overall PX4 TX rate isn't getting too high in particular when serial connection is used. Last time I checked the client was sending all messages to the agent even if the topics had no subscribers. |
Good point. How do you check the TX rate load? And how is it again, is the message sent to ROS whenever there is a uORB topic publication? Alternatively we could consider |
The PX4-Autopilot/src/modules/uxrce_dds_client/uxrce_dds_client.cpp Lines 904 to 908 in 96105ca
Even if there is no subscriber in the ROS 2 network the TX value will remain non-zero. |
Behaviour in sim pre-pr: pxh> uxrce_dds_client status
INFO [uxrce_dds_client] Running, connected
INFO [uxrce_dds_client] Using transport: udp
INFO [uxrce_dds_client] Agent IP: 127.0.0.1
INFO [uxrce_dds_client] Agent port: 8888
INFO [uxrce_dds_client] Custom participant: no
INFO [uxrce_dds_client] Localhost only: no
INFO [uxrce_dds_client] Payload tx: 75298 B/s
INFO [uxrce_dds_client] Payload rx: 0 B/s
INFO [uxrce_dds_client] timesync converged: true
uxrce_dds_client: cycle: 10008 events, 33620000us elapsed, 3359.31us avg, min 0us max 8000us 3433.727us rms
uxrce_dds_client: cycle interval: 10009 events, 3358.98us avg, min 0us max 8000us 3433.556us rms post pr: pxh> uxrce_dds_client status
INFO [uxrce_dds_client] Running, connected
INFO [uxrce_dds_client] Using transport: udp
INFO [uxrce_dds_client] Agent IP: 127.0.0.1
INFO [uxrce_dds_client] Agent port: 8888
INFO [uxrce_dds_client] Custom participant: no
INFO [uxrce_dds_client] Localhost only: no
INFO [uxrce_dds_client] Payload tx: 78578 B/s
INFO [uxrce_dds_client] Payload rx: 0 B/s
INFO [uxrce_dds_client] timesync converged: true
uxrce_dds_client: cycle: 14090 events, 41616000us elapsed, 2953.58us avg, min 4000us max 8000us 2689.561us rms
uxrce_dds_client: cycle interval: 14091 events, 2953.37us avg, min 0us max 8000us 2689.465us rms It is not that bad tbh |
@beniaminopozzan Thank you for your review and testing! I have just checked the topic frequencies inside a dockerized external mode and they're indeed published at a very high rate and even in absence of a subscriber:
If you find the data rate increase still okay, I actually would like to proceed with the PR. In parallel checking options to avoid this topic to be a necessity on the external mode side. |
@beniaminopozzan The message rate of the simulation and the hardware might be different and therefore the implication. I would be a bit mindful on publishing high rate streams by default which people rarely use. The dds topic yaml is supposed to be user configurable :) |
Solved Problem
This PR adds the
vehicle_rates_setpoint
under published dds topics. ROS2 applications can with this change subscribe to thrust and rate setpoints.Expected terminal output:
Fixes #{Github issue ID}
Solution
Changelog Entry
For release notes:
Alternatives
We could also ...
Test coverage
Context
Related links, screenshot before/after, video