I’m trying to set up interoperability between the uxrce_agent and zenoh_bridge_ros2dds.
The problem: PX4 topics have INVALID topic type hash and BEST_EFFORT QoS. The zenoh_bridge_ros2dds bridge detects the PX4 topics, but data from them does not flow through the bridge into Zenoh — even though the keys are created and can be subscribed to.
However, if I start publishing my own messages to any PX4 topic with QoS=BEST_EFFORT, I begin receiving both my messages AND the messages sent by the flight controller in Zenoh. If QoS != BEST_EFFORT, I only see my own messages in Zenoh.
As I understand it, the CycloneDDS instance bundled inside zenoh_bridge_ros2dds is discarding data from PX4 topics. I tried configuring CycloneDDS via an XML file, but apparently the latest bridge version uses CycloneDDS 0.10.x, while the parameter I need — //CycloneDDS/Domain/Compatibility/IgnoreTypeInformation — seems to be available only in 0.11.x.
Are you aware that PX4 has native Zenoh support built in? Since v1.17, there’s a zenoh module using Zenoh-Pico that runs directly on the FMU and talks to a Zenoh router without going through DDS at all.
Yes, I’ve heard about that approach, but I read that Zenoh-Pico in PX4 currently only works over Ethernet. Or am I mistaken? My flight controller doesn’t have Ethernet capability yet, unfortunately. So I thought that it’s not for me yet.
If I can’t get the bridge working, I’ll probably start exploring that direction anyway.
At our lab, we were trying out the zenoh module with the latest v.1.17.0-rc2 version on a Holybro Pixhawk 6X, but didn’t have any success connecting it with the companion PC over Ethernet. The companion was pingable and it seems the zenoh module discovered the rmw_zenohd but shortly after we started the zenoh module via MAVLink Shell, the system crashed and indicated that by beeping. QGrundControl was showing that there is a crash dump (see attached pdf).
@rroche I was wondering if the dev team encountered that crash after enabling the zenoh module as well? I’ve followed the documented steps for setting it up.
I appreciate any help since I’m really clueless on what to do to get it to work.
The error occurred when PX4 was disarmed (so no ulog file) and the zenoh client was started manually via MAVLink Shell. We tried arming PX4 and then starting zenoh. We downloaded the ulog after system crash and automatic reboot. I cannot upload the file here, where should I post it?
So I’m coming back on this @rroche (we should probably move this to a different place) because I cannot register a custom mode from ROS 2 Jazzy using zenoh. It seems that nothing is published through /fmu/out/register_ext_component_reply. Here is the topic info
This is the default subscriber using px4-ros2-interface-lib. I’ve also tried matching the QoS exactly but that didn’t make a difference: Nothing is coming from PX4.
Other topics like /fmu/out/sensor_combined seem to be fine.
So the problem turned out to be that custom modes are not supported in builds using the CONSTRAINED_FLASH toolchain flag (as px4_fmu-v6x_zenoh is using). My workaround for now is to disable the gimbal module. With that modification I’m able to upload (barely) to Pixhawk 6X:
[1737/1740] Linking CXX executable px4_fmu-v6x_zenoh.elf
Memory region Used Size Region Size %age Used
ITCM_RAM: 0 B 64 KB 0.00%
FLASH: 1959580 B 1920 KB 99.67%
DTCM1_RAM: 0 B 64 KB 0.00%
DTCM2_RAM: 0 B 64 KB 0.00%
AXI_SRAM: 105756 B 512 KB 20.17%
SRAM1: 0 B 128 KB 0.00%
SRAM2: 0 B 128 KB 0.00%
SRAM3: 0 B 32 KB 0.00%
SRAM4: 2 KB 64 KB 3.12%
BKPRAM: 0 B 4 KB 0.00%
[1739/1740] uploading px4
But it seems to be quite an effort to backport. Would be the right direction though.
EDIT AGAIN:
Even when successfully flashed, the mode manager in PX4 1.17 seems to cause a spike in RAM usage which leads to PX4 silently crashing or at least not responding. So even without CONSTRAINED_FLASH (which does bring back a reply when registering custom PX4 modes from ROS 2 using px4-ros2-interface-lib), I’m not able to successfully execute my custom mode. The custom mode crashes a few seconds due to no heartbeat from PX4.
When streaming dmesg in parallel, I can see that PX4 briefly reports “high RAM usage: 8800%” (ish).
I’ve switched to using the MicroXRCE-DDS Bridge again, since zenoh seems not usable for custom PX4 modes at the moment. Am I missing something? Is anyone having the same issue?