Changeset 167 in flair-src for trunk/lib/FlairFilter
- Timestamp:
- Apr 12, 2017, 1:59:38 PM (7 years ago)
- Location:
- trunk/lib/FlairFilter/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairFilter/src/Ahrs.h
r51 r167 19 19 namespace flair { 20 20 namespace core { 21 class Euler;22 class Vector3D;23 class ImuData;24 class Quaternion;25 21 class AhrsData; 26 22 } -
trunk/lib/FlairFilter/src/AhrsComplementaryFilter.cpp
r157 r167 64 64 AhrsData* ahrsData; 65 65 GetDatas(&ahrsData); 66 Vector3D rawAcc,rawMag,rawGyr;66 Vector3Df rawAcc,rawMag,rawGyr; 67 67 input->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr); 68 68 … … 70 70 previous_time=data->DataTime(); 71 71 72 Vector3D aBar,aHat,aTilde;73 Vector3D mBar,mHat,mTilde;74 Vector3D alpha,dBHat,omegaHat;72 Vector3Df aBar,aHat,aTilde; 73 Vector3Df mBar,mHat,mTilde; 74 Vector3Df alpha,dBHat,omegaHat; 75 75 Quaternion dQHat; 76 76 -
trunk/lib/FlairFilter/src/AhrsComplementaryFilter.h
r24 r167 66 66 bool isInit; 67 67 core::Quaternion QHat; 68 core::Vector3D BHat;68 core::Vector3Df BHat; 69 69 gui::DoubleSpinBox *ka[3]; 70 70 gui::DoubleSpinBox *kb[3]; -
trunk/lib/FlairFilter/src/AhrsKalman_impl.cpp
r18 r167 86 86 ImuData *input=(ImuData*)data; 87 87 float delta_t; 88 Vector3D rawAcc,rawMag,rawGyr;88 Vector3Df rawAcc,rawMag,rawGyr; 89 89 90 90 input->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr); … … 115 115 116 116 ahrsData->SetQuaternionAndAngularRates(euler.ToQuaternion(), 117 rawGyr-Vector3D (ars_roll.x_bias,ars_pitch.x_bias,0));117 rawGyr-Vector3Df(ars_roll.x_bias,ars_pitch.x_bias,0)); 118 118 } else { 119 119 is_init=true; -
trunk/lib/FlairFilter/src/Gx3_25_ahrs.cpp
r157 r167 44 44 45 45 Quaternion quaternion; 46 Vector3D filteredAngRates;46 Vector3Df filteredAngRates; 47 47 input->GetQuaternionAndAngularRates(quaternion, filteredAngRates); 48 48 GetImu()->GetOneAxisRotation()->ComputeRotation(quaternion); -
trunk/lib/FlairFilter/src/JoyReference_impl.cpp
r148 r167 168 168 input->GetMutex(); 169 169 170 Vector3D theta_xy(170 Vector3Df theta_xy( 171 171 -Euler::ToRadian(input->ValueNoMutex(0, 0) * deb_roll->Value()), 172 172 -Euler::ToRadian(input->ValueNoMutex(1, 0) * deb_pitch->Value()), 0); 173 Vector3D e_bar = theta_xy;173 Vector3Df e_bar = theta_xy; 174 174 e_bar.Normalize(); 175 175 Quaternion q_xy(cos(theta_xy.GetNorm() / 2.0f), … … 192 192 input->ReleaseMutex(); 193 193 194 ahrsData->SetQuaternionAndAngularRates(q_ref, Vector3D (0, 0, wz_ref));194 ahrsData->SetQuaternionAndAngularRates(q_ref, Vector3Df(0, 0, wz_ref)); 195 195 196 196 // ouput quaternion for control law -
trunk/lib/FlairFilter/src/SimuAhrs.cpp
r158 r167 42 42 43 43 Quaternion quaternion; 44 Vector3D filteredAngRates;44 Vector3Df filteredAngRates; 45 45 input->GetQuaternionAndAngularRates(quaternion, filteredAngRates); 46 46 output->SetQuaternionAndAngularRates(quaternion, filteredAngRates); -
trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.cpp
r157 r167 48 48 } 49 49 50 void TrajectoryGenerator2DCircle::StartTraj(const Vector2D &start_pos,50 void TrajectoryGenerator2DCircle::StartTraj(const Vector2Df &start_pos, 51 51 float nb_lap) { 52 52 pimpl_->StartTraj(start_pos, nb_lap); … … 57 57 void TrajectoryGenerator2DCircle::StopTraj(void) { pimpl_->is_running = false; } 58 58 59 void TrajectoryGenerator2DCircle::GetPosition(Vector2D &point) const {59 void TrajectoryGenerator2DCircle::GetPosition(Vector2Df &point) const { 60 60 point.x = pimpl_->output->Value(0, 0); 61 61 point.y = pimpl_->output->Value(0, 1); 62 62 } 63 63 64 void TrajectoryGenerator2DCircle::SetCenter(const Vector2D &value) {64 void TrajectoryGenerator2DCircle::SetCenter(const Vector2Df &value) { 65 65 pimpl_->pos_off = value; 66 66 } 67 67 68 void TrajectoryGenerator2DCircle::GetSpeed(Vector2D &point) const {68 void TrajectoryGenerator2DCircle::GetSpeed(Vector2Df &point) const { 69 69 point.x = pimpl_->output->Value(1, 0); 70 70 point.y = pimpl_->output->Value(1, 1); 71 71 } 72 72 73 void TrajectoryGenerator2DCircle::SetCenterSpeed(const Vector2D &value) {73 void TrajectoryGenerator2DCircle::SetCenterSpeed(const Vector2Df &value) { 74 74 pimpl_->vel_off = value; 75 75 } -
trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle.h
r15 r167 15 15 16 16 #include <IODevice.h> 17 #include <Vector2D.h> 17 18 18 19 namespace flair { 19 20 namespace core { 20 21 class cvmatrix; 21 class Vector2D;22 22 } 23 23 namespace gui { … … 72 72 * \param nb_lap number of laps, -1 for infinite 73 73 */ 74 void StartTraj(const core::Vector2D &start_pos, float nb_lap = -1);74 void StartTraj(const core::Vector2Df &start_pos, float nb_lap = -1); 75 75 76 76 /*! … … 93 93 * \param value center position 94 94 */ 95 void SetCenter(const core::Vector2D &value);95 void SetCenter(const core::Vector2Df &value); 96 96 97 97 /*! … … 100 100 * \param value center speed 101 101 */ 102 void SetCenterSpeed(const core::Vector2D &value);102 void SetCenterSpeed(const core::Vector2Df &value); 103 103 104 104 /*! … … 117 117 * \param point returned position 118 118 */ 119 void GetPosition(core::Vector2D &point) const;119 void GetPosition(core::Vector2Df &point) const; 120 120 121 121 /*! … … 124 124 * \param point returned speed 125 125 */ 126 void GetSpeed(core::Vector2D &point) const;126 void GetSpeed(core::Vector2Df &point) const; 127 127 128 128 /*! -
trunk/lib/FlairFilter/src/TrajectoryGenerator2DCircle_impl.cpp
r148 r167 64 64 } 65 65 66 void TrajectoryGenerator2DCircle_impl::StartTraj(const Vector2D &start_pos,66 void TrajectoryGenerator2DCircle_impl::StartTraj(const Vector2Df &start_pos, 67 67 float nb_lap) { 68 68 is_running = true; … … 89 89 float A = acceleration->Value(); 90 90 float R = rayon->Value(); 91 Vector2D v;91 Vector2Df v; 92 92 93 93 if (V < 0) -
trunk/lib/FlairFilter/src/unexported/TrajectoryGenerator2DCircle_impl.h
r15 r167 43 43 ~TrajectoryGenerator2DCircle_impl(); 44 44 void Update(flair::core::Time time); 45 void StartTraj(const flair::core::Vector2D &start_pos, float nb_lap);45 void StartTraj(const flair::core::Vector2Df &start_pos, float nb_lap); 46 46 void FinishTraj(void); 47 47 bool is_running; 48 48 flair::core::cvmatrix *output; 49 flair::core::Vector2D pos_off, vel_off;49 flair::core::Vector2Df pos_off, vel_off; 50 50 51 51 private: … … 53 53 float CurrentTime, FinishTime; 54 54 bool first_update, is_finishing; 55 flair::core::Vector2D pos;55 flair::core::Vector2Df pos; 56 56 float angle_off; 57 57 flair::gui::DoubleSpinBox *T, *veloctity, *acceleration, *rayon;
Note:
See TracChangeset
for help on using the changeset viewer.