AP_AHRS: remove custom rotations
This commit is contained in:
parent
72a65cadb8
commit
1cc2e082e0
@ -115,7 +115,7 @@ const AP_Param::GroupInfo AP_AHRS::var_info[] = {
|
||||
// @Param: ORIENTATION
|
||||
// @DisplayName: Board Orientation
|
||||
// @Description: Overall board orientation relative to the standard orientation for the board type. This rotates the IMU and compass readings to allow the board to be oriented in your vehicle at any 90 or 45 degree angle. The label for each option is specified in the order of rotations for that orientation. This option takes affect on next boot. After changing you will need to re-level your vehicle.
|
||||
// @Values: 0:None,1:Yaw45,2:Yaw90,3:Yaw135,4:Yaw180,5:Yaw225,6:Yaw270,7:Yaw315,8:Roll180,9:Yaw45Roll180,10:Yaw90Roll180,11:Yaw135Roll180,12:Pitch180,13:Yaw225Roll180,14:Yaw270Roll180,15:Yaw315Roll180,16:Roll90,17:Yaw45Roll90,18:Yaw90Roll90,19:Yaw135Roll90,20:Roll270,21:Yaw45Roll270,22:Yaw90Roll270,23:Yaw135Roll270,24:Pitch90,25:Pitch270,26:Yaw90Pitch180,27:Yaw270Pitch180,28:Pitch90Roll90,29:Pitch90Roll180,30:Pitch90Roll270,31:Pitch180Roll90,32:Pitch180Roll270,33:Pitch270Roll90,34:Pitch270Roll180,35:Pitch270Roll270,36:Yaw90Pitch180Roll90,37:Yaw270Roll90,38:Yaw293Pitch68Roll180,39:Pitch315,40:Pitch315Roll90,42:Roll45,43:Roll315,100:Custom
|
||||
// @Values: 0:None,1:Yaw45,2:Yaw90,3:Yaw135,4:Yaw180,5:Yaw225,6:Yaw270,7:Yaw315,8:Roll180,9:Yaw45Roll180,10:Yaw90Roll180,11:Yaw135Roll180,12:Pitch180,13:Yaw225Roll180,14:Yaw270Roll180,15:Yaw315Roll180,16:Roll90,17:Yaw45Roll90,18:Yaw90Roll90,19:Yaw135Roll90,20:Roll270,21:Yaw45Roll270,22:Yaw90Roll270,23:Yaw135Roll270,24:Pitch90,25:Pitch270,26:Yaw90Pitch180,27:Yaw270Pitch180,28:Pitch90Roll90,29:Pitch90Roll180,30:Pitch90Roll270,31:Pitch180Roll90,32:Pitch180Roll270,33:Pitch270Roll90,34:Pitch270Roll180,35:Pitch270Roll270,36:Yaw90Pitch180Roll90,37:Yaw270Roll90,38:Yaw293Pitch68Roll180,39:Pitch315,40:Pitch315Roll90,42:Roll45,43:Roll315,100:Custom 4.1 and older,101:Custom 1,102:Custom 2
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("ORIENTATION", 9, AP_AHRS, _board_orientation, 0),
|
||||
|
||||
@ -154,7 +154,7 @@ const AP_Param::GroupInfo AP_AHRS::var_info[] = {
|
||||
// @Units: deg
|
||||
// @Increment: 1
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("CUSTOM_ROLL", 15, AP_AHRS, _custom_roll, 0),
|
||||
// index 15
|
||||
|
||||
// @Param: CUSTOM_PIT
|
||||
// @DisplayName: Board orientation pitch offset
|
||||
@ -163,7 +163,7 @@ const AP_Param::GroupInfo AP_AHRS::var_info[] = {
|
||||
// @Units: deg
|
||||
// @Increment: 1
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("CUSTOM_PIT", 16, AP_AHRS, _custom_pitch, 0),
|
||||
// index 16
|
||||
|
||||
// @Param: CUSTOM_YAW
|
||||
// @DisplayName: Board orientation yaw offset
|
||||
@ -172,7 +172,7 @@ const AP_Param::GroupInfo AP_AHRS::var_info[] = {
|
||||
// @Units: deg
|
||||
// @Increment: 1
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("CUSTOM_YAW", 17, AP_AHRS, _custom_yaw, 0),
|
||||
// index 17
|
||||
|
||||
AP_GROUPEND
|
||||
};
|
||||
|
@ -637,14 +637,6 @@ private:
|
||||
AP_Int8 _wind_max;
|
||||
AP_Int8 _board_orientation;
|
||||
AP_Int8 _ekf_type;
|
||||
AP_Float _custom_roll;
|
||||
AP_Float _custom_pitch;
|
||||
AP_Float _custom_yaw;
|
||||
|
||||
/*
|
||||
* support for custom AHRS orientation, replacing _board_orientation
|
||||
*/
|
||||
Matrix3f _custom_rotation;
|
||||
|
||||
/*
|
||||
* DCM-backend parameters; it takes references to these
|
||||
|
@ -70,14 +70,8 @@ void AP_AHRS::add_trim(float roll_in_radians, float pitch_in_radians, bool save_
|
||||
void AP_AHRS::update_orientation()
|
||||
{
|
||||
const enum Rotation orientation = (enum Rotation)_board_orientation.get();
|
||||
if (orientation != ROTATION_CUSTOM) {
|
||||
AP::ins().set_board_orientation(orientation);
|
||||
AP::compass().set_board_orientation(orientation);
|
||||
} else {
|
||||
_custom_rotation.from_euler(radians(_custom_roll), radians(_custom_pitch), radians(_custom_yaw));
|
||||
AP::ins().set_board_orientation(orientation, &_custom_rotation);
|
||||
AP::compass().set_board_orientation(orientation, &_custom_rotation);
|
||||
}
|
||||
AP::ins().set_board_orientation(orientation);
|
||||
AP::compass().set_board_orientation(orientation);
|
||||
}
|
||||
|
||||
// return a ground speed estimate in m/s
|
||||
|
Loading…
Reference in New Issue
Block a user