On Friday 11 January 2008 21:50, Curtis Olson wrote:
> On Jan 11, 2008 3:14 PM, Roy Vegard Ovesen wrote:
> > On Friday 11 January 2008, LeeE wrote:
> > > I've had a look at the relevant code but as I'm not up on c++
> > > I'm not sure about what I'm looking at but at lines 798-802
> > > there's:
> > >
> > > void FGXMLAutopilot::reinit() {
> > >     components.clear();
> > >     init();
> > >     build();
> > > }
> > >
> > > I could find init() & build() and thought that
> > > components.clear() must be what removes old instances and
> > > must be a more generic function.  However, when I grepped
> > > through the SimGear & FlightGear source the only occurrence I
> > > could find of this function was at that single point in
> > > xmlauto.cxx.  I then searched for components.clear() in C/C++
> > > reference manuals on the web and didn't find anything there
> > > either.  Perhaps I just wasn't looking in the right place
> > > though.
> > >
> > > In any case, it seems strange to me that if
> > > components.clear() is a generic function, it's only used in
> > > this one place in the entire SG/FG source.
> >
> > Actually it's only the clear() part that it "generic". clear()
> > is a method of
> > the vector template.
> >
> > > I might be barking up the wrong tree entirely here, but I
> > > can't see what else might be causing the behaviour I'm
> > > seeing.
> >
> > Try commenting out the call to build() from the code that you
> > quoted above.
> > build() is called inside init(), so there should be no need to
> > call it again
> > after init().
>
> I suspect the build() is there so you can change the autopilot
> config file while flying and reload it.  That way you don't need
> to restart the sim to fiddle with the gains.
>
> Curt.

I'll give what Roy suggests a try - build() is called from within 
init() and build() creates new controller, predictor and filter 
nodes (if I'm interpreting it correctly).  If it's being called 
twice, after clear() then it might explain something.

No problem to give it a try - I'll post back after re-compiling.

LeeE

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to