RizkiWahyupratama / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Magnetometer HMC5883L Bug #482

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Upload Arducopter 2.* Code to Arduino 

What is the expected output? What do you see instead?

If copter Shows in reality to north in the MP it looks to south.

What version of the product are you using? On what operating system?
Magnetometer HMC5883L and AMP1

Please provide any additional information below.

Read it here:
http://diydrones.com/forum/topics/since-arducopter-2-1-and-2-2-problem-with-mag

/*
  the 5883L has a different orientation to the 5843. This allows us to
  use a single MAG_ORIENTATION for both
 */
static void rotate_for_5883L(AP_VarS<Matrix3f> *_orientation_matrix)
{
        _orientation_matrix->set_and_save(_orientation_matrix->get() * Matrix3f(ROTATION_YAW_90));
}

Should it not be: ROTATION_YAW_180???

Original issue reported on code.google.com by druckg...@gmx.net on 15 Jan 2012 at 5:37

Attachments:

GoogleCodeExporter commented 9 years ago
This is not a mag we support

Original comment by analogue...@gmail.com on 16 Jan 2012 at 6:13

GoogleCodeExporter commented 9 years ago
Ah ok but is there a nother HMC5883L Support for another factory?? Or why is it 
the same name???

thx
DRUCKGOTT

Original comment by druckg...@gmx.net on 20 Jan 2012 at 7:32

GoogleCodeExporter commented 9 years ago
I have the same mag I got from sparkfun in october 2011.  I have it mounted 
components down pins forward.  I have not defined anything in apm_config.h. 
Auto-detection works for me.  Before I tried auto-detection I messed around for 
a couple days and found that this works also: #define 
AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD ROTATION_ROLL_180_YAW_90.  
Good luck!
btw it does not matter who makes the board that the mag sits on but the 
orientation.
whats important is that is a 5883 or 5843 made by honeywell.

Original comment by stevenha...@gmail.com on 21 Jan 2012 at 12:47

GoogleCodeExporter commented 9 years ago
Yes it works also for me in older versions, but since 2.1* and 2.2* the copter 
is shown in MP 180 deg around than it stands in reality?!

Original comment by druckg...@gmx.net on 21 Jan 2012 at 8:36

GoogleCodeExporter commented 9 years ago
I just tested my sparkfun mag again ( http://www.sparkfun.com/products/10530 ) 
with sparkfun level converter ( http://www.sparkfun.com/products/8745 ) and 
with nothing defined in APM_config.h it works well after it is calibrated for a 
few minutes with latest code pulled from GIT.

Original comment by stevenha...@gmail.com on 26 Jan 2012 at 11:47