[Top][All Lists]

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

[Paparazzi-devel] How to use constants and variables in flight plans?

From: Jorn Anke
Subject: [Paparazzi-devel] How to use constants and variables in flight plans?
Date: Sat, 15 Dec 2012 23:41:43 +0100


I was reading the wiki about flight plans, and have a few questions about what is actually possible to do, with regard to variables and constants.

Copy-paste from the wiki:


Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C _expression_ is restricted to
  • numeric constants
  • some internal autopilot variables (not fully documented, see examples)
  • Some binary operators: <, >, <=, >=, <>, ==, +, -, /, *
  • Some utility functions"

Lets say I have these waypoints:

    <waypoint name="100" x="0" y="0"/>
    <waypoint name="101" x="200" y="0"/>
    <waypoint name="102" x="200" y="-100"/>
    <waypoint name="103" x="0" y="-100"/>
    <waypoint name="104" x="0" y="-20"/>

and this loop:
  <block name="Loop1">
      <for var="i" from="1" to="5">
        <go from="100" wp="101" hmode="route"/>
        <go from="101" wp="102" hmode="route"/>
        <go from="102" wp="103" hmode="route"/>
        <go from="103" wp="104" hmode="route"/>

Is it possible to define two constants; "delta_x" and "delta_y", and to offset the original waypoints by these values, times "i", for each turn of the loop?

If so, how?



reply via email to

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