Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
approach_moving_target module

Approach a moving target (e.g

ship) along a diagonal.

Example for airframe file

Add to your firmware section:

<module name="approach_moving_target"/>

Module configuration options

Airframe file section

  • section name: APPROACH_MOVING_TARGET prefix: APPROACH_MOVING_TARGET_
    • name CUTOFF_FREQ_FILTERS_HZ value: 0.5
      Description: low pass filter on WP position
    • name SLOPE value: 35.0
      Description: [degrees] the angle of the slope for the approach
    • name DISTANCE value: 60.0
      Description: [m] the initial distance to start the approach
    • name SPEED value: -1.0
      Description: [m/s] the approach speed along the slope
    • name ERR_SLOWDOWN_GAIN value: 0.25
      Description: slowing down when arriving
    • name POS_GAIN value: -1.0
      Description: P-gain
    • name SPEED_GAIN value: -1.0
      Description: D-gain
    • name RELVEL_GAIN value: -1.0
      Description: RelVel-gain

Module functions

Init Functions

These initialization functions are called once on startup.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

  • follow_diagonal_approach()
    • Frequency in Hz: 100.0
    • Autorun: LOCK
      Periodic function automatically starts after init and can't be stopped.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw approach_moving_target.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="approach_moving_target" dir="ctrl">
<doc>
<description>
Approach a moving target (e.g. ship) along a diagonal.
</description>
<section name="APPROACH_MOVING_TARGET" prefix="APPROACH_MOVING_TARGET_">
<define name="CUTOFF_FREQ_FILTERS_HZ" value="0.5" description="low pass filter on WP position"/>
<define name="SLOPE" value="35.0" description="[degrees] the angle of the slope for the approach"/>
<define name="DISTANCE" value="60.0" description="[m] the initial distance to start the approach"/>
<define name="SPEED" value="-1.0" description="[m/s] the approach speed along the slope"/>
<define name="ERR_SLOWDOWN_GAIN" value="0.25" description="slowing down when arriving"/>
<define name="POS_GAIN" value="-1.0" description="P-gain"/>
<define name="SPEED_GAIN" value="-1.0" description="D-gain"/>
<define name="RELVEL_GAIN" value="-1.0" description="RelVel-gain"/>
</section>
</doc>
<settings>
<dl_settings>
<dl_settings NAME="Approach">
<dl_setting var="amt.psi_ref" min="-180." max="180." step="1.0" shortname="psi_app" unit="degrees"/>
<dl_setting var="amt.slope_ref" min="0." max="80." step="1.0" shortname="slope_app" unit="degrees" param="APPROACH_MOVING_TARGET_SLOPE"/>
<dl_setting var="amt.speed" min="-5.0" max="5." step="0.1" shortname="speed" unit="m/s" param="APPROACH_MOVING_TARGET_SPEED" />
<dl_setting var="amt.distance" min="0.0" max="200." step="1.0" shortname="dist" unit="m" param="APPROACH_MOVING_TARGET_DISTANCE"/>
<dl_setting var="amt.err_slowdown_gain" min="0.0" max="4." step="0.01" shortname="slwdn_gain" param="APPROACH_MOVING_TARGET_ERR_SLOWDOWN_GAIN"/>
<dl_setting var="amt.pos_gain" min="0.05" max="3.0" step="0.01" shortname="pos_gain" param="APPROACH_MOVING_TARGET_POS_GAIN"/>
<dl_setting var="amt.speed_gain" min="0.0" max="1.0" step="0.01" shortname="speed_gain" param="APPROACH_MOVING_TARGET_SPEED_GAIN"/>
<dl_setting var="amt.relvel_gain" min="0.0" max="1.0" step="0.01" shortname="relvel_gain" param="APPROACH_MOVING_TARGET_RELVEL_GAIN"/>
<dl_setting var="amt.cutoff_freq_filters_hz" min="0.3" max="2.0" step="0.01" shortname="filter_freq" module="ctrl/approach_moving_target" handler="set_low_pass_freq" param="APPROACH_MOVING_TARGET_CUTOFF_FREQ_FILTERS_HZ"/>
</dl_settings>
</dl_settings>
</settings>
<dep>
<depends>target_pos</depends>
</dep>
<header>
<file name="approach_moving_target.h"/>
</header>
<init fun="approach_moving_target_init()"/>
<periodic fun="follow_diagonal_approach()" freq="100.0"/>
<makefile>
<file name="approach_moving_target.c"/>
</makefile>
</module>