Paparazzi UAS  v6.2.0_stable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
approach_moving_target.c File Reference
#include "approach_moving_target.h"
#include "generated/modules.h"
#include "modules/core/abi.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 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_enable (uint8_t wp_id)
 
void follow_diagonal_approach (void)
 Generates a velocity reference from a diagonal approach path. More...
 

Variables

float amt_err_slowdown_gain = AMT_ERR_SLOWDOWN_GAIN
 
float approach_moving_target_angle_deg
 
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 50 of file approach_moving_target.c.

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

Macro Definition Documentation

◆ DEBUG_AMT

#define DEBUG_AMT   TRUE

Definition at line 35 of file approach_moving_target.c.

Function Documentation

◆ approach_moving_target_enable()

void approach_moving_target_enable ( uint8_t  wp_id)

Definition at line 102 of file approach_moving_target.c.

References amt, Amt::enabled_time, get_sys_time_msec(), and Amt::wp_id.

+ Here is the call graph for this function:

◆ approach_moving_target_init()

void approach_moving_target_init ( void  )

Definition at line 76 of file approach_moving_target.c.

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

+ Here is the call graph for this function:

◆ follow_diagonal_approach()

void follow_diagonal_approach ( void  )

Generates a velocity reference from a diagonal approach path.

Definition at line 111 of file approach_moving_target.c.

◆ nav_get_speed_sp_from_diagonal()

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

◆ send_approach_moving_target()

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

Definition at line 63 of file approach_moving_target.c.

References amt, amt_telem, AmtTelem::des_pos, AmtTelem::des_vel, dev, Amt::distance, FloatVect3::x, FloatVect3::y, and FloatVect3::z.

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 84 of file approach_moving_target.c.

References DefaultChannel, DefaultDevice, ENU_OF_TO_NED, waypoint_set_enu(), waypoints, point::x, and point::y.

+ Here is the call graph for this function:

Variable Documentation

◆ amt

struct Amt amt
Initial value:
= {
.distance = 60,
.speed = -1.0,
.pos_gain = 0.3,
.psi_ref = 180.0,
.slope_ref = 35.0,
.speed_gain = 1.0,
.relvel_gain = 1.0,
.enabled_time = 0,
.wp_id = 0,
}

Definition at line 33 of file approach_moving_target.c.

Referenced by approach_moving_target_enable(), and send_approach_moving_target().

◆ amt_err_slowdown_gain

float amt_err_slowdown_gain = AMT_ERR_SLOWDOWN_GAIN

Definition at line 31 of file approach_moving_target.c.

◆ amt_telem

struct AmtTelem amt_telem

Definition at line 33 of file approach_moving_target.c.

Referenced by send_approach_moving_target().

◆ approach_moving_target_angle_deg

float approach_moving_target_angle_deg

Definition at line 33 of file approach_moving_target.c.

◆ approach_moving_target_enabled

bool approach_moving_target_enabled = false

Definition at line 56 of file approach_moving_target.c.