-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Px4 imu #1569
Px4 imu #1569
Conversation
Nice! Also I don't understand why you would add the external hmc5811 mag to the imu driver? Please also remove the qt_project.py as it's unrelated to this PR. |
About the clean up, yeah I was considering removing the I2C stuff, because I don't have the hardware and I'm sure it did not work before anyway... (so apparently nobody is using it). About the hmc, uhm I was following the imu_mpu6000_hmc5883 code as an example here... will figure out the module thing. |
The imu_mpu6000_hmc5883 driver is for hardware modules that have the hmc included, on the pixhawk this is an optional and external module.. |
It would be nice if we could keep the lsm303 i2c driver, it was cherry picked from #625 |
Please also note that updating the global |
Also right now you can have only one set of IMU sens/neutral defines, here it would apply the same to both IMUs... |
Hmm, that might explain some troubles I'm having calibrating the Iris...
Well. I do just that in the Iris xml right? Anyway, to bad that doesn't cover all the cases. I guess I'll remove the mpu6000 from the PX4 imu for now then. |
The AHRS is not the only subscriber to IMU messages... e.g. the aligner and INS also subscribe to IMU |
261268e
to
46059bc
Compare
I think I handled all concerns. |
include $(CFG_SHARED)/spi_master.makefile | ||
|
||
IMU_PX4FMU_CFLAGS += -DIMU_TYPE_H=\"imu/imu_px4fmu_v2.4.h\" | ||
IMU_CFLAGS = -DIMU_TYPE_H=\"imu/imu_px4fmu_v2.4.h\" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preferably all these variables have the imu name in them, so like IMU_PX4FMU_CFLAGS
above...
Or at least the currently unused IMU_PX4FMU_CFLAGS
above...
<define name="HMC58XX_CHAN_Y_SIGN" value="+|-" description="Reverse polarity of y axis (default: +)"/> | ||
<define name="HMC58XX_CHAN_Z_SIGN" value="+|-" description="Reverse polarity of z axis (default: +)"/> | ||
<define name="HMC58XX_CHAN_X" value="0|1|2" description="Channel id of x axis (default: 0)"/> | ||
<define name="HMC58XX_CHAN_Y" value="0|1|2" description="Channel id of y axis (default: 0)"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default is 1
for y, 2
for z...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops :)
Fixed
Since #1577 is now merged, could you please rebase it on master again and fix the conflicts? |
Done |
#include "peripherals/lsm303dlhc_spi.h" | ||
|
||
#ifndef IMU_PX4_DISABLE_MAG | ||
#ifdef MODULE_HMC58XX_UPDATE_AHRS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't check if it's defined, but if it's TRUE, so only #if MODULE_HMC58XX_UPDATE_AHRS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are very right ... tnx :)
Ow fyi, I have not tested the I2C lsm303dlhc driver, but I'm pretty sure it doesn't work perfectly. Maybe add a comment or something? I spend quite a lot of time on the I2C driver until I discovered it was never used (and probably non working) in the first place... |
I don't think the driver was never used, apparently it was working fine for the guy who made the PR... |
Actually I just realized that you used (and rewrote) the regs and driver for the LSM303DLHC, but you are actually using a LSM303D (those are not the same). |
Hmmmm :) |
a) lsm303dlhc (acc) + l3g (gyro) IMU, both on spi
b) the MPU6050 (acc + gyro) IMU, on spi.
c) 2 magneto's: one in the lsm303dlhc and an external i2c hmc5811 in the 3dr gps
(this PR builds on #1566, which was not merged yet)