How to set Payload Parameters for the 'PARAM_SET' and 'PARAM_REQUEST_READ' MAVLink message blocks

2 Ansichten (letzte 30 Tage)
Hello,
I am having issues trying to set a specific parameter using the MAVLink Blank Message block ('PARAM_SET') in Simulink and reading that parameter using the MAVLink Deserializer block ('PARAM_VALUE'). I am currently communicating with PX4.
Any assistance with this would be much appreciated.
  1 Kommentar
Ashok
Ashok am 26 Aug. 2024
Bearbeitet: Ashok am 26 Aug. 2024
Hey Nikhil
Could you further describe the issue in detail and also share the related MATLAB/Simulink fles?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Swastik Sarkar
Swastik Sarkar am 30 Aug. 2024
Bearbeitet: Swastik Sarkar am 30 Aug. 2024
Recreating the Simulink model is essential for diagnosing and resolving issues related to hardware interaction and parameter settings. The absence of necessary hardware affects the ability to fully replicate the model. Consequently, some lines remain unconnected in the attached Simulink model, allowing for direct connection of the serial communication blocks.
It appears that the model attempts to set a parameter using the PARAM_SET message block and retrieve the onboard parameter value. The PARAM_SET block will send an acknowledgment as a PARAM_VALUE message. Ensure that the correct system and component IDs are being listened to, as specified in the PARAM_SET. If new messages do not appear on the PARAM_VALUE block, reducing the simulation speed to improve interaction with the hardware I/O may be necessary. This can be achieved using the Run with I/O simulation mode after connecting the I/O. Additionally, incorporating a delay in the system design to allow for a pause before continuing execution might be required. Refer to below example to properly configure the model for execution:
For more information on Run with I/O simulation in Simulink:
If the attached model does not function as intended, consider sharing the Simulink model to facilitate issue reproduction and resolution.
To obtain the onboard parameter value, utilize the PARAM_REQUEST_READ message, which will transmit the data as a PARAM_VALUE message to the listener.

Community Treasure Hunt

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

Start Hunting!

Translated by