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

Sounds good I will try it out.

Thanks

0 Kudos
Message 21 of 75
(3,078 Views)

I spend a lot of time in the  Mavlink Send Interface but don´t come on..

Now i can´t see it any more for a long time ..

I can creat a correct Data String .. ( Heartbeat and Message ID 70 ---- RC Channel Input RAW overwrite )...

But nothing happend on my Copter .. First i connected the Copter with the Mission Planer for the Paket Request. After connect i exit the Mission Planer and connect with Labview and try to send the Pakets ...

The CRC works correct ... i´ve checked it

So .. i can´t find the Problem(s) ... I have recorded the hole Communication between Mission Planer and APM and looked at every Paket from first Paket..

There is nothing otherwise Heartbeat ( 00 ) , Parameter Request ( 21 ), Reqest Data Stream ( 66 ) and the RC CH Overwriter ( 70 ) Pakets.

I have Mission Planer let sended the Parm. Req. pakets and so one .... So i just need send the Heartbeat (00 ) and the RC CH overwrite ( 70 ) Paket ...

But it dosn´t work ...  So ... Maybe somebody help this for his one Project.. Or somebody find the Error and can end up this Project..

Or maybe i self can finde the error  later ....

Download All
0 Kudos
Message 22 of 75
(3,060 Views)

This are the Log Files ... U can View it with Bin Viewer or another Hex Viewer

Download All
0 Kudos
Message 23 of 75
(3,054 Views)

Got it working thanks for the help.

 

Had another question regarding the data decoding for example message #30

 

Im getting data like this

FE 1C 8B 01 01 1E 84 FA IF 00 IF 53 00 BD 84 70 23 3E 41 BD F8 BC 00 CC 38 B9 00 C6 72 38 40 21 9A B9 F6 7F

 

My undersatning is that

time_boot_ms= 84 FA IF 00

roll= IF 53 00 BD

pitch=84 70 23 3E

yaw=41 BD F8 BC

rollspeed= 00 CC 38 B9

pitch speed=0006 72 38

yawspeed=40 21 9A B9

 

after converting from string2Hex and Hex2flot(SGL) I get

time_boot_ms=-5.88032E-36

roll=-1.04484E+30

Which dosent seem rigth. I know Karl G meantioned something about scale factor.

 

Would this applied to this measseage type?

 

Thnaks for the help

 

0 Kudos
Message 24 of 75
(3,016 Views)

Hello Jose,

 

Perhaps you are not converting correctly, do you have the original hex formatted string for the above data… I don’t think what you have there is correct, IF doesn’t seem right, is it supposed to be 1F?

 

Also, I don’t believe that there should be a scale factor, just keep in mind the representation and units for the message#30. Once you convert to decimal, that should be all there is, as far as I am aware.

Matthew R.
Field Applications & Systems Engineer
National Instruments

Certified-LabVIEW-Developer_rgb.jpg

Certified-TestStand-Developer_rgb.jpg


0 Kudos
Message 25 of 75
(2,986 Views)

Hello Matthew

I think you are right about wrong conversion.

I don't know what you man about original hex formatted string but below is new data I am reading from unit.

 

FE 1C 2F01 01 1E FC 7A 5A 00 20 BE D6 BC 14 C5 3B 3E D4 8B ED BE D0 77 B4 3A F0 D9 43 BB 50 E6 92 3A 06 13

 

 

I have Qgroundstation installed and there I can see the raw vaules for message#30

time_boot_ms= 5.85721+6

roll=                -0.0256683

pitch=              0.183537

yaw=              -0.462449

rollspeed=       0.00190897

pitch speed=   0.00245634

yawspeed=     0.00112076

 

So the Hex data string from above should have allmost same vales as Qgroudstation.

I just cant decode them right. Any labview exmaple or ideas would help

thanks

 

0 Kudos
Message 26 of 75
(2,973 Views)

 

Message 27 of 75
(2,982 Views)

Jose,

 

What I had meant was you had “IF” in the Hex string you posted, but IF is not a hex number. Hexadecimal only uses letters from A-F.

 

It appears to me that, in order to properly decode the hexadecimal Payload string, you will need to research the actual method of decoding the payload for the given message ID. I am not sure what this is, so I am sorry, but I won’t be able to help you with that. However, once you determine the decoding algorithm, it should just be a matter of implementing that in LabVIEW.

 

Otherwise, if you can identify which resource Qgroundcontrol is using to decode the payload message, such as a DLL, you can simply use LabVIEW to call into that resource and pass in the message/parameters to decoded it that way. 

Matthew R.
Field Applications & Systems Engineer
National Instruments

Certified-LabVIEW-Developer_rgb.jpg

Certified-TestStand-Developer_rgb.jpg


0 Kudos
Message 28 of 75
(2,962 Views)

Hi everyone, saw this thread and thought, "this would have been a great thread to find last June when I had to do this".  Anyway, as I said last June I was working on a project to control an ArduRover through labview using the RC Override command in mavlink and read/parse the sensor data coming back over the serial.  Project went well and I think have some code that could help you out.  I'm at work at the moment and I need to clean the code up some before I can post it so I will do that tonight.  Is labview 2012 ok or do you need it saved in a different version?

CLAD, using LV2013SP1 + LV2015SP1+ LV2017 on Win7+cRIO
0 Kudos
Message 29 of 75
(2,946 Views)

Wow that would be great to see. 2012 would be fine. 

 

0 Kudos
Message 30 of 75
(2,943 Views)