PX4 Serial Receive Variable Data Length
6 views (last 30 days)
Show older comments
Hello,
I am currently trying to receive serial data from a UART&I2C Port in my simulink model. The data stream I am receiving has 6 signals with one singal being an iteration counter that increases from 1 - 1000. This means that the total character length of the serial pack is increasing as time progresses. I have no current way to alter the length of the transmission. When accepting signals that are longer than the prescribed length, valuable data is cut off. When accepting data that is shorter than the prescribed length, erroenous zeros are thrown in to the data making my signals have very jumpy time histories. The only time this system works is when the data is corrent length as specified in the serial receive PX4 block.
Is there a way for the PX4 Serial Receive block to handle a signal with a variable data length?
Furthermore, are there any work arounds with different serial receive blocks that can connect to the relevant ports on a Pixhawk 6x(dev/ttyS4)?
0 Comments
Accepted Answer
Ankur Bose
on 20 Feb 2025
Yes, The PX4 Serial receive has a checkbox in Advanced tab called "Output partially received data". When this parameter is enabled, the block outputs whatever is available on the buffer and the actual length of the received buffer. The serial blocks can operate across all ports of Pixhawk 6x. You need to mention the correct port name in the serial block
1 Comment
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!