How to get compass data in arduino?

Frequent questions asked online, offline, in forums are answered here
HEMANT
Posts: 9
Joined: Thu Mar 23, 2017 4:51 pm

How to get compass data in arduino?

Post by HEMANT »

Hello, i bought marvelmind system recently, in the dashboard under the view option, i can see an option for getting "Compass data(X,Y axis)". So i am guessing the system can be used as a digital compass for the map IT creates. Can someone tell me how to get this data on arduino? and how to utilise this data?
By "how" i mean the sample code required to get that data from marvelmind and parse it. It will be a great help.
Thanks in advance.

smoker77
Posts: 322
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to get compass data in arduino?

Post by smoker77 »

Hello,
current version of sowftware release (5.51) not outputs the inertial sensors data in the same protocol as coordinates.
In the next release we will add the function of streaming of raw data from gyro, accelerometer and compass.
Take aware this function will be available only for hardware with mounted inertial sensors, see the attached picture.
Attachments
acc_compass_ic.JPG
acc_compass_ic.JPG (172.46 KiB) Viewed 11996 times

janinl
Posts: 2
Joined: Tue Jul 04, 2017 3:48 pm

Re: How to get compass data in arduino?

Post by janinl »

I would also be interested in this feature.
In my case I am using the USB-UART interface.

Thanks

smoker77
Posts: 322
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to get compass data in arduino?

Post by smoker77 »

Hello. New version of software from our site (5.63) already can output the raw inertial sensors data. But by default it is disabled, you should enable this output as shown on the screenshot. The data are coming according to section 1.3 of the protocol: https://drive.google.com/open?id=0ByNFY ... mhKTkkzVzg.
Attachments
raw_inertial_sensors_data.PNG
raw_inertial_sensors_data.PNG (56.13 KiB) Viewed 11746 times

janinl
Posts: 2
Joined: Tue Jul 04, 2017 3:48 pm

Re: How to get compass data in arduino?

Post by janinl »

Hi Smoker77,

It works, this is awesome!

Thanks a lot

amolad
Posts: 34
Joined: Wed Jan 18, 2017 12:56 pm

Re: How to get compass data in arduino?

Post by amolad »

Hello!
Any possiblility of receiving the raw distances of the hedge to the stationary beacon?
Still waiting for this for the pixhawk integration of marvelmind :(

smoker77
Posts: 322
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to get compass data in arduino?

Post by smoker77 »

Hello.
Do you need the raw distances data output from modem or from hedge?
For the modem the data is already available, see section 6 of this protocol:
http://marvelmind.com/downloads/modem_u ... _01_27.pdf
From the mobile beacon this data is not yet available, the update containing this function will be ready in coming weeks.

amolad
Posts: 34
Joined: Wed Jan 18, 2017 12:56 pm

Re: How to get compass data in arduino?

Post by amolad »

Okay Thank you!!
Yes it is from the mobile beacon.
How it works is that, these raw distances are inputted to the EKF of ardupilot which then computes the position of the vehicle!
https://github.com/ArduPilot/ardupilot/ ... d.cpp#L390
This is why :(

User avatar
admin
Site Admin
Posts: 305
Joined: Tue Jan 26, 2016 7:06 pm
Contact:

Re: How to get compass data in arduino?

Post by admin »

amolad wrote:Okay Thank you!!
Yes it is from the mobile beacon.
How it works is that, these raw distances are inputted to the EKF of ardupilot which then computes the position of the vehicle!
https://github.com/ArduPilot/ardupilot/ ... d.cpp#L390
This is why :(

Just for me to understand. So, basically, you need the same what we currently already have for modem, also on the mobile beacon, right? Raw distances. And then you do the mathematics, filtering, etc. by yourself. Correct?

amolad
Posts: 34
Joined: Wed Jan 18, 2017 12:56 pm

Re: How to get compass data in arduino?

Post by amolad »

admin wrote:
amolad wrote:Okay Thank you!!
Yes it is from the mobile beacon.
How it works is that, these raw distances are inputted to the EKF of ardupilot which then computes the position of the vehicle!
https://github.com/ArduPilot/ardupilot/ ... d.cpp#L390
This is why :(

Just for me to understand. So, basically, you need the same what we currently already have for modem, also on the mobile beacon, right? Raw distances. And then you do the mathematics, filtering, etc. by yourself. Correct?
Exactly! The Kalmann filter in the ardupilot code already does the triangulation since it has to support multiple beacons. Now since marvelmind already gives us the XYZ of the vehicle, this is supplied as back calculation and reliabilty based on the accuracy. The accuracy of the info is now hardcoded as +/- 2cms! It would be nice to have some sort of accuracy info too supplied if possible? :) But its not too important.
The kalmann filter will use the raw distances and compute the XYZ and does a check between the given values and calculated values.

So yeah just need the info what the modem shows, the raw distances, also in the mobile beacon side! :)

Post Reply