From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing Ardupilotmega with Labview with Mavlink Protocol

Please use my *.vi in the Example from Shadowclaw ....

 

Use it in the Joystick send VI ... ..

 

Sorry .. but i wan´t destroy the clean code with my crasy kind of operation ...

0 Kudos
Message 41 of 75
(3,524 Views)

Hi,

 

i got some Problems with mit PFD (Display) ... it´s very slow ..

 

i ´ll try it again with *.jpg Pics .. I think the *.bmp files are to big ... I hope it become faster ..

 

The 2´nd error i think i have do is, that i use for any Picture a own frame ... But i havn´t experience with pic work...

 

I also find out, that the data in Shadowclaw example, refresh realy slow...  I think the Problem is that the code display every incoming data packet and not the last ...

 

I´ve try both codes together ... My PFD Display and the Interface .... Big fail ... the "Frame Rate" in on my display is ever 2 or 5 sec. a Frame ... 

So.. it´s not to use ..

 

I hope changing to *.jpg files brings it faster ...

 

Or any other some idea ??

 

 

 

0 Kudos
Message 42 of 75
(3,502 Views)

soory..

 

forgoten attachment ..

0 Kudos
Message 43 of 75
(3,496 Views)

So I tried look at your code Daniel but it seems like you forgot to include "Rotate.llb" so I was unable to run the code.  

 

My example code should only being displaying the most recent data it has received. As for my code running slowly, was it running slowly before or after you tried integate your display?  I ask because if your display code was placed in the main loop (the one with the indicators) and was only runing every 2-5 seconds that would be enough to slow the loop down and allow the message queue to get backed up.  This would cause everything to update slowly because the parsing VI only runs once per loop iteration.  The loop normally runs as fast as possible so as to not get backed up with old messages.  An easy way to test this (and the way I would implement a display) would be to create a separate while loop that only has the display code in it and use local variables to connect the appropriate data.  This way if the display code starts to run slow, as images functions tend to use a lot of resources, it would not cause the parsing code to slow down.

CLAD, using LV2013SP1 + LV2015SP1+ LV2017 on Win7+cRIO
0 Kudos
Message 44 of 75
(3,486 Views)

Oh sorry,

 

i tested my Display as satnd alone -.. there the frames are 2 per sec.. or so ... realy slow too ...

 

I get the idea every pic frame i a own loop .. befor i start again withe the work in one pic frame ...

 

I´ve try the Display in the Send loop ... I think too it was wrong ... i ´ve to run it in a seperat loop i think ..

 

But need to fix the problem withe the frame rate at first

 

I also integrate a send Heartbeat and Recive MSG 166 ( Radio Status ) in u Example ... If u send a Heartbeat u get the message 166 back from 3DR-Radio ..

I also integrate other Messages i knowing ... But the APM start to sending the other messages ( VFR HUD MSG 74 ) and so on, after i conect the APM with the Mission Planer ...

I thiink ther Mission Planer sends PacketRequest Packets to the APM to get the oter Messages ...

 

I add the Rotate.llb on my *.zip file... Hope it works now ..

My Display based on the Mavlink Example DIY Drones .. http://diydrones.com/profiles/blogs/ardupilot-ground-control ...

 

 

Download All
0 Kudos
Message 45 of 75
(3,476 Views)

Ok...

 

i´ve try a Pic Frame in an extra loop ... I´ve let show me the loop Counter´s of every loop.. Bothe loops runs faster as befor ... and with differnt speed´s ... so i think that is the solutione....

So i´m happy that 40 hours work are not for nothing ...

 

I keep u update ...

0 Kudos
Message 46 of 75
(3,473 Views)

Ok...

 

I´m not realy satisfied with the Frame rate of the PFD but for first test its ok... I´m not realy done withe the PFD .. I´ve some  Ideas for it ...

But at first i have to clean the main problems ...

 

I have add the PFD in bothe Mavlink Example codes ... The code form shadowclaw and my horrible code, that u can see the differents between update rate of attitude ...

 

U also can see in Shadowclaws code ( without my PFD) in the original Display of the code, that the attitude needs long time from coming in to display the data ...

 

Some ideas to push up the frame rate of my PFD are also welcome ... 😉 .. Hope the PFD code is cleaner now and easier to Read..

 

 


EDIT :

 

Sorry.. i forgot the "Rotate.llb" again in Shadowclaw s llb ...

0 Kudos
Message 47 of 75
(3,461 Views)

Hello again,

 

hope i don´t spam this Forum with my Examples , but i´ve cleaned up my horrible, stupid code..

I hate it my self ...
It´s if i develop something i think striagth in one way to become results but i didn´t think about easier way´s at this point..

 

But after a long weekend , i can show u my code ...


I add a command send back detection for the RC - overider commands and the MNT_MODE commands.

It detect that the APM has recived the command that the code only sends new commands and repeat them only if the APM hasn´t recived them.

I use the message 35 RC IN for RC Overide Commands and message 22 for the MNT_Mode commands ...

Every message with ID 23 comes back from APM with message ID 22 ...

The part after 8 byte in payload in MSG 22 u can read in ASCII ....

 

Maybe there is another way to detected recived messages as my way ...So .. maybe any body can take a look ..

 

I also add a packet stream request for the MSG 74 VFR HUD , MSG 35 RC in , MSG 36 RC Out ...

But if the stream came in, it slows down the attitude messages ...

Maybe it´s better to request only the data stream that u need ... MSG 35 is needed by the code for the send back detection ..

 

Sorry that i don´t add so many comments in the code.

 

But there are still a problem with my code ... It need maximum CPU Power of my Dualcore 2,2GHz ... uff ..

 

I ´ve timed down the loop´s a little bit but i don´t want slow it down to much because the framerate of the PFD display.

 


I also find that Message (  FE0201FFBE    15  0101    ACA8 ) ..

If i send it to APM it sends me all config data in MSG 16 back ..

 

It shows like this:   FE19C10101  16  000000004B012500464C544D4F444533000000000000000002   A309

                                FE19C60101  16  00804F444B012A004C4F475F4249544D41534B000000000004  C0BD

 

A Part of it is ASCII and i think befor the ASCII part i can find the Value ( maybe 16 bit ?? ) of the in the ASCII part writed option ..

 

Maybe it´s possible to save all geted data in an *.XML or so to display and mybe later to change it ...

I add the logfile of the datastream with the MSG 15 MSG 16 ..

 

 

And Thanx a lot again to Shadowclaw for his example ... I integrate many parts of his code in this code ...

 

I also hope that i don´t forgot anything again .... Maybe the Mavlink CRC can´t find the *.dll

 

So .. have fun with it

 

 

 

 

Download All
0 Kudos
Message 48 of 75
(3,425 Views)

Sorry,

 

this messages

FE19C10101  16  000000004B012500464C544D4F444533000000000000000002   A309

FE19C60101  16  00804F444B012A004C4F475F4249544D41534B000000000004  C0BD

 

are MSG ID 22 too .. not 16 .... HEX 16 is DEZ   22

 

so i thin MESG 22 are all the same type ... after 8 bytes in payload are the ASCII part ..

0 Kudos
Message 49 of 75
(3,410 Views)

Hello Daniel,

 

... please, would it be possible to get your Display VI's saved as LV12? I do nearly the same with a MultiWii Copterboard ... and this as display ...maybe I can help you ..

 

http://forums.ni.com/t5/LabVIEW/customizing-artificial-guages-of-cockpit/m-p/1123358/highlight/false...

 

Greetings from Germany

Carsten

0 Kudos
Message 50 of 75
(3,380 Views)