Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pose_history.c File Reference
#include "modules/pose_history/pose_history.h"
#include <sys/time.h>
#include "mcu_periph/sys_time.h"
#include "state.h"
+ Include dependency graph for pose_history.c:

Go to the source code of this file.

Data Structures

struct  rotation_history_ring_buffer_t
 

Macros

#define POSE_HISTORY_SIZE   1024
 

Functions

struct pose_t get_rotation_at_timestamp (uint32_t timestamp)
 Given a pprz timestamp in used (obtained with get_sys_time_usec) we return the pose in FloatEulers closest to that time. More...
 
void pose_init ()
 Initialises the pose history. More...
 
void pose_periodic ()
 Records the pose history 512 times per second. More...
 

Variables

struct
rotation_history_ring_buffer_t 
location_history
 

Detailed Description

Author
Roland Meertens Ask this module for the pose the drone had closest to a given timestamp

Definition in file pose_history.c.


Data Structure Documentation

struct rotation_history_ring_buffer_t

Definition at line 38 of file pose_history.c.

+ Collaboration diagram for rotation_history_ring_buffer_t:
Data Fields
struct pose_t ring_data[POSE_HISTORY_SIZE]
uint32_t ring_index
uint32_t ring_size

Macro Definition Documentation

#define POSE_HISTORY_SIZE   1024

Definition at line 35 of file pose_history.c.

Referenced by pose_init().

Function Documentation

struct pose_t get_rotation_at_timestamp ( uint32_t  timestamp)

Given a pprz timestamp in used (obtained with get_sys_time_usec) we return the pose in FloatEulers closest to that time.

Definition at line 53 of file pose_history.c.

References pose_t::eulers, location_history, pose_t::rates, rotation_history_ring_buffer_t::ring_data, rotation_history_ring_buffer_t::ring_size, and pose_t::timestamp.

Referenced by opticflow_module_calc(), and save_shot_on_disk().

+ Here is the caller graph for this function:

void pose_init ( void  )
void pose_periodic ( void  )

Records the pose history 512 times per second.

Time gets saved in pprz usec, obtained with get_sys_time_usec();

Definition at line 95 of file pose_history.c.

References pose_t::eulers, get_sys_time_usec(), location_history, pose_t::rates, rotation_history_ring_buffer_t::ring_data, rotation_history_ring_buffer_t::ring_index, rotation_history_ring_buffer_t::ring_size, stateGetBodyRates_f(), stateGetNedToBodyEulers_f(), and pose_t::timestamp.

+ Here is the call graph for this function:

Variable Documentation

struct rotation_history_ring_buffer_t location_history

Definition at line 44 of file pose_history.c.

Referenced by get_rotation_at_timestamp(), pose_init(), and pose_periodic().