Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
copilot.h File Reference

Mission Computer module, interfacing the mission computer (also known as Copilot), based losely on ISaAC: The Intelligent Safety and Airworthiness Co-Pilot module Based on paper "A Payload Verification and Management Framework for Small UAV-based Personal Remote Sensing Systems" by Cal Coopmans and Chris Coffin. More...

+ Include dependency graph for copilot.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CameraPayload
 
struct  CameraSnapshot
 
struct  CopilotStatus
 

Functions

 PPRZ_MUTEX_DECL (copilot_cam_snapshot_mtx)
 
 PPRZ_MUTEX_DECL (copilot_cam_payload_mtx)
 
 PPRZ_MUTEX_DECL (copilot_status_mtx)
 
void copilot_init (void)
 Init function. More...
 
void copilot_periodic (void)
 Periodic function. More...
 
void copilot_parse_cam_snapshot_dl (uint8_t *buf)
 Message processing functions. More...
 
void copilot_parse_cam_payload_dl (uint8_t *buf)
 copy CAMERA_PAYLOAD message and mark it to be sent More...
 
void copilot_parse_copilot_status_dl (uint8_t *buf)
 copy COPILOT_STATUS message and mark it to be sent More...
 
void copilot_parse_move_wp_dl (uint8_t *buf)
 If MOVE_WP from GCS. More...
 
void copilot_parse_payload_command_dl (uint8_t *buf)
 Pass through PAYLOAD_COMMAND message and send it as PAYLOAD msg over telemetry. More...
 

Variables

bool send_cam_snapshot
 
bool send_cam_payload
 
bool send_copilot_status
 

Detailed Description

Mission Computer module, interfacing the mission computer (also known as Copilot), based losely on ISaAC: The Intelligent Safety and Airworthiness Co-Pilot module Based on paper "A Payload Verification and Management Framework for Small UAV-based Personal Remote Sensing Systems" by Cal Coopmans and Chris Coffin.

Link: http://ieeexplore.ieee.org/abstract/document/6309316/

More info can be found on http://wiki.paparazziuav.org/wiki/Mission_computer

Copilot is intended mainly for mapping applications.

This module processes messages from Copilot, and either forwards them to the GCS (such as CAMERA_SNAPSHOT or CAMERA_PAYLOAD messages), or responds to them as necessary (such as MOVE_WP).

The module assumes the source of the messages is trusted (i.e. not authentication besides AC_ID check is performed).

Definition in file copilot.h.


Data Structure Documentation

struct CameraPayload

Definition at line 55 of file copilot.h.

Data Fields
uint8_t door_status
uint8_t error_code
float timestamp
uint8_t used_disk
uint8_t used_mem
struct CameraSnapshot

Definition at line 63 of file copilot.h.

Data Fields
float array_temp
uint16_t cam_id
uint8_t cam_state
float lens_temp
uint16_t snapshot_num
uint8_t snapshot_valid
struct CopilotStatus

Definition at line 72 of file copilot.h.

Data Fields
uint8_t error_code
uint8_t status
float timestamp
uint8_t used_disk
uint8_t used_mem

Function Documentation

void copilot_init ( void  )
void copilot_parse_cam_payload_dl ( uint8_t buf)
void copilot_parse_cam_snapshot_dl ( uint8_t buf)

Message processing functions.

Message processing functions.

In case of multiple cameras, it is up to the payload computer to send CAMERA_SNAPSHOT messages for each camera at proper interval, so the values don't get overwritten.

Definition at line 127 of file copilot_common.c.

References CameraSnapshot::array_temp, CameraSnapshot::cam_id, cam_snapshot, CameraSnapshot::cam_state, CameraSnapshot::lens_temp, PPRZ_MUTEX_LOCK, PPRZ_MUTEX_UNLOCK, send_cam_snapshot, CameraSnapshot::snapshot_num, and CameraSnapshot::snapshot_valid.

void copilot_parse_copilot_status_dl ( uint8_t buf)
void copilot_parse_move_wp_dl ( uint8_t buf)

If MOVE_WP from GCS.

  • processed in firmware_parse_msg(dev, trans, buf); with regular buffer
  • reponse over telemetry (regular buffer)
  • here send WP_MOVED over extra_dl

If MOVE_WP from extra_dl

  • processed in firmware_parse_msg(dev, trans, buf); with extra buffer
  • response over extra_dl
  • send an update to GCS

In both cases, the MOVE_WP message was already processed in firmware_parse here we are taking care only about propagating the change

Definition at line 67 of file copilot_fixedwing.c.

References LlaCoor_f::alt, LlaCoor_i::alt, UtmCoor_f::alt, DefaultChannel, DefaultDevice, dl_buffer, UtmCoor_f::east, extra_dl_buffer, extra_pprz_tp, LtpDef_i::hmsl, LlaCoor_f::lat, LlaCoor_i::lat, LtpDef_i::lla, LlaCoor_f::lon, LlaCoor_i::lon, nav_utm_east0, nav_utm_north0, nav_utm_zone0, nb_waypoint, State::ned_origin_i, UtmCoor_f::north, state, stateIsLocalCoordinateValid(), utm_of_lla_f(), waypoint_is_global(), waypoints, point::x, point::y, and UtmCoor_f::zone.

+ Here is the call graph for this function:

void copilot_parse_payload_command_dl ( uint8_t buf)

Pass through PAYLOAD_COMMAND message and send it as PAYLOAD msg over telemetry.

Definition at line 184 of file copilot_common.c.

References DefaultChannel, DefaultDevice, dl_buffer, extra_dl_buffer, and extra_pprz_tp.

PPRZ_MUTEX_DECL ( copilot_cam_snapshot_mtx  )
PPRZ_MUTEX_DECL ( copilot_cam_payload_mtx  )
PPRZ_MUTEX_DECL ( copilot_status_mtx  )

Variable Documentation

bool send_cam_payload

Definition at line 48 of file copilot_common.c.

Referenced by copilot_init(), copilot_parse_cam_payload_dl(), and copilot_periodic().

bool send_cam_snapshot

Definition at line 47 of file copilot_common.c.

Referenced by copilot_init(), copilot_parse_cam_snapshot_dl(), and copilot_periodic().

bool send_copilot_status