sloretz / sensors_for_ros

An Android app that publishes sensor and camera data on ROS 2 topics
78 stars 6 forks source link

Playing around with Fast-DDS and Bundles for Play store release #1

Open sloretz opened 1 year ago

sloretz commented 1 year ago

~~This is a work in progress towards compatibility with Android 13 With CycloneDDS on an Android 13 device I saw a bunch of avc events { read } with name "wireless". I assumed this was because CycloneDDS tries to read /proc/net/wireless. I don't see the same events on an Android 30 device. Communication works on the Android 11 device, but silently does not work on the Android 13 device.~~ Fixed on main.

With this I tried switching to Fast-DDS. It comes with a couple problems. The first is the code size is massive and the apk becomes 200Mb. The second is Fast-DDS requires two type supports (even rmw_fastrtps_dynamic_cpp does), so I can't use static linking and LTO to shrink it.

This still does not solve the communication problem on Android 13 device. I see a new avc event with Fast-DDS, although this time I see it on both the Android 11 and Android 13 devices. The communication behavior is the same: I can communicate with the Android 11 device but not the Android 13 device. This makes me think there's something else happening on the Android 13 device. Fixed on Main.

type=1400 audit(0.0:302): avc: denied { ioctl } for path="socket:[366356]" dev="sockfs" ino=366356 ioctlcmd=8927 scontext=u:r:untrusted_app:s0:c7,c257,c512,c768 tcontext=u:r:untrusted_app:s0:c7,c257,c512,c768 tclass=udp_socket permissive=0 app=com.github.sloretz.sensors_for_ros

Next idea: try holding WifiManager.MulticastLock and see if that allows communication? https://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock

sloretz commented 1 year ago

Problem is cyclonedds is selecting the wrong network. The Android-13 device has a valid sim, while the Android-11 device does not. It was selecting the mobile data network interface instead of the wireless interface. This will need to be configurable.