How to use QGroundControl to update parameters in pixhawk simulink model

9 次查看(过去 30 天)
Hi,
We have been using the Pixhawk Toolbox to develop my quadcopter model. We have been very successful at compiling, uploading, and running the current simulink examples. We have been successfully running our own model. We further found out that we can actually run Mavlink to monitor and record sensor data as well as other published Uorb topics in QGroundControl. Our model uses the pixhawk CSC parameters in storage successfully. We tested this in external mode, showing the outputs of the storage class in a display block.
QGroundControl has the ability to send update parameters to the Pixhawk but unfortunately the model can not grab the latest parameters. The only process that works is to upload the parameters from QGroundControl, connect to Nutt Shell, issue a "save param" command and then "reboot" command. The model will then grab the new store parameters on reboot. I have tried to get the simulink model to grab the current parameters during the upload process by:
  1. Setting the MC_ROLLRATE_P to a tune-able parameter
  2. Initializing the parameter in the InitFcn* callback,
  3. Using the same command from the InitFcn* in the ContinueFcn
  4. Using a sample time on the simulink storage class block
I have tried setting the tunable parameter as:
  1. ExportedGlobal
  2. SimulinkGlobal
  3. ImportedExtern
  4. ImportedExternPointer
I have theorized a process which I use the Uorb Topic listener to listener to the parameter_update topic for parameter updates and then initialize a function to which will attempt to call the latest parameters. The problem with this plan is that I am unsure about the "param save" command. Currently, if I upload a saved parameter file from qgroundcontrol, I get a warning stating that there was an error saving the parameters. I am however able to check that the parameters have been uploaded via nuttshell. It is worth noting that the parameters are stored BUT NOT saved as denoted by the * in nuttshell param list command.
The guide has been extremely helpful. We have been able to successfully write to Uorb Topics and see published updates in QGroundControl over telemetry. We ultimately chose to use the Mavlink route because the simulink data over telemetry demo was extremely buggy and unreliable to even visualize data. The Mavlink system has been flawless thus far.
We have played with different versions of QGroundControl but currently use the v3.2.5 release on Windows.
I hope this message reaches the PSP developers, I posted here to allow others hopefully chime in for ideas.

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by