Changeset 167 in flair-src for trunk/demos/SimpleFleet/uav/src
- Timestamp:
- Apr 12, 2017, 1:59:38 PM (8 years ago)
- Location:
- trunk/demos/SimpleFleet/uav/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/demos/SimpleFleet/uav/src/SimpleFleet.cpp
r136 r167 111 111 //get roll, pitch and w from imu 112 112 Quaternion ahrsQuaternion; 113 Vector3D ahrsAngularSpeed;113 Vector3Df ahrsAngularSpeed; 114 114 GetDefaultOrientation()->GetQuaternionAndAngularRates(ahrsQuaternion, ahrsAngularSpeed); 115 115 … … 124 124 125 125 void SimpleFleet::AltitudeValues(float &z,float &dz) const { 126 Vector3D uav_pos,uav_vel;126 Vector3Df uav_pos,uav_vel; 127 127 128 128 uavVrpn->GetPosition(uav_pos); … … 134 134 135 135 const AhrsData *SimpleFleet::GetReferenceOrientation(void) { 136 Vector2D pos_err, vel_err; // in uav coordinate system136 Vector2Df pos_err, vel_err; // in uav coordinate system 137 137 float yaw_ref; 138 138 Euler refAngles; … … 150 150 refAngles.roll=-u_y->Output(); 151 151 152 customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3D (0,0,0));152 customReferenceOrientation->SetQuaternionAndAngularRates(refAngles.ToQuaternion(),Vector3Df(0,0,0)); 153 153 154 154 return customReferenceOrientation; 155 155 } 156 156 157 void SimpleFleet::PositionValues(Vector2D &pos_error,Vector2D&vel_error,float &yaw_ref) {158 Vector3D uav_pos,uav_vel; // in VRPN coordinate system159 Vector2D uav_2Dpos,uav_2Dvel; // in VRPN coordinate system157 void SimpleFleet::PositionValues(Vector2Df &pos_error,Vector2Df &vel_error,float &yaw_ref) { 158 Vector3Df uav_pos,uav_vel; // in VRPN coordinate system 159 Vector2Df uav_2Dpos,uav_2Dvel; // in VRPN coordinate system 160 160 161 161 uavVrpn->GetPosition(uav_pos); … … 171 171 yaw_ref=yawHold; 172 172 } else { //Circle 173 Vector2D circle_pos,circle_vel;174 Vector2D target_2Dpos;173 Vector2Df circle_pos,circle_vel; 174 Vector2Df target_2Dpos; 175 175 176 176 //circle center … … 318 318 return; 319 319 } 320 Vector3D uav_pos;321 Vector2D uav_2Dpos,target_2Dpos;320 Vector3Df uav_pos; 321 Vector2Df uav_2Dpos,target_2Dpos; 322 322 323 323 //circle center … … 352 352 yawHold=vrpnQuaternion.ToEuler().yaw; 353 353 354 Vector3D vrpnPosition;354 Vector3Df vrpnPosition; 355 355 uavVrpn->GetPosition(vrpnPosition); 356 356 vrpnPosition.To2Dxy(posHold); -
trunk/demos/SimpleFleet/uav/src/SimpleFleet.h
r135 r167 63 63 const flair::core::AhrsData *GetOrientation(void) const; 64 64 void AltitudeValues(float &z,float &dz) const; 65 void PositionValues(flair::core::Vector2D &pos_error,flair::core::Vector2D&vel_error,float &yaw_ref);65 void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref); 66 66 const flair::core::AhrsData *GetReferenceOrientation(void); 67 67 void SignalEvent(Event_t event); … … 70 70 flair::filter::Pid *u_x, *u_y; 71 71 72 flair::core::Vector2D posHold;72 flair::core::Vector2Df posHold; 73 73 float yawHold; 74 74 flair::core::Socket *message;
Note:
See TracChangeset
for help on using the changeset viewer.