Compiling Arducopter-4.5.0 with enable-dds failed

First, I want to ask how to clean the ardupilot build on the linux. I only found waf (clean, distclean, submodule-force-clean). I tried all those and removed the whole folder. After that, I did git clone the ArduCopter 4.5 version. I can build the sitl. But, when building with enable-dds option, I got those errors. Does anyone know how to solve this? Any advices will be deeply appreciated!!




(PS. I can use the DDS with the beta version from github.)

Hi @wntun,

Thanks for giving the DDS feature a try.

So I guess youā€™re trying to build using these commands:

  • cd ardupilot
  • ./waf configure --board ?? --enable-dds
  • ./waf copter

FYI @rhys @rfriedman

@rmackay9 Yes, I tried following

  • cd ardupilot
  • ./waf configure --board sitl --enable-dds
  • ./waf copter
    Thanks. Please help me.

Hi @wntun,

ā€¦ and of course youā€™ve fallowed the instructions here.

Iā€™ve pingā€™d Rhys and RyanF above so I think they will respond.

Hi, @rmackay9
I found the problem line (#90 in ardupilot/libraries/AP_DDS/wscript)
The microxrceddsgen doesnā€™t know this -replace -default-container-prealloc-size. So, I replaced that with the line from the latest one I downloaded from the github in Feb.

gen_cmd = f"{bld.env.MICROXRCEDDSGEN[0]} -cs -replace -d {dst_dir} -I {idl_include_path} {idl}"

Now, I can compile the code with enable-dds option. I hope it wonā€™t make any changes to the other modules.
Thank you so much!!!

1 Like

You could also pull the latest MicroXRCEDDSGen and rebuild the tool. We had new changes in that repo in the past month. Hereā€™s the PR that required it.

3 Likes

Both versions of microxrceddsgen will work with the previous gen_cmd in the wscript, the new version uses much less RAM, so is the preferred option.

1 Like

@rfriedman @rhys,

Excuse my ignorance in this area but are there any code or wiki updates that we need to make based on this discussion?

Iā€™m sorry if this is off topic. I donā€™t know where to post it.
Yesterday we went out for field test. At the office, I tested that DDS connection from the ardupilot to the ROSs was working fine and could see the ROS2 topics related to the ardupilot. Then, at the actual field test, the DDS was not working. I used this command. I checked that serial2_protocol and serial2_baud at Mission Planner and they are right.

MicroXRCEAgent serial -b 115200 -r /home/taekyung/Workspace/dds_xrce_profile.xml -D /dev/serial0

We restarted the drone (FC and raspberry pi) a few times, but the DDS didnā€™t work. There is no errors showing, but we got no topic related to the ardupilot. When we were back to the office, I tested it works again. So, we couldnā€™t find the source of this problem.
Do you have any idea for that? Please.

The AP_DDS README does contain a link to the correct version of microxrceddsgen to install, however as this is not a submodule, and is not updated as part of the build, previously installed versions will not be correct.

Not sure the best way to handle this, we could add an extra note to the readme to highlight the change, but it points to a longer term problem of how to ensure users keep the tool current.

How were you checking the ROS topics in the field? Was it on a monitor connected to the pi or via a separate base station computer. If it was a base station was it connected to the pi by ethernet cable or by wifi

DDS can perform poorly over some wifi networks, so you may see messages from the pi on a base station computer in a lab, but not in the field.

1 Like

Just for admin purposes Iā€™m going to consider this issue closed on the Copter-4.5.0 issues list. Please tell me if Iā€™ve got this wrong though.

There is no known issue other than we donā€™t have a good workflow for ABI breaks with the external tool of microxrceddsgen. Once binaries are out for all of the dependencies, it should get a lot easier for users. Till then, users should be pulling code regularly and rebuilding when it changes.

1 Like