paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Paparazzi-devel] In dev branch: automatic conversion to radians for ang


From: Felix Ruess
Subject: [Paparazzi-devel] In dev branch: automatic conversion to radians for angles specified in airframe file
Date: Thu, 15 Dec 2011 00:28:23 +0100

Hi all,

I just merged some changes/enhancements into the dev branch:

1) Save settings now gracefully handles values containing RadOfDeg(x)
or DegOfRad(x) and converts it to the correct unit when reading from
the airframe file. When saving the new value it will be correctly
written without that macro.

1) The attribute unit="x" is now also taken into account when parsing
the defines and generating airframe.h. I added the attribute
"code_unit" to section defines which is used to automatically convert
the specified value from unit to code_unit.

 *  if unit and code_unit are specified the value is converted to
code_unit and then written to the generated airframe.h file
 *  this works for default units like deg<->rad, m<->mm, etc.
 *  only works if the contents of the value attribute can be converted
to float, otherwise string is simply copied like before
 *  special treatment for unit="deg": if code_unit is not specified,
will be converted to rad nevertheless, if this is not wanted
explicitly specify code_unit="deg"

E.g. now you can write
  <section name="INS" prefix="INS_">
    <define name="ROLL_NEUTRAL_DEFAULT" value="-4.0" unit="deg"/>
    <define name="PITCH_NEUTRAL_DEFAULT" value="3.5" unit="deg"/>
  </section>
instead of
  <section name="INS" prefix="INS_">
    <define name="ROLL_NEUTRAL_DEFAULT" value="-0.0698" unit="rad"/>
    <define name="PITCH_NEUTRAL_DEFAULT" value="RadOfDeg(3.5)" unit="rad"/>
  </section>

I didn't add a code_unit_coef (analog to alt_unit_coef) so far, but an
be easily done if needed.

All the airframe files in the repo have been updated accordingly and I
think are more readable and easier to use now.
Also all settings files for roll and pitch neutrals have the units set
correctly to actually display that in degrees.

When saving the settings the values are still always displayed in the
actual unit (e.g. rad).

Regarding radians in the cam stuff: the defines

    CAM_PAN_MAX
    CAM_PAN_MIN
    CAM_PAN_NEUTRAL
    CAM_PAN0
    CAM_PAN_POSITION_FOR_FPV
    CAM_TILT_MAX
    CAM_TILT_MIN
    CAM_TILT_NEUTRAL
    CAM_TILT0
    CAM_TILT_POSITION_FOR_FPV

are still in degrees and need to be defined in the airframe file
either without any unit or with unit and code_unit both set to deg:
<define name="TILT_MAX" value="45" unit="deg" code_unit="deg"/>
This has already been done for the airframes in the repo.

The booz_cam stuff seems actually to be fine in radians or degrees...

Cheers, Felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]