ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_DDS: Support custom build server enabling DDS

Open Ryanf55 opened this issue 2 years ago • 9 comments

The custom build server has the ability to build custom firmware. Since users may want to add DDS support to their firmware, without compiling on their own computers, it is ideally added as an option to the custom firmware builder.

See the ArduPilot Dev Call 2023-03-20 notes for more info: https://docs.google.com/document/d/1DPtwTY-D-KeboL2WmKkYTOYxiZDSPSYEFVfH-kpkue0/edit#heading=h.kdoemjxcl7ua

See Tools/scripts/build_options.py

Ryanf55 avatar Mar 22 '23 01:03 Ryanf55

Hi, I read the source code of custom server. I wanted to confirm that just need to add just the appropriate entry in BUILD_OPTIONS, or are there changes need to be made under ardupilotwaf as well. Thanks

pulak-gautam avatar Jan 22 '24 00:01 pulak-gautam

Hi, I read the source code of custom server. I wanted to confirm that just need to add just the appropriate entry in BUILD_OPTIONS, or are there changes need to be made under ardupilotwaf as well. Thanks

Yep, please give that a try and see what happens.

Ryanf55 avatar Jan 22 '24 04:01 Ryanf55

@Ryanf55 I ran the custom build server locally with modified BUILD_OPTIONS, encountering a redefined error for AP_DDS_ENABLED. The back-end commands with verbose showed that waf is configured with -DAP_DDS_ENABLED=0 by default, unlike other libraries in the custom build server, causing a compiler warning. I attempted to locate where this flag is initialized but couldn't find it. Could you kindly give me some direction? Thanks

pulak-gautam avatar Jan 24 '24 13:01 pulak-gautam

AP_DDS_ENABLED

Yep! Right here: https://github.com/ArduPilot/ardupilot/blob/8c72304ab912b42d38bd3301fd964aaec7149e77/Tools/ardupilotwaf/boards.py#L85

By default, running ./waf configure --board sitl does NOT include --enable-dds, so the above if cfg.options.enable_dds evaluates to False, and DDS is not included.

Ryanf55 avatar Jan 24 '24 16:01 Ryanf55

The compiler is unable to recognize any definition of AP_DDS_ENABLED, even though it's clearly defined in hwdef.h generated by the custom build sever. Edit: Fixed by adding the missing includes similar to #26342

pulak-gautam avatar Feb 27 '24 09:02 pulak-gautam

The compiler is unable to recognize any definition of AP_DDS_ENABLED, even though it's clearly defined in hwdef.h generated by the custom build sever. Edit: Fixed by adding the missing includes similar to #26342

Can you contribute the fixes for those?

Ryanf55 avatar Apr 16 '24 00:04 Ryanf55

Can you contribute the fixes for those?

Hi, I am really sorry for the delay. I will be sure to put up a pull request with requested changes for this ticket by next week. The issues I mentioned earlier were fixed after I raised them on discord (#26405 #26342). I will be sure to make PRs if I face any similar hiccups.

pulak-gautam avatar Apr 19 '24 17:04 pulak-gautam

I have made a release here: https://github.com/ArduPilot/Micro-XRCE-DDS-Gen/releases/tag/v4.5.0

We should be able to use this binary in the setup scripts and thus no changes will be needed to the build server.

Ryanf55 avatar May 24 '24 17:05 Ryanf55