Seamus Thomas Carroll wrote:
I am trying to update my autopilot route code to reflect the latest changes. I read a set of points from a table in a database. I used to use globals->get_route()->add_waypoint( *wp );
to add the waypoints and then I would activate the autopilot by calling,
globals->get_autopilot()->set_HeadingEnabled( true );
globals->get_autopilot()->set_HeadingMode( FGAutopilot::FG_HEADING_WAYPOINT );


I am now adding waypoints using:
FGRouteMgr *rm = (FGRouteMgr *)globals->get_subsystem("route-manager");
SGWayPoint *wp = new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, id );
rm->add_waypoint( *wp );

The question now is how to activate the autopilot. I tried
fgSetString( "/autopilot/locks/heading", "true-heading-hold" ); but this does not result in a change of the flight path.


I am guessing that I am missing one line of code and any help would be greatly appreciated,

Seamus,


I believe it is set up so that as long as you have a route, the route manager will update the target true heading. Your call to set /autopilot/locks/heading looks correct to me.

fgSetString( "/autopilot/locks/heading", "true-heading-hold" );

The hud should show your way points if they are created correctly.

Regards,

Curt.
--
Curtis Olson   Intelligent Vehicles Lab         FlightGear Project
Twin Cities    [EMAIL PROTECTED]                  [EMAIL PROTECTED]
Minnesota      http://www.menet.umn.edu/~curt   http://www.flightgear.org


_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to