Skip to content
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

AP_DDS: Support compile-time configurable rates for each publisher #28434

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

Ryanf55
Copy link
Collaborator

@Ryanf55 Ryanf55 commented Oct 19, 2024

Instead of hard-coded rates, allow devs to set the rates at compile time for their specific application. Rates are left the same as before, so this is reverse compatible.

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Oct 19, 2024

FYI @tizianofiorenzani I thought you might like this.

Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
Copy link
Contributor

@srmainwaring srmainwaring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ryanf55 Looks ok - backwards compatible.

Is the intention for the override to be set in a custom hdef.dat, or on the ./waf build line? Perhaps add an example usage to the README?

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Oct 21, 2024

@Ryanf55 Looks ok - backwards compatible.

Is the intention for the override to be set in a custom hdef.dat, or on the ./waf build line? Perhaps add an example usage to the README?

Either will work. I have a wiki I'm working on for compile time configuration and will add specifics there.

@Ryanf55 Ryanf55 added the WikiNeeded needs wiki update label Oct 21, 2024
@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Oct 24, 2024

Here's my favorite way:

Add a HWDEF file in ardu_ws/src/ardupilot/dds_custom_rates.dat with contents:

AP_DDS_NAVSATFIX_PUB_ENABLED 0

Build

colcon build --packages-select ardupilot_sitl --cmake-args -DARDUPILOT_WAF_CONFIGURE_ARGS="--extra-hwdef=dds_custom_rates.dat" --event-handlers=console_direct+

Launch

source install/setup.bash
ros2 launch ardupilot_sitl sitl_dds_udp.launch.py

I also tried sim_vehicle.py

./Tools/autotest/sim_vehicle.py -v ArduPlane  --console --enable-dds --waf-configure-arg="--extra-hwdef=dds_custom_rates.dat"

Sadly, none of these seem to affect the behavior. After talking to sid, he shared that the extra-hwdef is not used for SITL.

The way you can change any define (for SITL) when config is like so:

./waf configure --board sitl --define="AP_DDS_DELAY_GPS_GLOBAL_ORIGIN_TOPIC_MS=5000" --enable-dds

Or with sim_vehicle.py

./Tools/autotest/sim_vehicle.py --configure-define="AP_DDS_DELAY_GPS_GLOBAL_ORIGIN_TOPIC_MS=5000" --enable--dds

Or with colcon

colcon build --packages-select ardupilot_sitl --cmake-args -DARDUPILOT_WAF_CONFIGURE_ARGS="--define=AP_DDS_DELAY_GPS_GLOBAL_ORIGIN_TOPIC_MS=5000" --event-handlers=console_direct+

@peterbarker peterbarker merged commit 72f0ecc into ArduPilot:master Oct 24, 2024
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ROS WikiNeeded needs wiki update
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants