Hi Erik

Thanks for the input, by the way I thought that bidirectional transmission
was unsupported.  I tried to put both my input and outputs in the same xml
file and choose bi directional support but I keeping getting an error
message saying that bidirectional support is not supported, I have included
the .xml file I've been using so you can take a look is there something that
I'm doing wrong?

On Mon, Aug 8, 2011 at 3:19 AM, Erik Hofman <e...@ehofman.com> wrote:

>  On Sun, 2011-08-07 at 20:33 -0400, Derrick Washington wrote:
> >  Hi
> >
> >    I need to know if the inputs coming from FG, while using a generic
> > protocol having binary mode set to true, are coming in as integers
> > that need to be converted to floating point or is FG actually sending
> > in a floating point word, a byte at a time?  So my code to receive FG
> > data looks something like this....
> >
> >
> > for ( int i = 0; i <= 3; i++ ) { dummy_var = (dummy_var << 8) |
> > rs232_uart1; }
> >
> >   return ( (float) dummy_var);
> >
> > What I am wondering is, is the " return ( (float) dummy_var); " cast
> > to a float necessary, or is the number already in floating point
> > format, if so then I need to instruct my hardware to retrieve a full
> > word at a time.  I've included the xml file just in case you guys have
> > any questions about what data I am asking FG to transmit.
>
> Floats are sent as floats and (depending on which version of FlightGear
> you're using, doubles as doubles but they where added in a later
> version).
>
> BTW you can (and have to) specify a separate section for input and for
> output in the same protocol configuration file if you want
> bi-directional communication.
>
> Erik
>
>
>
>
> ------------------------------------------------------------------------------
> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
<?xml version="1.0"?> 
<PropertyList>
<generic>


<!--  INPUT CONTROLS  


<line_separator>\n</line_separator>	
	<var_separator>,</var_separator>
	
	<chunk>
         <name>Gears </name>
	   <type>float</type>
         <node>/controls/gear/gear-down</node>  
        </chunk>

-->

  <input>
	<line_separator>\n</line_separator>	
	<var_separator>,</var_separator>

	<chunk>
         <name>Throttle (rad)</name>
	   <type>integer</type>
         <node>/controls/engines/engine[0]/throttle</node>  
        </chunk>

	<chunk>
         <name>Throttle (rad)</name>
	   <type>integer</type>
         <node>/controls/engines/engine[1]/throttle</node>  
        </chunk>

	<chunk>
         <name>Aileron (rad)</name>
	   <type>float</type>
         <node>/controls/flight/aileron</node>  
        </chunk>

	<chunk>
         <name>Elevator (rad)</name>
	   <type>float</type>
         <node>/controls/flight/elevator</node> 
        </chunk>

	<chunk>
         <name>rudder (rad)</name>
	   <type>float</type>
         <node>/controls/flight/rudder</node> 
        </chunk>

	

	<chunk>
         <name>Steering </name>
	   <type>float</type>
         <node>/controls/gear/steering</node>  
        </chunk>

   </input>

   <output>

     	<binary_mode>true</binary_mode>

<!--  GPS output of course to allow the plane to actually fly to it destination, and for some angle calculations -->

     <chunk>
       <name>Speed</name>
       <node>/velocities/airspeed-kt</node>
     </chunk>

     <chunk>
       <name>Altitude </name>
       <node>/position/altitude-ft</node>  
     </chunk>

      <chunk>
       <name>Latitude-deg </name>
       <node>/position/latitude-deg</node> 
     </chunk>

     <chunk>
       <name>Longitude-deg (rad)</name>
       <node>/position/longitude-deg</node> 
     </chunk>

<!--  Orientation angular rate outputs to allow my HiL to calculate the orientation angles -->

    <chunk>
       <name>Pitch rate (deg per sec)</name>
       <node>/orientation/pitch-rate-degps</node>
     </chunk>

     <chunk>
       <name>Roll rate (deg per sec)</name>
       <node>/orientation/roll-rate-degps</node>
     </chunk>

     <chunk>
       <name>Yaw Rate (deg per sec )</name>
       <node>/orientation/yaw-rate-degps</node>
     </chunk>

<!-- Accelerometer magnitude outputs to allow my HiL to calculate the orientation angles -->  
 
     <chunk>
       <name>Accelerometer X (ft per sec)</name>
       <node>/accelerations/x-accel-fps_sec</node>
     </chunk>

     <chunk>
       <name>Accelerometer Y (ft per sec)</name>
       <node>/accelerations/y-accel-fps_sec</node>
     </chunk>

     <chunk>
       <name>Accelerometer Z (ft per sec)</name>
       <node>/accelerations/z-accel-fps_sec</node>
     </chunk>

<!--  Orientation Angles output for comparason with calculated angles done by my HiL 

     <chunk>
       <name>Roll Angle (deg)</name>
       <node>/orientation/roll-deg</node>
     </chunk>

     <chunk>
       <name>Pitch Angle (deg)</name>
       <node>/orientation/pitch-deg</node>
     </chunk>

     <chunk>
       <name>Yaw Rate (deg)</name>
       <node>/orientation/yaw-deg</node>
     </chunk>
													-->
  </output>

</generic>
</PropertyList>
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to