Melchior FRANZ
>
> * Vivian Meazza -- Saturday 18 June 2005 12:22:
> > void Thruster::setThrottle(float throttle)
> > {
> > _throttle = Math::clamp(throttle, 0, 1);
> > }
> >
> > Will this prevent a negative value for:
> >
> > <control-input axis="/controls/engines/engine[0]/boost-control"
> > control="THROTTLE"/>
>
> No, but this will:
>
> ControlMap.cpp:83:----------------------------------------------------
>
> map->src0 = map->dst0 = rangeMin(type);
>
>
> ControlMap.cpp:222:---------------------------------------------------
>
> float ControlMap::rangeMin(int type)
> {
> // The minimum of the range for each type of control
> switch(type) {
> case FLAP0: return -1; // [-1:1]
> case FLAP1: return -1;
> case STEER: return -1;
> case CYCLICELE: return -1;
> case CYCLICAIL: return -1;
> case COLLECTIVE: return -1;
> case MAGNETOS: return 0; // [0:3]
> default: return 0; // [0:1]
> }
> }
>
>
> There's no THROTTLE, so we get the default 0 set for map->{src,dst}0.
> You can avoid that by setting {src,dst}{0,1} explicitly, for example:
>
> <control-input axis="/controls/engines/engine[0]/boost-control"
> src0="-1" src1="1" dst0="-1" dst1="1"
> control="THROTTLE"/>
>
Right - that fixes the problem.
Before:
In the config file:
<control-input axis="/controls/engines/engine[0]/throttle"
control="THROTTLE"/>
<control-input axis="/controls/engines/engine[0]/boost-control"
control="THROTTLE"/>
Outcome:
boost: 0
type: hurricaneIIb
YASim solution results:
Iterations: 1
Drag Coefficient: 1000
Lift Ratio: 1
Cruise AoA: 0
Tail Incidence: -0
Approach Elevator: 0
CG: -3.412, 0.000, -0.201
After:
In the config file:
<control-input axis="/controls/engines/engine[0]/throttle"
control="THROTTLE"/>
<control-input axis="/controls/engines/engine[0]/boost-control"
src0="-1" src1="1" dst0="-1" dst1="1"
control="THROTTLE"/>
Outcome:
boost: 0
type: hurricaneIIb
YASim solution results:
Iterations: 2202
Drag Coefficient: 6.39448
Lift Ratio: 886.777
Cruise AoA: 2.52573
Tail Incidence: -2.34135
Approach Elevator: -0.270048
CG: -3.420, 0.000, -0.200
The 2 throttle axes are additive now. All seems to be OK to move onto the
next phase: put something meaningful in
="/controls/engines/engine[0]/boost-control".
My WAG is that the problem is that
="/controls/engines/engine[0]/boost-control" is being initiated with
something that YASim doesn't like, Melchior's addition sorts that out.
Thanks Melchior - good spot.
Regards,
Vivian
_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d