@James-Strawson Thanks for your reply! It made me realise what the error must be. We use a locally cloned repository for libmodalpipe because we want to build our software directly on the drone. This is then used in the build and link process of our software. This happened to be on the 'master' branch and not the 'SDK-1.0.0' branch. So the pipe clients use a different version than the pipe servers which is likely the cause of our errors.
Latest posts made by Tjark
-
RE: Possible bug in libmodal_pipe server.c
-
RE: mpa_to_ros node crashes after subscribing to /hires topics
I have the same issue. If you try it multiple times sometimes it will work but most of the times it will crash like shown.
-
RE: Possible bug in libmodal_pipe server.c
@James-Strawson I still haven't found the root cause but I wanted to share some of my findings. Maybe you can help my understanding. A little bit of background: we don't want to power off the drone but when we are not flying we go into a sleep state where we shut down some of the voxl programs and our own programs. Then when we wake up we start up the programs and everything should work again. It is after about 6 of these cycles where we have this issue (so it also takes a while to reproduce).
Here is some logging of where the problem just kicked in:
Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write to ch: 0 id: 14 result: -1 errno: 32 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write error: Broken pipe Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: previous client state was 2 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: Client voxl_pipe_handler-232508 (id 14) disconnected from channel 0 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write to ch: 0 id: 15 result: -1 errno: 32 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write error: Broken pipe Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: previous client state was 1 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: Client voxl_pipe_handler695511 (id 15) disconnected from channel 0 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: ERROR in pipe_server_write_to_client, client_id should be between 0 & 15 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write to ch: 1 id: 14 result: -1 errno: 32 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write error: Broken pipe Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: previous client state was 2 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: Client voxl_pipe_handler672850 (id 14) disconnected from channel 1 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write to ch: 1 id: 15 result: -1 errno: 32 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: write error: Broken pipe Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: previous client state was 1 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: Client voxl_pipe_handler507424 (id 15) disconnected from channel 1 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: ERROR in pipe_server_write_to_client, client_id should be between 0 & 15 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: ERROR in pipe_server_write_to_client, client_id should be between 0 & 15 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: ERROR in pipe_server_write_to_client, client_id should be between 0 & 15 Aug 19 20:15:14 QUAD voxl-vision-hub[1524]: ERROR in pipe_server_write_to_client, client_id should be between 0 & 15
voxl_pipe_handler
is our own program. When this was logged we weren't properly closing the pipe when our program was terminated so that could explain the write errors. But after handling that correctly, we still have the issue ofclient_id should be between 0 & 15
.A few questions. The id behind the client name seems to be a random number although the commit which adds the random number is after SDK-1.0.0. (https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/commit/b5fc28c9fc41184e0bbeee09c7f1867f9dbc1121). How is that possible? Did you deploy it well? This is the version we use:
QUAD:~$ apt show voxl-vision-hub Package: voxl-vision-hub Version: 1.6.6 Priority: optional Section: base Maintainer: James Strawson <james@modalai.com> Installed-Size: unknown Provides: voxl-vision-px4 Depends: librc-math,libmodal-pipe(>=2.4.0),libmodal-json,voxl-mpa-tools(>=0.2.5),voxl-mavlink-server,libmodal-cv(>=0.3.1) Conflicts: voxl-vision-px4,voxl-mavlink-server(<<1.0.0) Replaces: voxl-vision-px4 Download-Size: 88.4 kB APT-Manual-Installed: yes APT-Sources: file:/data/voxl-suite-offline-packages ./ Packages Description: main hub managing communication between VOXL MPA services and autopilots
In https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/blob/master/library/src/misc.c?ref_type=heads#L168, I think you're taking the modulo of a possible negative number. The modulo can then also be a negative number (https://stackoverflow.com/questions/7594508/modulo-operator-with-negative-values) so your result is not within the specified range. See also the logging above containing a negative number.
I think that reconnecting a pipe with the same name makes that a new client id is used, possibly due to the random number in the name and then no two client names will be the same. I also saw that you changed something in that part of the code in this commit: https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/commit/773de63cb73000c08df1b04bc4e2f1e78e700816 Do you think that that could be the case? I will try to test that.
-
Possible bug in libmodal_pipe server.c
I was looking through the libmodal_pipe code because we have some issues with an error
ERROR in pipe_server_write_to_client, client_id should be between 0 & 15
and I'm not sure what is causing this. We are restarting voxl programs often and I think something goes wrong with connecting/disconnecting pipes but I haven't figured it out yet.But when I looked through the code I saw that here all file descriptors are closed: https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/blob/master/library/src/server.c?ref_type=heads#L1611. But a few lines above that (https://gitlab.com/voxl-public/voxl-sdk/core-libs/libmodal-pipe/-/blob/master/library/src/server.c?ref_type=heads#L1568),
c[ch].n_clients
is set to0
so I think the code at line 1611 isn't doing anything. I don't know if it gives problems and it is probably not related to my problem but I wanted to point it out to you. -
RE: Connect RC controller with SDK 1.0.0/PX4 1.14
@Eric-Katzfey thanks for the update, although it is a pity since it used to work. Do you have an idea when support will be added again?
-
RE: Most VOXL 2 hires-capable camera ports nonfunctional after SDK 1.0 flash
@brycek That's great!
@Modalai could you still answer the question if this is a good way of handling this?
-
RE: Can't install ros-melodic-tf2-geometry-msgs with voxl-suite 1.0.0
@ModalAI could you answer this question?
-
Connect RC controller with SDK 1.0.0/PX4 1.14
We are trying to get a drone working with SDK 1.0.0 but we are unable to get a RC controller properly connected. It worked with SDK 0.9.5.
We have a RadioLink RC controller connected to the VOXL2 IO board similar to the Graupner setup: https://docs.modalai.com/voxl2-io-user-guide/#using-sbus-graupner-gr-16 but we don't get RC signals through in QGroundControl. This topic seems to suggest that the VOXL2 IO board is not yet supported for SDK 1.0.0 but that is for an ESC: https://forum.modalai.com/topic/2429/voxl2-io-m0065-support-on-px4-1-14-in-sdk-1-0-0. Should it be possible to connect our RC with VOXL2 IO?
-
RE: Most VOXL 2 hires-capable camera ports nonfunctional after SDK 1.0 flash
@brycek We had the same issue but we managed to get it working. We have the following setup with 3 cameras:
Camera name: hires2
Camera type: imx412
Camera id: 0
Camera slot: 2Camera name: hires
Camera type: imx214
Camera id: 1
Camera slot: 3Camera name: tracking
Camera type: ov7251
Camera id: 2
Camera slot: 4We added an extra option to
/usr/bin/qrb5165-configure-cameras
:17) # Hires(imx214) + Hires2(imx412) + Tracking(ov7251) CAM_LIST+=("hires2:imx412:0") CAM_LIST+=("hires:imx214:1") CAM_LIST+=("tracking:ov7251:2") BIN_LIST+=("/usr/share/modalai/chi-cdk/ov7251/com.qti.sensormodule.ov7251_4.bin") BIN_LIST+=("/usr/share/modalai/chi-cdk/imx412/com.qti.sensormodule.imx412_2.bin") BIN_LIST+=("/usr/share/modalai/chi-cdk/imx214/com.qti.sensormodule.imx214_3.bin") ;;
So the camera name, type and id are used in the
CAM_LIST+=
part and the camera type and the camera slot are used in theBIN_LIST+=
part.Then we can execute
voxl-configure-cameras 17
which places the camera drivers in the correct places and creates a defaultvoxl-camera-server.conf
file. Then when we dovoxl-camera-server --list
, all the cameras will appear.Also small note that you need to update the file
/usr/bin/qrb5165-print-camera-configs
if you want the option to be shown when executingvoxl-configure-cameras --help
@ModalAI, is this the correct way to approach this or is this not recommended because problems are expected when using it this way?
@brycek I think you can adjust it to match your situation