js_demo returns the following values for my MacAlly joystick on mac os x 10.3.3

JS.0

Axis 0: Ailerons (-0.5 to +0.4)
Axis 1: Elevator (-0.5 to +0.5)
Axis 2: Throttle (-1 to +0.0)
Axis 3:  Horiz. Hat (-1.0 to +1.0)
Axis 4: Vert. Hat (-1.0 to +1.0)

Q1: How can I use the above information to figure out what values should go in my xml file? I've been looking at data/Docs/README.Joystick.html, but I am probably missing something obvious. How can I calculate what the factor should be: when I move the stick, it only moves about 1/8th of the way down the HUD even when I'm yanking the stick all of the way back/forward/whatever. Changing the factor to 5, 20, 100 doesn't seem to change anything for me. Also the throttle can only change between 50% and 100% throttle via the joystick, nothing I change in the XML file seems to have any effect.

Q2: Is there documentation on the Nasal information? What needs to be done to use nasal to control the joystick as shown below (from the default joystick)? Is this the official way to go now for joysticks?
<axis n="2">
<desc>Throttle</desc>
<binding>
<command>nasal</command>
<script>controls.throttleAxis()</script>
</binding>
</axis>




I am using the following .xml file for my sort-of working joystick:
<?xml version="1.0"?>

<!--
************************************************************************
Setup for a MacALLY USB iStick joystick with
one stick, one wheel, one digital hat, and four buttons.

Layout:
  Axis 0: ailerons
  Axis 1: elevator
  Axis 2: throttle

  Hat:
        Axes 3 and 4

  Button 0: brakes (front button)
  Button 1: center rudder (side button)
  Button 2: trim up
  Button 3: trim down
************************************************************************
-->

<PropertyList>

<name>MacAlly USB Joystick </name>

 <axis n="0">
  <desc>Aileron</desc>
  <dead-band type="double">0.02</dead-band>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/aileron</property>
   <offset type="double">0.0</offset>
   <factor type="double">1.0</factor> <!-- 1.0 -->
  </binding>
 </axis>

 <axis n="1">
  <desc>Elevator</desc>
  <dead-band type="double">0.02</dead-band>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/elevator</property>
   <offset type="double">0.0</offset>
   <factor type="double">1.0</factor>
  </binding>
 </axis>

  <axis n="2">
  <desc>Throttle</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/engines/engine[3]/throttle</property>
   <offset type="double">-1.0</offset>   <!-- -1.0 -->
   <factor type="double">-0.5</factor>   <!-- -0.5 -->
  </binding>

 </axis>
  <axis n="3">
  <desc>Rudder</desc>
  <dead-band type="double">0.02</dead-band>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/rudder</property>
   <offset type="double">0.0</offset>   <!-- -1.0 -->
   <factor type="double">1.0</factor>   <!-- -0.5 -->
  </binding>

</axis>


<!-- ************************************************************************ <axis n="0"> <desc>Aileron</desc> <binding> <command>property-scale</command> <property>/controls/flight/aileron</property> <squared type="bool">true</squared> </binding> </axis>

 <axis n="1">
  <desc>Elevator</desc>
  <binding>
   <command>property-scale</command>
   <property>/controls/flight/elevator</property>
   <factor type="double">-1.0</factor>
   <squared type="bool">true</squared>
  </binding>
 </axis>



 <axis n="2">
  <desc>Throttle</desc>
  <binding>
   <command>nasal</command>
   <script>controls.throttleAxis()</script>
  </binding>
 </axis>

************************************************************************
-->

 <button n="0">
  <desc>Brakes</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/gear/wheel[0]/brake</property>
   <value type="double">1.0</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/controls/gear/wheel[1]/brake</property>
   <value type="double">1.0</value>
  </binding>
  <binding>
   <command>property-assign</command>
   <property>/controls/gear/wheel[2]/brake</property>
   <value type="double">1.0</value>
  </binding>
  <mod-up>
   <binding>
    <command>property-assign</command>
    <property>/controls/gear/wheel[0]/brake</property>
    <value type="double">0.0</value>
   </binding>
   <binding>
    <command>property-assign</command>
    <property>/controls/gear/wheel[1]/brake</property>
    <value type="double">0.0</value>
   </binding>
   <binding>
    <command>property-assign</command>
    <property>/controls/gear/wheel[2]/brake</property>
    <value type="double">0.0</value>
   </binding>
  </mod-up>
 </button>

 <button n="1">
  <desc>Elevator trimup</desc>
  <repeatable>true</repeatable>
   <binding>
   <command>property-adjust</command>
   <property>/controls/flight/flaps</property>
   <step type="double">0.001</step>
  </binding>
 </button>

 <button n="2">
  <desc>Center rudder</desc>
  <binding>
   <command>property-assign</command>
   <property>/controls/flight/rudder</property>
   <value type="double">0.0</value>
  </binding>
 </button>

 <button n="3">
  <desc>Elevator trim down</desc>
  <repeatable>true</repeatable>
   <binding>
   <command>property-adjust</command>
   <property>/controls/flight/elevator-trim</property>
   <step type="double">0.001</step>
  </binding>
 </button>


</PropertyList>


<!-- end of MAUSBJS.xml -->


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

Reply via email to