Skip to content

Commit

Permalink
[math] geodetic: RMat instead of Mat33 for ltp_of_ecef
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Sep 10, 2014
1 parent 8d52fef commit 43d563f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sw/airborne/math/pprz_geodetic_double.h
Expand Up @@ -93,7 +93,7 @@ struct UtmCoor_d {
struct LtpDef_d {
struct EcefCoor_d ecef; ///< origin of local frame in ECEF
struct LlaCoor_d lla; ///< origin of local frame in LLA
struct DoubleMat33 ltp_of_ecef; ///< rotation from ECEF to local frame
struct DoubleRMat ltp_of_ecef; ///< rotation from ECEF to local frame
double hmsl; ///< height in meters above mean sea level
};

Expand Down
4 changes: 2 additions & 2 deletions sw/airborne/math/pprz_geodetic_float.c
Expand Up @@ -119,7 +119,7 @@ void ned_of_lla_point_f(struct NedCoor_f* ned, struct LtpDef_f* def, struct LlaC
*/
void ecef_of_enu_point_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct EnuCoor_f* enu) {
/* convert used floats to double */
struct DoubleMat33 ltp_of_ecef_d;
struct DoubleRMat ltp_of_ecef_d;
ltp_of_ecef_d.m[0] = (double) def->ltp_of_ecef.m[0];
ltp_of_ecef_d.m[1] = (double) def->ltp_of_ecef.m[1];
ltp_of_ecef_d.m[2] = (double) def->ltp_of_ecef.m[2];
Expand Down Expand Up @@ -152,7 +152,7 @@ void ecef_of_ned_point_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct N

void ecef_of_enu_vect_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct EnuCoor_f* enu) {
/* convert used floats to double */
struct DoubleMat33 ltp_of_ecef_d;
struct DoubleRMat ltp_of_ecef_d;
ltp_of_ecef_d.m[0] = (double) def->ltp_of_ecef.m[0];
ltp_of_ecef_d.m[1] = (double) def->ltp_of_ecef.m[1];
ltp_of_ecef_d.m[2] = (double) def->ltp_of_ecef.m[2];
Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/math/pprz_geodetic_float.h
Expand Up @@ -93,7 +93,7 @@ struct UtmCoor_f {
struct LtpDef_f {
struct EcefCoor_f ecef; ///< origin of local frame in ECEF
struct LlaCoor_f lla; ///< origin of local frame in LLA
struct FloatMat33 ltp_of_ecef; ///< rotation from ECEF to local frame
struct FloatRMat ltp_of_ecef; ///< rotation from ECEF to local frame
float hmsl; ///< Height above mean sea level in meters
};

Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/math/pprz_geodetic_int.c
Expand Up @@ -31,7 +31,7 @@
#include "pprz_algebra_int.h"


void ltp_of_ecef_rmat_from_lla_i(struct Int32Mat33* ltp_of_ecef, struct LlaCoor_i* lla) {
void ltp_of_ecef_rmat_from_lla_i(struct Int32RMat* ltp_of_ecef, struct LlaCoor_i* lla) {

#if USE_DOUBLE_PRECISION_TRIG
int32_t sin_lat = rint(BFP_OF_REAL(sin(RAD_OF_EM7DEG((double)lla->lat)), HIGH_RES_TRIG_FRAC));
Expand Down
4 changes: 2 additions & 2 deletions sw/airborne/math/pprz_geodetic_int.h
Expand Up @@ -95,11 +95,11 @@ struct UtmCoor_i {
struct LtpDef_i {
struct EcefCoor_i ecef; ///< Reference point in ecef
struct LlaCoor_i lla; ///< Reference point in lla
struct Int32Mat33 ltp_of_ecef; ///< Rotation matrix
struct Int32RMat ltp_of_ecef; ///< Rotation matrix
int32_t hmsl; ///< Height above mean sea level in mm
};

extern void ltp_of_ecef_rmat_from_lla_i(struct Int32Mat33* ltp_of_ecef, struct LlaCoor_i* lla);
extern void ltp_of_ecef_rmat_from_lla_i(struct Int32RMat* ltp_of_ecef, struct LlaCoor_i* lla);
extern void ltp_def_from_ecef_i(struct LtpDef_i* def, struct EcefCoor_i* ecef);
extern void ltp_def_from_lla_i(struct LtpDef_i* def, struct LlaCoor_i* lla);
extern void lla_of_ecef_i(struct LlaCoor_i* out, struct EcefCoor_i* in);
Expand Down

0 comments on commit 43d563f

Please sign in to comment.