Termination error when using Mavlink blocks for PX4

I have a model to send/receive telemetry/commands to and from Pixhawk 4. I'm using mavlink blocks (blank message and serializer). But, I can't deploy or monitor tune the model. I get "termination compilation include< algorithm> " error. Can someone tell me what is wrong with my model?

1 comentario

Ali,
I noticed in one of your below comments you were able to successfully send back data via Serial to your ground station and read it. Would you mind elaborating on your setup that allowed you to send data back in this manner?

Iniciar sesión para comentar.

 Respuesta aceptada

Arun Mathamkode
Arun Mathamkode el 5 de Abr. de 2022
Based on my understanding, using MAVlink blocks in Pixhawk is not a logical usecase. PX4 already have 'mavlink' module which can encode and decode data and stream it through different serial interfaces of Pixhawk. The main usecase of MAVLink blocks is to use it on Host PC or on companion computer to read/write MAVLink messages. uORb messages are the way to communicate between different modules in PX4. Please refer to PX4 Architecture and uORB graph more more details. I would recomment you to enable the MAVLink stream on any specific serial interface you want to use, and PX4 will take care of encoding the MAVlink data and send it over that specifc interface. You can consider to use MAV_X_CONFIG parameter to enable MAVLink Telemetry. As per PX4 documentation, MAVlink is defaulty enabled over TELEM1 (MAV_0_CONFIG).

5 comentarios

Thanks Arun,
In my previous model, i used simple serial communication. I could send telemtry from Pixhawk to groundstation model without any problem. But, when i try to send commands/data from groundstation to Pixhawk, I can't receive data in a right format. One of the reason could be that the serial receive block of PX4 doesn't accept header and terminator. So, the data that i'm receiveing is mixed. Do you have any suggestion for that?
(I want to send Vicon position reading from grounstation to Pixhawk)
In that case may be you can consider using, Protocol Decoder block with PX4 Serial receive block. In this block you have the option to specify the header and terminator. Currently It ships with Arduino Support package and you need to install Arduino support package to use the block. Its a generic block so you can use it with PX4 as well. This block is only available from R2021b.
Thanks Arun,
Please find the attached screenshot of my simulink model.
I get an error that i don't understand. Could you help me to solve it?
Protocol Decoder block works on a regular simulink model. But it can't be deployed to PX4.
Ideally it should have worked as it is a generic block. Its just a workaround I thought, probably there might some issues. Thanks for the inputs.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2021a

Preguntada:

el 4 de Abr. de 2022

Comentada:

el 7 de Ag. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by