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

#include <SITL.h>

Collaboration diagram for SITL::SITL:
[legend]

Public Types

enum  GPSType {
  GPS_TYPE_NONE = 0, GPS_TYPE_UBLOX = 1, GPS_TYPE_MTK = 2, GPS_TYPE_MTK16 = 3,
  GPS_TYPE_MTK19 = 4, GPS_TYPE_NMEA = 5, GPS_TYPE_SBP = 6, GPS_TYPE_FILE = 7,
  GPS_TYPE_NOVA = 8, GPS_TYPE_SBP2 = 9
}
 
enum  WindType { WIND_TYPE_SQRT = 0, WIND_TYPE_NO_LIMIT = 1, WIND_TYPE_COEF = 2 }
 

Public Member Functions

 SITL ()
 
 SITL (const SITL &other)=delete
 
SITLoperator= (const SITL &)=delete
 
void simstate_send (mavlink_channel_t chan)
 
void Log_Write_SIMSTATE (DataFlash_Class *dataflash)
 

Static Public Member Functions

static SITLget_instance ()
 
static void convert_body_frame (double rollDeg, double pitchDeg, double rollRate, double pitchRate, double yawRate, double *p, double *q, double *r)
 
static Vector3f convert_earth_frame (const Matrix3f &dcm, const Vector3f &gyro)
 

Public Attributes

struct sitl_fdm state
 
uint16_t update_rate_hz
 
bool motors_on
 
float height_agl
 
AP_Float baro_noise
 
AP_Float baro_drift
 
AP_Float baro_glitch
 
AP_Float gyro_noise
 
AP_Vector3f gyro_scale
 
AP_Float accel_noise
 
AP_Float accel2_noise
 
AP_Vector3f accel_bias
 
AP_Vector3f accel2_bias
 
AP_Float arspd_noise
 
AP_Float arspd_fail
 
AP_Float arspd2_fail
 
AP_Float arspd_fail_pressure
 
AP_Float arspd_fail_pitot_pressure
 
AP_Float arspd2_fail_pressure
 
AP_Float arspd2_fail_pitot_pressure
 
AP_Float gps_noise
 
AP_Int16 gps_lock_time
 
AP_Int16 gps_alt_offset
 
AP_Int8 vicon_observation_history_length
 
AP_Float mag_noise
 
AP_Float mag_error
 
AP_Vector3f mag_mot
 
AP_Vector3f mag_ofs
 
AP_Float servo_speed
 
AP_Float sonar_glitch
 
AP_Float sonar_noise
 
AP_Float sonar_scale
 
AP_Float drift_speed
 
AP_Float drift_time
 
AP_Float engine_mul
 
AP_Int8 engine_fail
 
AP_Int8 gps_disable
 
AP_Int8 gps2_enable
 
AP_Int8 gps_delay
 
AP_Int8 gps_type
 
AP_Int8 gps2_type
 
AP_Float gps_byteloss
 
AP_Int8 gps_numsats
 
AP_Vector3f gps_glitch
 
AP_Vector3f gps2_glitch
 
AP_Int8 gps_hertz
 
AP_Float batt_voltage
 
AP_Float accel_fail
 
AP_Int8 rc_fail
 
AP_Int8 baro_disable
 
AP_Int8 float_exception
 
AP_Int8 flow_enable
 
AP_Int16 flow_rate
 
AP_Int8 flow_delay
 
AP_Int8 terrain_enable
 
AP_Int16 pin_mask
 
AP_Float speedup
 
AP_Int8 odom_enable
 
float wind_speed_active
 
float wind_direction_active
 
float wind_dir_z_active
 
AP_Float wind_speed
 
AP_Float wind_direction
 
AP_Float wind_turbulance
 
AP_Float gps_drift_alt
 
AP_Float wind_dir_z
 
AP_Int8 wind_type
 
AP_Float wind_type_alt
 
AP_Float wind_type_coef
 
AP_Int16 baro_delay
 
AP_Int16 mag_delay
 
AP_Int16 wind_delay
 
AP_Int16 adsb_plane_count
 
AP_Float adsb_radius_m
 
AP_Float adsb_altitude_m
 
AP_Int8 adsb_tx
 
AP_Vector3f mag_anomaly_ned
 
AP_Float mag_anomaly_hgt
 
AP_Vector3f imu_pos_offset
 
AP_Vector3f gps_pos_offset
 
AP_Vector3f rngfnd_pos_offset
 
AP_Vector3f optflow_pos_offset
 
AP_Float temp_start
 
AP_Float temp_flight
 
AP_Float temp_tconst
 
AP_Float temp_baro_factor
 
AP_Int8 arspd_signflip
 
uint16_t irlock_port
 

Static Public Attributes

static SITL_s_instance = nullptr
 
static const struct AP_Param::GroupInfo var_info []
 
static const struct AP_Param::GroupInfo var_info2 []
 

Detailed Description

Definition at line 37 of file SITL.h.

Member Enumeration Documentation

◆ GPSType

Enumerator
GPS_TYPE_NONE 
GPS_TYPE_UBLOX 
GPS_TYPE_MTK 
GPS_TYPE_MTK16 
GPS_TYPE_MTK19 
GPS_TYPE_NMEA 
GPS_TYPE_SBP 
GPS_TYPE_FILE 
GPS_TYPE_NOVA 
GPS_TYPE_SBP2 

Definition at line 58 of file SITL.h.

◆ WindType

Enumerator
WIND_TYPE_SQRT 
WIND_TYPE_NO_LIMIT 
WIND_TYPE_COEF 

Definition at line 145 of file SITL.h.

Constructor & Destructor Documentation

◆ SITL() [1/2]

SITL::SITL::SITL ( )
inline

Definition at line 40 of file SITL.h.

Here is the call graph for this function:

◆ SITL() [2/2]

SITL::SITL::SITL ( const SITL other)
delete

Member Function Documentation

◆ convert_body_frame()

void SITL::SITL::convert_body_frame ( double  rollDeg,
double  pitchDeg,
double  rollRate,
double  pitchRate,
double  yawRate,
double *  p,
double *  q,
double *  r 
)
static

Definition at line 182 of file SITL.cpp.

Referenced by SITL::JSBSim::recv_fdm().

Here is the caller graph for this function:

◆ convert_earth_frame()

Vector3f SITL::SITL::convert_earth_frame ( const Matrix3f dcm,
const Vector3f gyro 
)
static

Definition at line 206 of file SITL.cpp.

Here is the call graph for this function:

◆ get_instance()

static SITL* SITL::SITL::get_instance ( void  )
inlinestatic

Definition at line 56 of file SITL.h.

Referenced by AP::sitl().

Here is the caller graph for this function:

◆ Log_Write_SIMSTATE()

void SITL::SITL::Log_Write_SIMSTATE ( DataFlash_Class dataflash)

Definition at line 151 of file SITL.cpp.

Here is the call graph for this function:

◆ operator=()

SITL& SITL::SITL::operator= ( const SITL )
delete

◆ simstate_send()

void SITL::SITL::simstate_send ( mavlink_channel_t  chan)

Definition at line 126 of file SITL.cpp.

Referenced by GCS_MAVLINK::send_simstate().

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

Member Data Documentation

◆ _s_instance

SITL * SITL::SITL::_s_instance = nullptr
static

Definition at line 55 of file SITL.h.

◆ accel2_bias

AP_Vector3f SITL::SITL::accel2_bias

Definition at line 94 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_accel().

◆ accel2_noise

AP_Float SITL::SITL::accel2_noise

Definition at line 92 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_accel().

◆ accel_bias

AP_Vector3f SITL::SITL::accel_bias

Definition at line 93 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_accel().

◆ accel_fail

AP_Float SITL::SITL::accel_fail

Definition at line 132 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_accel().

◆ accel_noise

AP_Float SITL::SITL::accel_noise

Definition at line 91 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_accel().

◆ adsb_altitude_m

AP_Float SITL::SITL::adsb_altitude_m

Definition at line 170 of file SITL.h.

Referenced by SITL::ADSB_Vehicle::update().

◆ adsb_plane_count

AP_Int16 SITL::SITL::adsb_plane_count

Definition at line 168 of file SITL.h.

Referenced by HALSITL::SITL_State::_fdm_input_step(), and SITL::ADSB::update().

◆ adsb_radius_m

AP_Float SITL::SITL::adsb_radius_m

Definition at line 169 of file SITL.h.

Referenced by SITL::ADSB::send_report(), and SITL::ADSB_Vehicle::update().

◆ adsb_tx

AP_Int8 SITL::SITL::adsb_tx

Definition at line 171 of file SITL.h.

Referenced by SITL::ADSB::send_report().

◆ arspd2_fail

AP_Float SITL::SITL::arspd2_fail

Definition at line 97 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ arspd2_fail_pitot_pressure

AP_Float SITL::SITL::arspd2_fail_pitot_pressure

Definition at line 101 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ arspd2_fail_pressure

AP_Float SITL::SITL::arspd2_fail_pressure

Definition at line 100 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ arspd_fail

AP_Float SITL::SITL::arspd_fail

Definition at line 96 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ arspd_fail_pitot_pressure

AP_Float SITL::SITL::arspd_fail_pitot_pressure

Definition at line 99 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ arspd_fail_pressure

AP_Float SITL::SITL::arspd_fail_pressure

Definition at line 98 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ arspd_noise

AP_Float SITL::SITL::arspd_noise

Definition at line 95 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ arspd_signflip

AP_Int8 SITL::SITL::arspd_signflip

Definition at line 190 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ baro_delay

AP_Int16 SITL::SITL::baro_delay

Definition at line 163 of file SITL.h.

Referenced by AP_Baro_SITL::_timer().

◆ baro_disable

AP_Int8 SITL::SITL::baro_disable

Definition at line 134 of file SITL.h.

Referenced by AP_Baro_SITL::_timer().

◆ baro_drift

AP_Float SITL::SITL::baro_drift

Definition at line 87 of file SITL.h.

Referenced by AP_Baro_SITL::_timer().

◆ baro_glitch

AP_Float SITL::SITL::baro_glitch

Definition at line 88 of file SITL.h.

Referenced by AP_Baro_SITL::_timer().

◆ baro_noise

AP_Float SITL::SITL::baro_noise

Definition at line 86 of file SITL.h.

Referenced by AP_Baro_SITL::_timer().

◆ batt_voltage

AP_Float SITL::SITL::batt_voltage

Definition at line 131 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ drift_speed

AP_Float SITL::SITL::drift_speed

Definition at line 117 of file SITL.h.

Referenced by AP_InertialSensor_SITL::gyro_drift().

◆ drift_time

AP_Float SITL::SITL::drift_time

Definition at line 118 of file SITL.h.

Referenced by AP_InertialSensor_SITL::gyro_drift().

◆ engine_fail

AP_Int8 SITL::SITL::engine_fail

Definition at line 120 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ engine_mul

AP_Float SITL::SITL::engine_mul

Definition at line 119 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ float_exception

AP_Int8 SITL::SITL::float_exception

Definition at line 135 of file SITL.h.

Referenced by HALSITL::Scheduler::Scheduler().

◆ flow_delay

AP_Int8 SITL::SITL::flow_delay

Definition at line 138 of file SITL.h.

Referenced by AP_OpticalFlow_SITL::update().

◆ flow_enable

AP_Int8 SITL::SITL::flow_enable

Definition at line 136 of file SITL.h.

Referenced by AP_OpticalFlow_SITL::update().

◆ flow_rate

AP_Int16 SITL::SITL::flow_rate

Definition at line 137 of file SITL.h.

Referenced by AP_OpticalFlow_SITL::update().

◆ gps2_enable

AP_Int8 SITL::SITL::gps2_enable

Definition at line 122 of file SITL.h.

Referenced by HALSITL::SITL_State::_gps_write().

◆ gps2_glitch

AP_Vector3f SITL::SITL::gps2_glitch

Definition at line 129 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps2_type

AP_Int8 SITL::SITL::gps2_type

Definition at line 125 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_alt_offset

AP_Int16 SITL::SITL::gps_alt_offset

Definition at line 104 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_byteloss

AP_Float SITL::SITL::gps_byteloss

Definition at line 126 of file SITL.h.

Referenced by HALSITL::SITL_State::_gps_write().

◆ gps_delay

AP_Int8 SITL::SITL::gps_delay

Definition at line 123 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_disable

AP_Int8 SITL::SITL::gps_disable

Definition at line 121 of file SITL.h.

Referenced by HALSITL::SITL_State::_fdm_input_step().

◆ gps_drift_alt

AP_Float SITL::SITL::gps_drift_alt

Definition at line 157 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_glitch

AP_Vector3f SITL::SITL::gps_glitch

Definition at line 128 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_hertz

AP_Int8 SITL::SITL::gps_hertz

Definition at line 130 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_lock_time

AP_Int16 SITL::SITL::gps_lock_time

Definition at line 103 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_noise

AP_Float SITL::SITL::gps_noise

Definition at line 102 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_numsats

AP_Int8 SITL::SITL::gps_numsats

◆ gps_pos_offset

AP_Vector3f SITL::SITL::gps_pos_offset

Definition at line 179 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gps_type

AP_Int8 SITL::SITL::gps_type

Definition at line 124 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_gps().

◆ gyro_noise

AP_Float SITL::SITL::gyro_noise

Definition at line 89 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_gyro().

◆ gyro_scale

AP_Vector3f SITL::SITL::gyro_scale

Definition at line 90 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_gyro().

◆ height_agl

float SITL::SITL::height_agl

◆ imu_pos_offset

AP_Vector3f SITL::SITL::imu_pos_offset

Definition at line 178 of file SITL.h.

Referenced by AP_InertialSensor_SITL::generate_accel().

◆ irlock_port

uint16_t SITL::SITL::irlock_port

Definition at line 192 of file SITL.h.

Referenced by HALSITL::SITL_State::_sitl_setup(), and AP_IRLock_SITL::init().

◆ mag_anomaly_hgt

AP_Float SITL::SITL::mag_anomaly_hgt

Definition at line 175 of file SITL.h.

Referenced by SITL::Aircraft::update_mag_field_bf().

◆ mag_anomaly_ned

AP_Vector3f SITL::SITL::mag_anomaly_ned

Definition at line 174 of file SITL.h.

Referenced by SITL::Aircraft::update_mag_field_bf().

◆ mag_delay

AP_Int16 SITL::SITL::mag_delay

Definition at line 164 of file SITL.h.

Referenced by AP_Compass_SITL::_timer().

◆ mag_error

AP_Float SITL::SITL::mag_error

Definition at line 108 of file SITL.h.

◆ mag_mot

AP_Vector3f SITL::SITL::mag_mot

Definition at line 109 of file SITL.h.

Referenced by SITL::Aircraft::update_mag_field_bf().

◆ mag_noise

AP_Float SITL::SITL::mag_noise

Definition at line 107 of file SITL.h.

Referenced by AP_Compass_SITL::_timer().

◆ mag_ofs

AP_Vector3f SITL::SITL::mag_ofs

Definition at line 110 of file SITL.h.

Referenced by AP_Compass_SITL::_timer().

◆ motors_on

bool SITL::SITL::motors_on

◆ odom_enable

AP_Int8 SITL::SITL::odom_enable

Definition at line 142 of file SITL.h.

Referenced by AP_AHRS_NavEKF::update_SITL().

◆ optflow_pos_offset

AP_Vector3f SITL::SITL::optflow_pos_offset

Definition at line 181 of file SITL.h.

Referenced by AP_OpticalFlow_SITL::update().

◆ pin_mask

AP_Int16 SITL::SITL::pin_mask

Definition at line 140 of file SITL.h.

◆ rc_fail

AP_Int8 SITL::SITL::rc_fail

◆ rngfnd_pos_offset

AP_Vector3f SITL::SITL::rngfnd_pos_offset

Definition at line 180 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_rangefinder().

◆ servo_speed

AP_Float SITL::SITL::servo_speed

Definition at line 111 of file SITL.h.

Referenced by SITL::Aircraft::filtered_idx().

◆ sonar_glitch

AP_Float SITL::SITL::sonar_glitch

Definition at line 113 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_rangefinder().

◆ sonar_noise

AP_Float SITL::SITL::sonar_noise

Definition at line 114 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_rangefinder().

◆ sonar_scale

AP_Float SITL::SITL::sonar_scale

Definition at line 115 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_rangefinder().

◆ speedup

AP_Float SITL::SITL::speedup

Definition at line 141 of file SITL.h.

Referenced by SITL::Aircraft::fill_fdm().

◆ state

struct sitl_fdm SITL::SITL::state

◆ temp_baro_factor

AP_Float SITL::SITL::temp_baro_factor

Definition at line 187 of file SITL.h.

Referenced by AP_Baro_SITL::temperature_adjustment().

◆ temp_flight

AP_Float SITL::SITL::temp_flight

Definition at line 185 of file SITL.h.

Referenced by AP_Baro_SITL::temperature_adjustment().

◆ temp_start

AP_Float SITL::SITL::temp_start

Definition at line 184 of file SITL.h.

Referenced by AP_Baro_SITL::temperature_adjustment().

◆ temp_tconst

AP_Float SITL::SITL::temp_tconst

Definition at line 186 of file SITL.h.

Referenced by AP_Baro_SITL::temperature_adjustment().

◆ terrain_enable

AP_Int8 SITL::SITL::terrain_enable

◆ update_rate_hz

uint16_t SITL::SITL::update_rate_hz

Definition at line 74 of file SITL.h.

Referenced by HALSITL::SITL_State::_fdm_input_local().

◆ var_info

const AP_Param::GroupInfo SITL::SITL::var_info
static

Definition at line 82 of file SITL.h.

◆ var_info2

const AP_Param::GroupInfo SITL::SITL::var_info2
static
Initial value:
= {
AP_GROUPINFO("TEMP_START", 1, SITL, temp_start, 25),
AP_GROUPINFO("TEMP_FLIGHT", 2, SITL, temp_flight, 35),
AP_GROUPINFO("TEMP_TCONST", 3, SITL, temp_tconst, 30),
AP_GROUPINFO("TEMP_BFACTOR", 4, SITL, temp_baro_factor, 0),
AP_GROUPINFO("GPS_LOCKTIME", 5, SITL, gps_lock_time, 0),
AP_GROUPINFO("ARSPD_FAIL_P", 6, SITL, arspd_fail_pressure, 0),
AP_GROUPINFO("GPS_ALT_OFS", 8, SITL, gps_alt_offset, 0),
AP_GROUPINFO("ARSPD_SIGN", 9, SITL, arspd_signflip, 0),
AP_GROUPINFO("WIND_DIR_Z", 10, SITL, wind_dir_z, 0),
AP_GROUPINFO("ARSPD2_FAIL", 11, SITL, arspd2_fail, 0),
AP_GROUPINFO("ARSPD2_FAILP",12, SITL, arspd2_fail_pressure, 0),
AP_GROUPINFO("ARSPD2_PITOT",13, SITL, arspd2_fail_pitot_pressure, 0),
AP_GROUPINFO("WIND_T" ,15, SITL, wind_type, SITL::WIND_TYPE_SQRT),
AP_GROUPINFO("WIND_T_ALT" ,16, SITL, wind_type_alt, 60),
AP_GROUPINFO("WIND_T_COEF", 17, SITL, wind_type_coef, 0.01f),
}

Definition at line 83 of file SITL.h.

◆ vicon_observation_history_length

AP_Int8 SITL::SITL::vicon_observation_history_length

Definition at line 105 of file SITL.h.

◆ wind_delay

AP_Int16 SITL::SITL::wind_delay

Definition at line 165 of file SITL.h.

Referenced by HALSITL::SITL_State::_update_airspeed().

◆ wind_dir_z

AP_Float SITL::SITL::wind_dir_z

Definition at line 158 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_dir_z_active

float SITL::SITL::wind_dir_z_active

Definition at line 153 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_direction

AP_Float SITL::SITL::wind_direction

Definition at line 155 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_direction_active

float SITL::SITL::wind_direction_active

Definition at line 152 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_speed

AP_Float SITL::SITL::wind_speed

Definition at line 154 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_speed_active

float SITL::SITL::wind_speed_active

Definition at line 151 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_turbulance

AP_Float SITL::SITL::wind_turbulance

Definition at line 156 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_type

AP_Int8 SITL::SITL::wind_type

Definition at line 159 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_type_alt

AP_Float SITL::SITL::wind_type_alt

Definition at line 160 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().

◆ wind_type_coef

AP_Float SITL::SITL::wind_type_coef

Definition at line 161 of file SITL.h.

Referenced by HALSITL::SITL_State::_simulator_servos().


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