aboutsummaryrefslogtreecommitdiff
path: root/src/modules/commander/accelerometer_calibration.cpp
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2013-12-19 14:10:25 +0400
committerAnton Babushkin <anton.babushkin@me.com>2013-12-19 14:10:25 +0400
commitba612c3ee8b88b9352e7cfa723997887dd736b76 (patch)
tree8b101b50259ffebd4de12891f4f684d6d84c3f53 /src/modules/commander/accelerometer_calibration.cpp
parente3a5a384d7b3678d1cbef63dc28fbe9a8f1de940 (diff)
downloadpx4-firmware-ba612c3ee8b88b9352e7cfa723997887dd736b76.tar.gz
px4-firmware-ba612c3ee8b88b9352e7cfa723997887dd736b76.tar.bz2
px4-firmware-ba612c3ee8b88b9352e7cfa723997887dd736b76.zip
mathlib fixes
Diffstat (limited to 'src/modules/commander/accelerometer_calibration.cpp')
-rw-r--r--src/modules/commander/accelerometer_calibration.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/modules/commander/accelerometer_calibration.cpp b/src/modules/commander/accelerometer_calibration.cpp
index 5eeca5a1a..36b75dd58 100644
--- a/src/modules/commander/accelerometer_calibration.cpp
+++ b/src/modules/commander/accelerometer_calibration.cpp
@@ -194,15 +194,13 @@ int do_accel_calibration(int mavlink_fd)
int32_t board_rotation_int;
param_get(board_rotation_h, &(board_rotation_int));
enum Rotation board_rotation_id = (enum Rotation)board_rotation_int;
- math::Matrix board_rotation(3, 3);
+ math::Matrix<3,3> board_rotation;
get_rot_matrix(board_rotation_id, &board_rotation);
- math::Matrix board_rotation_t = board_rotation.transpose();
- math::Vector3 accel_offs_vec;
- accel_offs_vec.set(&accel_offs[0]);
- math::Vector3 accel_offs_rotated = board_rotation_t * accel_offs_vec;
- math::Matrix accel_T_mat(3, 3);
- accel_T_mat.set(&accel_T[0][0]);
- math::Matrix accel_T_rotated = board_rotation_t * accel_T_mat * board_rotation;
+ math::Matrix<3,3> board_rotation_t = board_rotation.transposed();
+ math::Vector<3> accel_offs_vec(&accel_offs[0]);
+ math::Vector<3> accel_offs_rotated = board_rotation_t * accel_offs_vec;
+ math::Matrix<3,3> accel_T_mat(&accel_T[0][0]);
+ math::Matrix<3,3> accel_T_rotated = board_rotation_t * accel_T_mat * board_rotation;
accel_scale.x_offset = accel_offs_rotated(0);
accel_scale.x_scale = accel_T_rotated(0, 0);