Skip to content

Add namespace support for uxrce-dds client during firmware upload #25291

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

Merged
merged 2 commits into from
Jul 25, 2025

Conversation

E-Krantz
Copy link
Contributor

Solved Problem

When working with PX4 firmware on hardware, I found it was not possible to set a custom namespace for the uxrce-dds client during firmware upload. This capability existed for SITL via the PX4_UXRCE_DDS_NS environment variable but was not available for hardware builds.

Fixes: No GitHub issue ID

Solution

  • Added support for setting a custom namespace for the uxrce-dds client in firmware builds, using the PX4_UXRCE_DDS_NS environment variable—bringing behaviour in line with SITL.
  • Updated build logic so that running
    PX4_UXRCE_DDS_NS=vehicle_1 make px4_fmu-v6x_spacecraft
    sets the namespace accordingly during firmware upload.

Note:
A make clean is required before building, to ensure dds_topics.h is regenerated in
build/px4_fmu-v6x_spacecraft/src/modules/uxrce_dds_client/dds_topics.h.

Changelog Entry

For release notes:

Feature: Add optional namespace specification for uxrce-dds client during firmware upload.

Alternatives

None.

Test Coverage

  • Tested firmware builds with and without a namespace value on Pixhawk-6X-mini.
  • Confirmed that the generated topics reflect the specified namespace.

Documentation

If this PR is accepted, I am happy to update the documentation to reflect the new firmware capability, which currently only describes namespace customisation for SITL.

Context

  • This change brings hardware builds to parity with SITL in terms of namespace configuration.

@dakejahl
Copy link
Contributor

This sets the namespace during build time though? I think it would be more useful to have this configurable as a parameter so that it doesn't require a rebuild of firmware

@dakejahl
Copy link
Contributor

Maybe we just need to resurrect this. I would use a unique param for namespace instead of the MAV_SYS_ID
https://github.com/PX4/PX4-Autopilot/pull/21536/files

@E-Krantz
Copy link
Contributor Author

I can add both alternatives as options, parameter and from terminal.

Copy link
Member

@beniaminopozzan beniaminopozzan left a comment

Choose a reason for hiding this comment

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

@E-Krantz , have you considered manually starting the client via custom startup script loaded in the SD card (assuming your hardware has a microSD card)?

In that way you don't need a custom build.

I understand that approach has its own drawback too though.

That said, this is a nice addition, thank you!

@E-Krantz
Copy link
Contributor Author

@beniaminopozzan Thank you for the suggestion. I had not considered that.
What I prefer with this approach is that it aligns with how namespaces are set up in SITL, and it's straightforward for anyone who is using make upload to flash the firmware.
Having more options is great though.

@beniaminopozzan
Copy link
Member

@dakejahl I just noticed the failing ci, do you know anything about it? I don't have access to a PC right now

@dakejahl
Copy link
Contributor

@dakejahl I just noticed the failing ci, do you know anything about it? I don't have access to a PC right now

clang-tidy randomly fails, it's a known problem

@Pedro-Roque
Copy link
Member

@beniaminopozzan @dakejahl shall we merge this one before we add the second option?

@dakejahl dakejahl merged commit 600c717 into PX4:main Jul 25, 2025
66 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants