Changeset 432 in flair-src for trunk/lib/FlairMeta/src/UavStateMachine.cpp
- Timestamp:
- Jul 12, 2021, 11:19:21 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairMeta/src/UavStateMachine.cpp
r422 r432 53 53 54 54 UavStateMachine::UavStateMachine(TargetController *controller): 55 56 57 58 55 Thread(getFrameworkManager(),"UavStateMachine",50), 56 uav(GetUav()),controller(controller),failSafeMode(true),flagConnectionLost(false),flagBatteryLow(false),flagCriticalSensorLost(false),flagZTrajectoryFinished(false),safeToFly(true){ 57 altitudeState=AltitudeState_t::Stopped; 58 uav->UseDefaultPlot(); 59 59 60 60 Tab *uavTab = new Tab(getFrameworkManager()->GetTabWidget(), "uav", 0); … … 112 112 uav->GetMetaUsRangeFinder()->GetVzPlot()->AddCurve( 113 113 altitudeTrajectory->GetMatrix()->Element(1), DataPlot::Green); 114 115 failSafeAltitudeSensor=uav->GetMetaUsRangeFinder(); 114 116 } 115 117 … … 125 127 126 128 const TargetController *UavStateMachine::GetTargetController(void) const { 127 129 return controller; 128 130 } 129 131 130 132 MetaDualShock3 *UavStateMachine::GetJoystick(void) const { 131 133 return joy; 132 134 } 133 135 … … 138 140 const Vector3Df &UavStateMachine::GetCurrentAngularSpeed(void) const { 139 141 return currentAngularSpeed; 142 } 143 144 void UavStateMachine::SetFailSafeAltitudeSensor(AltitudeSensor *altitudeSensor) { 145 Warn("Replacing the FailSafeAltitudeSensor with %s\n",altitudeSensor->ObjectName().c_str()); 146 failSafeAltitudeSensor=altitudeSensor; 140 147 } 141 148 … … 147 154 void UavStateMachine::FailSafeAltitudeValues(float &altitude, 148 155 float &verticalSpeed) const { 149 altitude = uav->GetMetaUsRangeFinder()->z();150 verticalSpeed = uav->GetMetaUsRangeFinder()->Vz();156 altitude = failSafeAltitudeSensor->z(); 157 verticalSpeed = failSafeAltitudeSensor->Vz(); 151 158 159 //a mettre dans le metausrangefinder? 160 //on ne sait pas si failSafeAltitudeSensor est vrpn (dans ce cas pas besoin de rotation) 161 //ou un us range finder 152 162 //+0.04 decalage en z de l'us en simulation 153 163 //faire un reglage
Note:
See TracChangeset
for help on using the changeset viewer.