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?

Postby HEMANT » Sat Apr 08, 2017 5:15 pm

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: 96
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to get compass data in arduino?

Postby smoker77 » Sun Apr 09, 2017 1:04 pm

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 1233 times

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

Re: How to get compass data in arduino?

Postby janinl » Tue Jul 04, 2017 3:50 pm

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

Thanks

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

Re: How to get compass data in arduino?

Postby smoker77 » Tue Jul 04, 2017 4:54 pm

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 983 times

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

Re: How to get compass data in arduino?

Postby janinl » Wed Jul 05, 2017 1:06 am

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?

Postby amolad » Wed Jul 05, 2017 3:20 pm

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: 96
Joined: Sat Feb 06, 2016 4:03 pm

Re: How to get compass data in arduino?

Postby smoker77 » Wed Jul 05, 2017 5:17 pm

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?

Postby amolad » Thu Jul 06, 2017 12:40 pm

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: 239
Joined: Tue Jan 26, 2016 7:06 pm
Contact:

Re: How to get compass data in arduino?

Postby admin » Sat Jul 08, 2017 4:06 pm

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?

Postby amolad » Mon Jul 10, 2017 4:00 pm

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! :)


Return to “FAQ”

Who is online

Users browsing this forum: sevet and 3 guests