Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ardupilot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SASC
ardupilot
Commits
84c3e298
Commit
84c3e298
authored
8 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
AP_InertialSensor: use AP_HAL rotations for MPU6000
parent
fd8955a7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/AP_InertialSensor/AP_InertialSensor.cpp
+6
-0
6 additions, 0 deletions
libraries/AP_InertialSensor/AP_InertialSensor.cpp
libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp
+0
-28
0 additions, 28 deletions
libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp
with
6 additions
and
28 deletions
libraries/AP_InertialSensor/AP_InertialSensor.cpp
+
6
−
0
View file @
84c3e298
...
@@ -664,8 +664,14 @@ AP_InertialSensor::detect_backends(void)
...
@@ -664,8 +664,14 @@ AP_InertialSensor::detect_backends(void)
_add_backend
(
AP_InertialSensor_SITL
::
detect
(
*
this
));
_add_backend
(
AP_InertialSensor_SITL
::
detect
(
*
this
));
#elif HAL_INS_DEFAULT == HAL_INS_HIL
#elif HAL_INS_DEFAULT == HAL_INS_HIL
_add_backend
(
AP_InertialSensor_HIL
::
detect
(
*
this
));
_add_backend
(
AP_InertialSensor_HIL
::
detect
(
*
this
));
#elif HAL_INS_DEFAULT == HAL_INS_MPU60XX_SPI && defined(HAL_INS_DEFAULT_ROTATION)
_add_backend
(
AP_InertialSensor_MPU6000
::
probe
(
*
this
,
hal
.
spi
->
get_device
(
HAL_INS_MPU60x0_NAME
),
HAL_INS_DEFAULT_ROTATION
);
#elif HAL_INS_DEFAULT == HAL_INS_MPU60XX_SPI
#elif HAL_INS_DEFAULT == HAL_INS_MPU60XX_SPI
_add_backend
(
AP_InertialSensor_MPU6000
::
probe
(
*
this
,
hal
.
spi
->
get_device
(
HAL_INS_MPU60x0_NAME
)));
_add_backend
(
AP_InertialSensor_MPU6000
::
probe
(
*
this
,
hal
.
spi
->
get_device
(
HAL_INS_MPU60x0_NAME
)));
#elif HAL_INS_DEFAULT == HAL_INS_MPU60XX_I2C && defined(HAL_INS_DEFAULT_ROTATION)
_add_backend
(
AP_InertialSensor_MPU6000
::
probe
(
*
this
,
hal
.
i2c_mgr
->
get_device
(
HAL_INS_MPU60x0_I2C_BUS
,
HAL_INS_MPU60x0_I2C_ADDR
),
HAL_INS_DEFAULT_ROTATION
);
#elif HAL_INS_DEFAULT == HAL_INS_MPU60XX_I2C
#elif HAL_INS_DEFAULT == HAL_INS_MPU60XX_I2C
_add_backend
(
AP_InertialSensor_MPU6000
::
probe
(
*
this
,
hal
.
i2c_mgr
->
get_device
(
HAL_INS_MPU60x0_I2C_BUS
,
HAL_INS_MPU60x0_I2C_ADDR
)));
_add_backend
(
AP_InertialSensor_MPU6000
::
probe
(
*
this
,
hal
.
i2c_mgr
->
get_device
(
HAL_INS_MPU60x0_I2C_BUS
,
HAL_INS_MPU60x0_I2C_ADDR
)));
#elif HAL_INS_DEFAULT == HAL_INS_BH
#elif HAL_INS_DEFAULT == HAL_INS_BH
...
...
This diff is collapsed.
Click to expand it.
libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp
+
0
−
28
View file @
84c3e298
...
@@ -499,20 +499,6 @@ void AP_InertialSensor_MPU6000::_accumulate(uint8_t *samples, uint8_t n_samples)
...
@@ -499,20 +499,6 @@ void AP_InertialSensor_MPU6000::_accumulate(uint8_t *samples, uint8_t n_samples)
-
int16_val
(
data
,
5
));
-
int16_val
(
data
,
5
));
gyro
*=
GYRO_SCALE
;
gyro
*=
GYRO_SCALE
;
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF
accel
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
gyro
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
accel
.
rotate
(
ROTATION_YAW_270
);
gyro
.
rotate
(
ROTATION_YAW_270
);
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
accel
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
gyro
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_MINLURE
accel
.
rotate
(
ROTATION_YAW_90
);
gyro
.
rotate
(
ROTATION_YAW_90
);
#endif
_rotate_and_correct_accel
(
_accel_instance
,
accel
);
_rotate_and_correct_accel
(
_accel_instance
,
accel
);
_rotate_and_correct_gyro
(
_gyro_instance
,
gyro
);
_rotate_and_correct_gyro
(
_gyro_instance
,
gyro
);
...
@@ -541,20 +527,6 @@ void AP_InertialSensor_MPU6000::_accumulate_fast_sampling(uint8_t *samples, uint
...
@@ -541,20 +527,6 @@ void AP_InertialSensor_MPU6000::_accumulate_fast_sampling(uint8_t *samples, uint
float
gscale
=
GYRO_SCALE
/
n_samples
;
float
gscale
=
GYRO_SCALE
/
n_samples
;
Vector3f
gyro
(
gsum
.
x
*
gscale
,
gsum
.
y
*
gscale
,
gsum
.
z
*
gscale
);
Vector3f
gyro
(
gsum
.
x
*
gscale
,
gsum
.
y
*
gscale
,
gsum
.
z
*
gscale
);
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF
accel
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
gyro
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP
accel
.
rotate
(
ROTATION_YAW_270
);
gyro
.
rotate
(
ROTATION_YAW_270
);
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
accel
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
gyro
.
rotate
(
ROTATION_PITCH_180_YAW_90
);
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_MINLURE
accel
.
rotate
(
ROTATION_YAW_90
);
gyro
.
rotate
(
ROTATION_YAW_90
);
#endif
_rotate_and_correct_accel
(
_accel_instance
,
accel
);
_rotate_and_correct_accel
(
_accel_instance
,
accel
);
_rotate_and_correct_gyro
(
_gyro_instance
,
gyro
);
_rotate_and_correct_gyro
(
_gyro_instance
,
gyro
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment