APM:Libraries
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SITL::FlightAxis Class Reference

#include <SIM_FlightAxis.h>

Inheritance diagram for SITL::FlightAxis:
[legend]
Collaboration diagram for SITL::FlightAxis:
[legend]

Classes

struct  keytable
 
struct  state
 

Public Member Functions

 FlightAxis (const char *home_str, const char *frame_str)
 
void update (const struct sitl_input &input)
 
- Public Member Functions inherited from SITL::Aircraft
 Aircraft (const char *home_str, const char *frame_str)
 
void set_speedup (float speedup)
 
void set_instance (uint8_t _instance)
 
void set_autotest_dir (const char *_autotest_dir)
 
virtual void set_interface_ports (const char *address, const int port_in, const int port_out)
 
virtual void update (const struct sitl_input &input)=0
 
void fill_fdm (struct sitl_fdm &fdm)
 
void smooth_sensors (void)
 
float get_rate_hz (void) const
 
const Vector3fget_gyro (void) const
 
const Vector3fget_velocity_ef (void) const
 
const Vector3fget_velocity_air_ef (void) const
 
const Matrix3fget_dcm (void) const
 
const Vector3fget_mag_field_bf (void) const
 
virtual float gross_mass () const
 
const Locationget_location () const
 
const Vector3fget_position () const
 
void get_attitude (Quaternion &attitude) const
 

Static Public Member Functions

static Aircraftcreate (const char *home_str, const char *frame_str)
 
- Static Public Member Functions inherited from SITL::Aircraft
static double rand_normal (double mean, double stddev)
 
static bool parse_home (const char *home_str, Location &loc, float &yaw_degrees)
 

Public Attributes

struct SITL::FlightAxis::state state
 
struct SITL::FlightAxis::keytable keytable [num_keys]
 

Static Public Attributes

static const uint16_t num_keys = sizeof(state)/sizeof(double)
 

Private Member Functions

char * soap_request (const char *action, const char *fmt,...)
 
void exchange_data (const struct sitl_input &input)
 
void parse_reply (const char *reply)
 
void update_loop (void)
 
void report_FPS (void)
 

Static Private Member Functions

static void * update_thread (void *arg)
 

Private Attributes

struct sitl_input last_input
 
double average_frame_time_s
 
double extrapolated_s
 
double initial_time_s
 
double last_time_s
 
bool heli_demix
 
bool rev4_servos
 
bool controller_started
 
uint64_t frame_counter
 
uint64_t activation_frame_counter
 
uint64_t socket_frame_counter
 
uint64_t last_socket_frame_counter
 
double last_frame_count_s
 
Vector3f position_offset
 
Vector3f last_velocity_ef
 
const char * controller_ip = "127.0.0.1"
 
uint16_t controller_port = 18083
 
pthread_t thread
 
AP_HAL::Semaphoremutex
 

Additional Inherited Members

- Protected Types inherited from SITL::Aircraft
enum  { GROUND_BEHAVIOR_NONE = 0, GROUND_BEHAVIOR_NO_MOVEMENT, GROUND_BEHAVIOR_FWD_ONLY, GROUND_BEHAVIOR_TAILSITTER }
 
- Protected Member Functions inherited from SITL::Aircraft
float ground_height_difference () const
 
virtual bool on_ground () const
 
float hagl () const
 
void update_position (void)
 
void update_mag_field_bf (void)
 
void time_advance ()
 
void setup_frame_time (float rate, float speedup)
 
void adjust_frame_time (float rate)
 
void sync_frame_time (void)
 
void add_noise (float throttle)
 
uint64_t get_wall_time_us (void) const
 
void update_dynamics (const Vector3f &rot_accel)
 
void update_wind (const struct sitl_input &input)
 
float filtered_idx (float v, uint8_t idx)
 
float filtered_servo_angle (const struct sitl_input &input, uint8_t idx)
 
float filtered_servo_range (const struct sitl_input &input, uint8_t idx)
 
void extrapolate_sensors (float delta_time)
 
- Protected Attributes inherited from SITL::Aircraft
SITLsitl
 
Location home
 
Location location
 
float ground_level
 
float home_yaw
 
float frame_height
 
Matrix3f dcm
 
Vector3f gyro
 
Vector3f gyro_prev
 
Vector3f ang_accel
 
Vector3f velocity_ef
 
Vector3f wind_ef
 
Vector3f velocity_air_ef
 
Vector3f velocity_air_bf
 
Vector3f position
 
float mass
 
Vector3f accel_body
 
float airspeed
 
float airspeed_pitot
 
float battery_voltage = -1.0f
 
float battery_current = 0.0f
 
float rpm1 = 0
 
float rpm2 = 0
 
uint8_t rcin_chan_count = 0
 
float rcin [8]
 
float range = -1.0f
 
float turbulence_azimuth = 0.0f
 
float turbulence_horizontal_speed = 0.0f
 
float turbulence_vertical_speed = 0.0f
 
Vector3f mag_bf
 
uint64_t time_now_us
 
const float gyro_noise
 
const float accel_noise
 
float rate_hz
 
float achieved_rate_hz
 
float target_speedup
 
uint64_t frame_time_us
 
float scaled_frame_time_us
 
uint64_t last_wall_time_us
 
uint8_t instance
 
const char * autotest_dir
 
const char * frame
 
bool use_time_sync = true
 
float last_speedup = -1.0f
 
AP_Int8 * ahrs_orientation
 
enum SITL::Aircraft:: { ... }  ground_behavior
 
bool use_smoothing
 
AP_Terrain * terrain
 
const float FEET_TO_METERS = 0.3048f
 
const float KNOTS_TO_METERS_PER_SECOND = 0.51444f
 

Detailed Description

Definition at line 30 of file SIM_FlightAxis.h.

Constructor & Destructor Documentation

◆ FlightAxis()

FlightAxis::FlightAxis ( const char *  home_str,
const char *  frame_str 
)

Definition at line 75 of file SIM_FlightAxis.cpp.

Referenced by create().

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

Member Function Documentation

◆ create()

static Aircraft* SITL::FlightAxis::create ( const char *  home_str,
const char *  frame_str 
)
inlinestatic

Definition at line 38 of file SIM_FlightAxis.h.

Here is the call graph for this function:

◆ exchange_data()

void FlightAxis::exchange_data ( const struct sitl_input input)
private

Definition at line 244 of file SIM_FlightAxis.cpp.

Referenced by update_loop().

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

◆ parse_reply()

void FlightAxis::parse_reply ( const char *  reply)
private

Definition at line 135 of file SIM_FlightAxis.cpp.

Referenced by exchange_data().

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

◆ report_FPS()

void FlightAxis::report_FPS ( void  )
private

Definition at line 475 of file SIM_FlightAxis.cpp.

Referenced by update().

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

◆ soap_request()

char * FlightAxis::soap_request ( const char *  action,
const char *  fmt,
  ... 
)
private

Definition at line 170 of file SIM_FlightAxis.cpp.

Referenced by exchange_data().

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

◆ update()

void FlightAxis::update ( const struct sitl_input input)

Definition at line 345 of file SIM_FlightAxis.cpp.

Here is the call graph for this function:

◆ update_loop()

void FlightAxis::update_loop ( void  )
private

Definition at line 121 of file SIM_FlightAxis.cpp.

Referenced by update_thread().

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

◆ update_thread()

void * FlightAxis::update_thread ( void *  arg)
staticprivate

Definition at line 102 of file SIM_FlightAxis.cpp.

Referenced by FlightAxis().

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

Member Data Documentation

◆ activation_frame_counter

uint64_t SITL::FlightAxis::activation_frame_counter
private

Definition at line 173 of file SIM_FlightAxis.h.

Referenced by exchange_data().

◆ average_frame_time_s

double SITL::FlightAxis::average_frame_time_s
private

Definition at line 165 of file SIM_FlightAxis.h.

Referenced by exchange_data(), report_FPS(), and update().

◆ controller_ip

const char* SITL::FlightAxis::controller_ip = "127.0.0.1"
private

Definition at line 180 of file SIM_FlightAxis.h.

Referenced by exchange_data(), FlightAxis(), and soap_request().

◆ controller_port

uint16_t SITL::FlightAxis::controller_port = 18083
private

Definition at line 181 of file SIM_FlightAxis.h.

Referenced by soap_request().

◆ controller_started

bool SITL::FlightAxis::controller_started
private

Definition at line 171 of file SIM_FlightAxis.h.

Referenced by exchange_data(), and parse_reply().

◆ extrapolated_s

double SITL::FlightAxis::extrapolated_s
private

Definition at line 166 of file SIM_FlightAxis.h.

Referenced by update().

◆ frame_counter

uint64_t SITL::FlightAxis::frame_counter
private

Definition at line 172 of file SIM_FlightAxis.h.

Referenced by exchange_data(), and report_FPS().

◆ heli_demix

bool SITL::FlightAxis::heli_demix
private

Definition at line 169 of file SIM_FlightAxis.h.

Referenced by exchange_data(), and FlightAxis().

◆ initial_time_s

double SITL::FlightAxis::initial_time_s
private

Definition at line 167 of file SIM_FlightAxis.h.

Referenced by update().

◆ keytable

◆ last_frame_count_s

double SITL::FlightAxis::last_frame_count_s
private

Definition at line 176 of file SIM_FlightAxis.h.

Referenced by report_FPS().

◆ last_input

struct sitl_input SITL::FlightAxis::last_input
private

Definition at line 163 of file SIM_FlightAxis.h.

Referenced by update(), and update_loop().

◆ last_socket_frame_counter

uint64_t SITL::FlightAxis::last_socket_frame_counter
private

Definition at line 175 of file SIM_FlightAxis.h.

Referenced by report_FPS().

◆ last_time_s

double SITL::FlightAxis::last_time_s
private

Definition at line 168 of file SIM_FlightAxis.h.

Referenced by update().

◆ last_velocity_ef

Vector3f SITL::FlightAxis::last_velocity_ef
private

Definition at line 178 of file SIM_FlightAxis.h.

Referenced by update().

◆ mutex

AP_HAL::Semaphore* SITL::FlightAxis::mutex
private

Definition at line 184 of file SIM_FlightAxis.h.

Referenced by exchange_data(), FlightAxis(), update(), and update_loop().

◆ num_keys

const uint16_t SITL::FlightAxis::num_keys = sizeof(state)/sizeof(double)
static

Definition at line 92 of file SIM_FlightAxis.h.

Referenced by parse_reply().

◆ position_offset

Vector3f SITL::FlightAxis::position_offset
private

Definition at line 177 of file SIM_FlightAxis.h.

Referenced by update().

◆ rev4_servos

bool SITL::FlightAxis::rev4_servos
private

Definition at line 170 of file SIM_FlightAxis.h.

Referenced by exchange_data(), and FlightAxis().

◆ socket_frame_counter

uint64_t SITL::FlightAxis::socket_frame_counter
private

Definition at line 174 of file SIM_FlightAxis.h.

Referenced by exchange_data(), and report_FPS().

◆ state

◆ thread

pthread_t SITL::FlightAxis::thread
private

Definition at line 183 of file SIM_FlightAxis.h.

Referenced by FlightAxis().


The documentation for this class was generated from the following files: