//cout << "prev_alt" <<prev_alt << endl;
d_alt = (curr_alt - prev_alt) * SG_METER_TO_FEET;
//_elevation = prev->altitude;
//cout << "prev_alt" <<prev_alt << endl;
d_alt = (curr_alt - prev_alt) * SG_METER_TO_FEET;
//_elevation = prev->altitude;
- distance = SGGeodesy::distanceM(SGGeod::fromDeg(prev->longitude, prev->latitude),
- SGGeod::fromDeg(curr->longitude, curr->latitude));
+ distance = SGGeodesy::distanceM(SGGeod::fromDeg(prev->getLongitude(), prev->getLatitude()),
+ SGGeod::fromDeg(curr->getLongitude(), curr->getLatitude()));
_pitch = atan2(d_alt, distance * SG_METER_TO_FEET) * SG_RADIANS_TO_DEGREES;
//cout << "new waypoint, calculating pitch " << _pitch <<
// " " << _pitch_offset << " " << _elevation <<endl;
}
double distance_to_go = SGGeodesy::distanceM(SGGeod::fromDeg(pos.getLongitudeDeg(), pos.getLatitudeDeg()),
_pitch = atan2(d_alt, distance * SG_METER_TO_FEET) * SG_RADIANS_TO_DEGREES;
//cout << "new waypoint, calculating pitch " << _pitch <<
// " " << _pitch_offset << " " << _elevation <<endl;
}
double distance_to_go = SGGeodesy::distanceM(SGGeod::fromDeg(pos.getLongitudeDeg(), pos.getLatitudeDeg()),
/*cout << "tunnel " << _tunnel
<< " distance prev & curr " << prev->name << " " << curr->name << " " << distance * SG_METER_TO_FEET
/*cout << "tunnel " << _tunnel
<< " distance prev & curr " << prev->name << " " << curr->name << " " << distance * SG_METER_TO_FEET
- while(fp->getNextWaypoint() != 0 && fp->getNextWaypoint()->name != "END" && count < 5){
- SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
+ while(fp->getNextWaypoint() != 0 && fp->getNextWaypoint()->getName() != "END" && count < 5){
+ SG_LOG(SG_AI, SG_DEBUG, "AIGroundVeh1cle: " << _name
- if (fp->getNextWaypoint()->name == parent_next_name){
- SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
- << " not setting waypoint already at: " << fp->getNextWaypoint()->name);
+ if (fp->getNextWaypoint()->getName() == parent_next_name){
+ SG_LOG(SG_AI, SG_DEBUG, "AIGroundVeh1cle: " << _name
+ << " not setting waypoint already at: " << fp->getNextWaypoint()->getName());
- if (fp->getNextWaypoint()->name == parent_next_name){
- SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
- << " waypoint set to: " << fp->getNextWaypoint()->name);
+ if (fp->getNextWaypoint()->getName() == parent_next_name){
+ SG_LOG(SG_AI, SG_DEBUG, "AIGroundVeh1cle: " << _name
+ << " waypoint set to: " << fp->getNextWaypoint()->getName());
- if (fp->getNextWaypoint()->name == parent_next_name){
- SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
- << " not setting waypoint already at:" << fp->getNextWaypoint()->name );
+ if (fp->getNextWaypoint()->getName() == parent_next_name){
+ SG_LOG(SG_AI, SG_DEBUG, "AIGroundVeh1cle: " << _name
+ << " not setting waypoint already at:" << fp->getNextWaypoint()->getName() );
- if (fp->getNextWaypoint()->name == parent_next_name){
- SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
- << " waypoint set to: " << fp->getNextWaypoint()->name);
+ if (fp->getNextWaypoint()->getName() == parent_next_name){
+ SG_LOG(SG_AI, SG_DEBUG, "AIGroundVeh1cle: " << _name
+ << " waypoint set to: " << fp->getNextWaypoint()->getName());
bool parent_waiting = _selected_ac->getBoolValue("waypoint/waiting");
//bool parent_restart = _selected_ac->getBoolValue("controls/restart");
bool parent_waiting = _selected_ac->getBoolValue("waypoint/waiting");
//bool parent_restart = _selected_ac->getBoolValue("controls/restart");
- if (parent_next_name == "END" && fp->getNextWaypoint()->name != "END" ){
- SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
+ if (parent_next_name == "END" && fp->getNextWaypoint()->getName() != "END" ){
+ SG_LOG(SG_AI, SG_DEBUG, "AIGroundVeh1cle: " << _name
if(_restart) _missed_count = 200;
/*} else if (parent_next_name == "WAIT" && fp->getNextWaypoint()->name != "WAIT" ){*/
} else if (parent_waiting && !_waiting){
if(_restart) _missed_count = 200;
/*} else if (parent_next_name == "WAIT" && fp->getNextWaypoint()->name != "WAIT" ){*/
} else if (parent_waiting && !_waiting){
- } else if (parent_next_name != "WAIT" && fp->getNextWaypoint()->name == "WAIT"){
- SG_LOG(SG_GENERAL, SG_DEBUG, "AIGroundVeh1cle: " << _name
+ } else if (parent_next_name != "WAIT" && fp->getNextWaypoint()->getName() == "WAIT"){
+ SG_LOG(SG_AI, SG_DEBUG, "AIGroundVeh1cle: " << _name
<< " wait done: getting new waypoints ");
_waiting = false;
_wait_count = 0;
fp->IncrementWaypoint(false);
next = fp->getNextWaypoint();
<< " wait done: getting new waypoints ");
_waiting = false;
_wait_count = 0;
fp->IncrementWaypoint(false);
next = fp->getNextWaypoint();