How To get multiple mission plan from Q ground control for UAV package delivery example?

2 次查看(过去 30 天)
I wanted to have multple mission plan from QGC block, so that I can simulate multiple UAVs in the same simulation 3D environment.
  2 个评论
Abhishek Singh
Abhishek Singh 2022-7-8
i am trying to modify the UAV package delivery example - https://in.mathworks.com/help/uav/ug/uav-package-delivery.html, where there is a MavLink interface block which is communicating with QGC. I am able to get mission plan for one UAV from Qgroundcontrol and receive the feedback of current state of UAV to Qgroundccontrol.
But, I want to simulate multiple UAVs, each getting it's unique mission plan from QGC; also, receive the feedback of the states of these multiple UAVs in Qgroundcontrol
Vedant Dubey
Vedant Dubey 2023-8-31
编辑:Vedant Dubey 2023-8-31
Hi Abhishek,
Based on the previous suggestion, have you tried using different system IDs on MAVLink deserializer and serializer blocks. Each system ID can correspond to a specific drone.
When you mentioned the below statement:
"But, I want to simulate multiple UAVs, each getting it's unique mission plan from QGC; also, receive the feedback of the states of these multiple UAVs in Qgroundcontrol"
Where specifically are you facing issues? Are you looking for guidance on how to model multiple UAV dynamics or you are unable to see the multiple UAVs in QGC.

请先登录,再进行评论。

回答(1 个)

Jianxin Sun
Jianxin Sun 2022-6-28
移动:Remo Pillat 2023-10-1
Hi Abhishek,
Are you planning to connect to multiple UAVs at the same time in MATLAB/Simulink and obtain their missions?
As long as each UAV you connect to has a unique system ID, you should be able to distinguish them with the MAVLink message he receives. A sample code would look like:
mavlink = mavlinkio("common.xml");
connect(mavlink,"UDP");
uav1 = mavlinkclient(mavlink,1,1);
uav2 = mavlinkclient(mavlink,2,1);
% sub1 only receives message from uav1
sub1 = mavlinksub(mavlink, uav1, NewMessageFcn=@(~, payload)display(payload));
% sub2 only receives message from uav2
sub2 = mavlinksub(mavlink, uav2, NewMessageFcn=@(~, payload)display(payload));
% specify client when sending mavlink messages
msg = createcmd(mavlink.Dialect, "long", 22);
sendmsg(mavlink, msg, uav1);
On Simulink, you could use MAVLink deserializerand serializer blocks to filter different system IDs.
Additionally, you can refer to the MATLAB files in the UAV Package Delivery example to see how we are exchanging data between QGroundControl and simulated UAV in Simulink. Files are in <ExampleFolder>\utilities\MAVLinkMissionProtocolExample, start with MAVLinkInterface.m

类别

Help CenterFile Exchange 中查找有关 UAV 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by