Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
approach_moving_target.c File Reference
#include "generated/airframe.h"
#include "approach_moving_target.h"
#include "generated/modules.h"
#include "modules/core/abi.h"
#include "filters/low_pass_filter.h"
#include <stdio.h>
#include "modules/datalink/telemetry.h"
Include dependency graph for approach_moving_target.c:

Go to the source code of this file.

Data Structures

struct  AmtTelem

Macros

#define APPROACH_MOVING_TARGET_CUTOFF_FREQ_FILTERS_HZ   0.5
#define APPROACH_MOVING_TARGET_SLOPE   35.0
#define APPROACH_MOVING_TARGET_DISTANCE   60.0
#define APPROACH_MOVING_TARGET_SPEED   -1.0
#define APPROACH_MOVING_TARGET_ERR_SLOWDOWN_GAIN   0.25
#define APPROACH_MOVING_TARGET_POS_GAIN   0.3
#define APPROACH_MOVING_TARGET_SPEED_GAIN   1.0
#define APPROACH_MOVING_TARGET_RELVEL_GAIN   1.0
#define DEBUG_AMT   TRUE

Functions

struct FloatVect3 nav_get_speed_sp_from_diagonal (struct EnuCoor_i target, float pos_gain, float rope_heading)
void update_waypoint (uint8_t wp_id, struct FloatVect3 *target_ned)
static void send_approach_moving_target (struct transport_tx *trans, struct link_device *dev)
void approach_moving_target_init (void)
void approach_moving_target_set_low_pass_freq (float filter_freq)
void approach_moving_target_enable (uint8_t wp_id)
void follow_diagonal_approach (void)
 Generates a velocity reference from a diagonal approach path.

Variables

Butterworth2LowPass target_pos_filt [3]
Butterworth2LowPass target_vel_filt [3]
Butterworth2LowPass target_heading_filt
struct Amt amt
struct AmtTelem amt_telem
bool approach_moving_target_enabled = false

Detailed Description

Author
Ewoud Smeur e.j.j.nosp@m..sme.nosp@m.ur@tu.nosp@m.delf.nosp@m.t.nl Approach a moving target (e.g. ship)

Definition in file approach_moving_target.c.


Data Structure Documentation

◆ AmtTelem

struct AmtTelem

Definition at line 93 of file approach_moving_target.c.

Collaboration diagram for AmtTelem:
Data Fields
struct FloatVect3 des_pos
struct FloatVect3 des_vel

Macro Definition Documentation

◆ APPROACH_MOVING_TARGET_CUTOFF_FREQ_FILTERS_HZ

#define APPROACH_MOVING_TARGET_CUTOFF_FREQ_FILTERS_HZ   0.5

Definition at line 37 of file approach_moving_target.c.

◆ APPROACH_MOVING_TARGET_DISTANCE

#define APPROACH_MOVING_TARGET_DISTANCE   60.0

Definition at line 47 of file approach_moving_target.c.

◆ APPROACH_MOVING_TARGET_ERR_SLOWDOWN_GAIN

#define APPROACH_MOVING_TARGET_ERR_SLOWDOWN_GAIN   0.25

Definition at line 57 of file approach_moving_target.c.

◆ APPROACH_MOVING_TARGET_POS_GAIN

#define APPROACH_MOVING_TARGET_POS_GAIN   0.3

Definition at line 61 of file approach_moving_target.c.

◆ APPROACH_MOVING_TARGET_RELVEL_GAIN

#define APPROACH_MOVING_TARGET_RELVEL_GAIN   1.0

Definition at line 69 of file approach_moving_target.c.

◆ APPROACH_MOVING_TARGET_SLOPE

#define APPROACH_MOVING_TARGET_SLOPE   35.0

Definition at line 42 of file approach_moving_target.c.

◆ APPROACH_MOVING_TARGET_SPEED

#define APPROACH_MOVING_TARGET_SPEED   -1.0

Definition at line 52 of file approach_moving_target.c.

◆ APPROACH_MOVING_TARGET_SPEED_GAIN

#define APPROACH_MOVING_TARGET_SPEED_GAIN   1.0

Definition at line 65 of file approach_moving_target.c.

◆ DEBUG_AMT

#define DEBUG_AMT   TRUE

Definition at line 76 of file approach_moving_target.c.

Function Documentation

◆ approach_moving_target_enable()

void approach_moving_target_enable ( uint8_t wp_id)

Definition at line 161 of file approach_moving_target.c.

References amt, and get_sys_time_msec().

Here is the call graph for this function:

◆ approach_moving_target_init()

void approach_moving_target_init ( void )

Definition at line 119 of file approach_moving_target.c.

References amt, approach_moving_target_set_low_pass_freq(), DefaultPeriodic, register_periodic_telemetry(), and send_approach_moving_target().

Here is the call graph for this function:

◆ approach_moving_target_set_low_pass_freq()

void approach_moving_target_set_low_pass_freq ( float filter_freq)

Definition at line 127 of file approach_moving_target.c.

References amt, init_butterworth_2_low_pass(), target_heading_filt, target_pos_filt, and target_vel_filt.

Referenced by approach_moving_target_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ follow_diagonal_approach()

◆ nav_get_speed_sp_from_diagonal()

struct FloatVect3 nav_get_speed_sp_from_diagonal ( struct EnuCoor_i target,
float pos_gain,
float rope_heading )

References nav_get_speed_sp_from_diagonal(), and target.

Referenced by nav_get_speed_sp_from_diagonal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_approach_moving_target()

void send_approach_moving_target ( struct transport_tx * trans,
struct link_device * dev )
static

Definition at line 106 of file approach_moving_target.c.

References amt, amt_telem, and dev.

Referenced by approach_moving_target_init().

Here is the caller graph for this function:

◆ update_waypoint()

void update_waypoint ( uint8_t wp_id,
struct FloatVect3 * target_ned )

Definition at line 142 of file approach_moving_target.c.

References DefaultChannel, DefaultDevice, ENU_OF_TO_NED, waypoint_set_enu(), and waypoints.

Referenced by follow_diagonal_approach().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ amt

struct Amt amt
Initial value:
= {
.psi_ref = 180.0,
.enabled_time = 0,
.wp_id = 0,
}
#define APPROACH_MOVING_TARGET_CUTOFF_FREQ_FILTERS_HZ
#define APPROACH_MOVING_TARGET_POS_GAIN
#define APPROACH_MOVING_TARGET_RELVEL_GAIN
#define APPROACH_MOVING_TARGET_SPEED
#define APPROACH_MOVING_TARGET_SLOPE
#define APPROACH_MOVING_TARGET_DISTANCE
#define APPROACH_MOVING_TARGET_SPEED_GAIN
#define APPROACH_MOVING_TARGET_ERR_SLOWDOWN_GAIN

Definition at line 79 of file approach_moving_target.c.

Referenced by amt22_get_position(), amt22_get_turns(), amt22_init(), amt22_periodic(), amt22_read(), amt22_thd(), approach_moving_target_enable(), approach_moving_target_init(), approach_moving_target_set_low_pass_freq(), follow_diagonal_approach(), and send_approach_moving_target().

◆ amt_telem

struct AmtTelem amt_telem

◆ approach_moving_target_enabled

bool approach_moving_target_enabled = false

Definition at line 99 of file approach_moving_target.c.

◆ target_heading_filt

◆ target_pos_filt

◆ target_vel_filt