GPS/Compass AHRS_ORIENTATION param on PX4

351 views
Skip to first unread message

xerr...@gmail.com

unread,
Sep 17, 2013, 9:06:36 AM9/17/13
to drones-...@googlegroups.com
Hi,

I just received a new 3dr GPS/Compass module and installed it on my PX4 based octa-quad. In the wiki it says to set AHRS_ORIENTATION to roll 180 (number 8 if I did it correctly). I believe this is a mistake in the wiki.

when I set AHRS_ORIENTATION to 8 the HUD in the MP shows the copter upside down even after doing the ACCEL cal and compass cal.  I believe this is because the magnetometer on the PX4, I think is also upside down on the FMU board.  everything seems to work fine with AHRS_ORIENTATION set to 0.

so, unless I am doing something wrong (which could very much be the case) Please let me know.

John

Robert Lefebvre

unread,
Sep 17, 2013, 10:16:31 AM9/17/13
to drones-discuss
I think you want to be setting Compass_Orientation to Roll 180, not AHRS.


--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

xerr...@gmail.com

unread,
Sep 17, 2013, 10:54:35 AM9/17/13
to drones-...@googlegroups.com
Hi,

Yes, you are correct, I was doing something wrong. thanks!

John

Julian Oes

unread,
Sep 17, 2013, 3:17:14 PM9/17/13
to drones-discuss
Hi John,

the external mag should get detected automatically on PX4 (even with APM software). So with PX4 there should be no need to change Compass_Orientation unless you actually mount the external GPS/mag different than the indicating arrow.

Randy, Tridge: correct me if I'm wrong and this has been reverted?

-Julian

Gary McCray

unread,
Sep 17, 2013, 3:27:31 PM9/17/13
to drones-...@googlegroups.com
Hi Julian, 
On the external GPS , Compass option you do need to set the Orientation to upside down - roll 180 because it is on the bottom of the GPS module board, uypside down.
The fact that it is automatically detected on the PX4 / Pixhawk doesn't change that.
Regards,
Gary

Julian Oes

unread,
Sep 17, 2013, 5:08:36 PM9/17/13
to drones-discuss
Hi Gary,

well the thing is that in the driver we can detect if the Mag is on the internal or external I2C bus and set the orientation accordingly. I've actually added these lines (https://github.com/diydrones/PX4Firmware/blob/master/src/drivers/hmc5883/hmc5883.cpp#L886) myself but did not properly communicate it, I only sent a note to Randy.

So unless this is somehow reverted later in the APM code, I'm pretty sure you don't need to set it manually wen using PX4.


-Julian

Gary McCray

unread,
Sep 17, 2013, 5:25:00 PM9/17/13
to drones-...@googlegroups.com
Hi Julian,

The magnetometer IC is the same on the standalone external magnetometer board as it is on the GPS/Magnetometer board.

On the standalone external magnetometer it is right side up on the combo board it is upside down.

Since it is possible and reasonable to use either a stand alone Magnetometer plus a standalone GPS (OR) the combo GPS/Magnetometer with the PX4, how can you tell which one you are using?

The orientation is normal for the standalone one and upside down (roll 180) for the one on the combo GPS/Mag.

And the PX4 / Pixhawk has no idea which one it is using.

Best Regards,

Gary

xerr...@gmail.com

unread,
Sep 17, 2013, 6:16:59 PM9/17/13
to drones-...@googlegroups.com
Hi,

It was my mistake, I was looking at the wrong param.  I am not sure if it detected it automatically because I was looking at the wrong param.  what is working is the compass_orientation param set to 8.

Gary, if I remember correctly, you cannot use the standalone magnetometer on the PX4 only the GPS/Compass module works on it, it seems I read this in the wiki at one time but cannot find it now. actually I tried an standalone compass before the gps/compass was available and could not get it ot work. seems like it was getting data from both chips (if I move the px4 or the standalone compass  I would see compass movement in the hud) 

thanks,

John

Andrew Tridgell

unread,
Sep 17, 2013, 6:01:55 PM9/17/13
to Julian Oes, drones-discuss
Hi Julian,

> the external mag should get detected automatically on PX4 (even with APM
> software). So with PX4 there should be no need to change
> Compass_Orientation unless you actually mount the external GPS/mag
> different than the indicating arrow.
>
> Randy, Tridge: correct me if I'm wrong and this has been reverted?

That is correct for the current git master, but not for the existing
stable releases. That feature will be in the next release, along with
the new COMPASS_EXTERNAL option, which gets set automatically on PX4 and
Pixhawk.

Cheers, Tridge

Bill Bonney

unread,
Sep 18, 2013, 12:15:37 AM9/18/13
to drones-...@googlegroups.com
What should the GCS be doing, currently i have it send 'roll 180' for gps mag, and 'roll 180' 'yaw 90' for internal?

Julian Oes

unread,
Sep 18, 2013, 1:37:33 AM9/18/13
to drones-discuss

Hi Tridge,

thanks for the clarification. Of course, I forgot about the versions!

-Julian

On Sep 18, 2013 6:15 AM, "Bill Bonney" <billb...@gmail.com> wrote:
What should the GCS be doing, currently i have it send 'roll 180' for gps mag, and 'roll 180' 'yaw 90' for internal?

Reply all
Reply to author
Forward
0 new messages