Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
rosflight_sim::SIL_Board Class Reference

#include <sil_board.h>

Inheritance diagram for rosflight_sim::SIL_Board:
Inheritance graph
[legend]

Public Member Functions

void backup_memory_clear (size_t len) override
 
void backup_memory_init () override
 
bool backup_memory_read (void *dest, size_t len) override
 
void backup_memory_write (const void *src, size_t len) override
 
bool baro_present (void) override
 
void baro_read (float *pressure, float *temperature) override
 
void baro_update (void) override
 
bool battery_current_present () const override
 
float battery_current_read () const override
 
void battery_current_set_multiplier (double multiplier) override
 
bool battery_voltage_present () const override
 
float battery_voltage_read () const override
 
void battery_voltage_set_multiplier (double multiplier) override
 
void board_reset (bool bootloader) override
 
void clock_delay (uint32_t milliseconds) override
 
uint64_t clock_micros () override
 
uint32_t clock_millis () override
 
bool diff_pressure_present (void) override
 
void diff_pressure_read (float *diff_pressure, float *temperature) override
 
void diff_pressure_update (void) override
 
void gazebo_setup (gazebo::physics::LinkPtr link, gazebo::physics::WorldPtr world, gazebo::physics::ModelPtr model, ros::NodeHandle *nh, std::string mav_type)
 
const int * get_outputs () const
 
rosflight_firmware::GNSSFull gnss_full_read () override
 
bool gnss_has_new_data () override
 
bool gnss_present () override
 
rosflight_firmware::GNSSData gnss_read () override
 
void gnss_update () override
 
void imu_not_responding_error () override
 
bool imu_read (float accel[3], float *temperature, float gyro[3], uint64_t *time_us) override
 
void init_board (void) override
 
void led0_off (void) override
 
void led0_on (void) override
 
void led0_toggle (void) override
 
void led1_off (void) override
 
void led1_on (void) override
 
void led1_toggle (void) override
 
bool mag_present (void) override
 
void mag_read (float mag[3]) override
 
void mag_update (void) override
 
void memory_init (void) override
 
bool memory_read (void *dest, size_t len) override
 
bool memory_write (const void *src, size_t len) override
 
bool new_imu_data () override
 
uint16_t num_sensor_errors (void) override
 
void pwm_disable (void) override
 
void pwm_init (uint32_t refresh_rate, uint16_t idle_pwm) override
 
void pwm_write (uint8_t channel, float value) override
 
void rc_init (rc_type_t rc_type) override
 
bool rc_lost (void) override
 
float rc_read (uint8_t channel) override
 
void sensors_init () override
 
 SIL_Board ()
 
bool sonar_present (void) override
 
float sonar_read (void) override
 
void sonar_update (void) override
 
- Public Member Functions inherited from rosflight_firmware::UDPBoard
uint16_t serial_bytes_available (void) override
 
void serial_flush () override
 
void serial_init (uint32_t baud_rate, uint32_t dev) override
 
uint8_t serial_read (void) override
 
void serial_write (const uint8_t *src, size_t len) override
 
void set_ports (std::string bind_host, uint16_t bind_port, std::string remote_host, uint16_t remote_port)
 
 UDPBoard (std::string bind_host="localhost", uint16_t bind_port=14525, std::string remote_host="localhost", uint16_t remote_port=14520)
 
 ~UDPBoard ()
 

Private Member Functions

bool motors_spinning ()
 
void RCCallback (const rosflight_msgs::RCRaw &msg)
 

Private Attributes

GazeboVector acc_bias_
 
double acc_bias_range_
 
double acc_bias_walk_stdev_
 
double acc_stdev_
 
double airspeed_bias_
 
double airspeed_bias_range_
 
double airspeed_bias_walk_stdev_
 
double airspeed_stdev_
 
uint8_t backup_memory_ [BACKUP_SRAM_SIZE]
 
double baro_bias_
 
double baro_bias_range_
 
double baro_bias_walk_stdev_
 
double baro_stdev_
 
float battery_current_multiplier {1.0}
 
float battery_voltage_multiplier {1.0}
 
gazebo::common::Time boot_time_
 
double gps_velocity_stdev_
 
GazeboVector gravity_
 
GazeboVector gyro_bias_
 
double gyro_bias_range_
 
double gyro_bias_walk_stdev_
 
double gyro_stdev_
 
double horizontal_gps_stdev_
 
uint64_t imu_update_period_us_
 
double imu_update_rate_
 
GazeboVector inertial_magnetic_field_
 
ros::Time last_rc_message_
 
gazebo::common::Time last_time_
 
rosflight_msgs::RCRaw latestRC_
 
gazebo::physics::LinkPtr link_
 
GazeboVector mag_bias_
 
double mag_bias_range_
 
double mag_bias_walk_stdev_
 
double mag_stdev_
 
std::string mav_type_
 
gazebo::physics::ModelPtr model_
 
uint64_t next_imu_update_time_us_
 
ros::NodeHandlenh_
 
std::normal_distribution< double > normal_distribution_
 
double origin_altitude_
 
double origin_latitude_
 
double origin_longitude_
 
GazeboVector prev_vel_1_
 
GazeboVector prev_vel_2_
 
GazeboVector prev_vel_3_
 
int pwm_outputs_ [14]
 
std::default_random_engine random_generator_
 
bool rc_received_
 
ros::Subscriber rc_sub_
 
double sonar_max_range_
 
double sonar_min_range_
 
double sonar_stdev_
 
std::uniform_real_distribution< double > uniform_distribution_
 
double vertical_gps_stdev_
 
gazebo::physics::WorldPtr world_
 

Static Private Attributes

static constexpr size_t BACKUP_SRAM_SIZE {1024}
 

Additional Inherited Members

- Public Types inherited from rosflight_firmware::Board
enum  rc_type_t
 
- Public Attributes inherited from rosflight_firmware::Board
 RC_TYPE_PPM
 
 RC_TYPE_SBUS
 

Detailed Description

Definition at line 54 of file sil_board.h.

Constructor & Destructor Documentation

rosflight_sim::SIL_Board::SIL_Board ( )

Definition at line 40 of file sil_board.cpp.

Member Function Documentation

void rosflight_sim::SIL_Board::backup_memory_clear ( size_t  len)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 555 of file sil_board.cpp.

void rosflight_sim::SIL_Board::backup_memory_init ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 536 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::backup_memory_read ( void *  dest,
size_t  len 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 538 of file sil_board.cpp.

void rosflight_sim::SIL_Board::backup_memory_write ( const void *  src,
size_t  len 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 549 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::baro_present ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 324 of file sil_board.cpp.

void rosflight_sim::SIL_Board::baro_read ( float *  pressure,
float *  temperature 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 329 of file sil_board.cpp.

void rosflight_sim::SIL_Board::baro_update ( void  )
inlineoverridevirtual

Implements rosflight_firmware::Board.

Definition at line 161 of file sil_board.h.

bool rosflight_sim::SIL_Board::battery_current_present ( ) const
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 418 of file sil_board.cpp.

float rosflight_sim::SIL_Board::battery_current_read ( ) const
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 423 of file sil_board.cpp.

void rosflight_sim::SIL_Board::battery_current_set_multiplier ( double  multiplier)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 428 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::battery_voltage_present ( ) const
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 403 of file sil_board.cpp.

float rosflight_sim::SIL_Board::battery_voltage_read ( ) const
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 408 of file sil_board.cpp.

void rosflight_sim::SIL_Board::battery_voltage_set_multiplier ( double  multiplier)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 413 of file sil_board.cpp.

void rosflight_sim::SIL_Board::board_reset ( bool  bootloader)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 149 of file sil_board.cpp.

void rosflight_sim::SIL_Board::clock_delay ( uint32_t  milliseconds)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 165 of file sil_board.cpp.

uint64_t rosflight_sim::SIL_Board::clock_micros ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 159 of file sil_board.cpp.

uint32_t rosflight_sim::SIL_Board::clock_millis ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 153 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::diff_pressure_present ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 353 of file sil_board.cpp.

void rosflight_sim::SIL_Board::diff_pressure_read ( float *  diff_pressure,
float *  temperature 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 361 of file sil_board.cpp.

void rosflight_sim::SIL_Board::diff_pressure_update ( void  )
inlineoverridevirtual

Implements rosflight_firmware::Board.

Definition at line 165 of file sil_board.h.

void rosflight_sim::SIL_Board::gazebo_setup ( gazebo::physics::LinkPtr  link,
gazebo::physics::WorldPtr  world,
gazebo::physics::ModelPtr  model,
ros::NodeHandle nh,
std::string  mav_type 
)

Definition at line 56 of file sil_board.cpp.

const int* rosflight_sim::SIL_Board::get_outputs ( ) const
inline

Definition at line 223 of file sil_board.h.

rosflight_firmware::GNSSFull rosflight_sim::SIL_Board::gnss_full_read ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 634 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::gnss_has_new_data ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 630 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::gnss_present ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 568 of file sil_board.cpp.

rosflight_firmware::GNSSData rosflight_sim::SIL_Board::gnss_read ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 574 of file sil_board.cpp.

void rosflight_sim::SIL_Board::gnss_update ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 572 of file sil_board.cpp.

void rosflight_sim::SIL_Board::imu_not_responding_error ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 289 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::imu_read ( float  accel[3],
float *  temperature,
float  gyro[3],
uint64_t *  time_us 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 218 of file sil_board.cpp.

void rosflight_sim::SIL_Board::init_board ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 42 of file sil_board.cpp.

void rosflight_sim::SIL_Board::led0_off ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 529 of file sil_board.cpp.

void rosflight_sim::SIL_Board::led0_on ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 528 of file sil_board.cpp.

void rosflight_sim::SIL_Board::led0_toggle ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 530 of file sil_board.cpp.

void rosflight_sim::SIL_Board::led1_off ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 533 of file sil_board.cpp.

void rosflight_sim::SIL_Board::led1_on ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 532 of file sil_board.cpp.

void rosflight_sim::SIL_Board::led1_toggle ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 534 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::mag_present ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 319 of file sil_board.cpp.

void rosflight_sim::SIL_Board::mag_read ( float  mag[3])
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 294 of file sil_board.cpp.

void rosflight_sim::SIL_Board::mag_update ( void  )
inlineoverridevirtual

Implements rosflight_firmware::Board.

Definition at line 157 of file sil_board.h.

void rosflight_sim::SIL_Board::memory_init ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 480 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::memory_read ( void *  dest,
size_t  len 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 482 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::memory_write ( const void *  src,
size_t  len 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 499 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::motors_spinning ( )
private

Definition at line 518 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::new_imu_data ( )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 204 of file sil_board.cpp.

uint16_t rosflight_sim::SIL_Board::num_sensor_errors ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 199 of file sil_board.cpp.

void rosflight_sim::SIL_Board::pwm_disable ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 467 of file sil_board.cpp.

void rosflight_sim::SIL_Board::pwm_init ( uint32_t  refresh_rate,
uint16_t  idle_pwm 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 434 of file sil_board.cpp.

void rosflight_sim::SIL_Board::pwm_write ( uint8_t  channel,
float  value 
)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 463 of file sil_board.cpp.

void rosflight_sim::SIL_Board::rc_init ( rc_type_t  rc_type)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 477 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::rc_lost ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 472 of file sil_board.cpp.

float rosflight_sim::SIL_Board::rc_read ( uint8_t  channel)
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 449 of file sil_board.cpp.

void rosflight_sim::SIL_Board::RCCallback ( const rosflight_msgs::RCRaw &  msg)
private

Definition at line 561 of file sil_board.cpp.

void rosflight_sim::SIL_Board::sensors_init ( )
overridevirtual

TODO these sensors have noise, no bias noise params are hard coded

Implements rosflight_firmware::Board.

Definition at line 170 of file sil_board.cpp.

bool rosflight_sim::SIL_Board::sonar_present ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 381 of file sil_board.cpp.

float rosflight_sim::SIL_Board::sonar_read ( void  )
overridevirtual

Implements rosflight_firmware::Board.

Definition at line 386 of file sil_board.cpp.

void rosflight_sim::SIL_Board::sonar_update ( void  )
inlineoverridevirtual

Implements rosflight_firmware::Board.

Definition at line 169 of file sil_board.h.

Member Data Documentation

GazeboVector rosflight_sim::SIL_Board::acc_bias_
private

Definition at line 90 of file sil_board.h.

double rosflight_sim::SIL_Board::acc_bias_range_
private

Definition at line 66 of file sil_board.h.

double rosflight_sim::SIL_Board::acc_bias_walk_stdev_
private

Definition at line 67 of file sil_board.h.

double rosflight_sim::SIL_Board::acc_stdev_
private

Definition at line 65 of file sil_board.h.

double rosflight_sim::SIL_Board::airspeed_bias_
private

Definition at line 93 of file sil_board.h.

double rosflight_sim::SIL_Board::airspeed_bias_range_
private

Definition at line 79 of file sil_board.h.

double rosflight_sim::SIL_Board::airspeed_bias_walk_stdev_
private

Definition at line 77 of file sil_board.h.

double rosflight_sim::SIL_Board::airspeed_stdev_
private

Definition at line 78 of file sil_board.h.

uint8_t rosflight_sim::SIL_Board::backup_memory_[BACKUP_SRAM_SIZE]
private

Definition at line 133 of file sil_board.h.

constexpr size_t rosflight_sim::SIL_Board::BACKUP_SRAM_SIZE {1024}
staticprivate

Definition at line 132 of file sil_board.h.

double rosflight_sim::SIL_Board::baro_bias_
private

Definition at line 92 of file sil_board.h.

double rosflight_sim::SIL_Board::baro_bias_range_
private

Definition at line 71 of file sil_board.h.

double rosflight_sim::SIL_Board::baro_bias_walk_stdev_
private

Definition at line 69 of file sil_board.h.

double rosflight_sim::SIL_Board::baro_stdev_
private

Definition at line 70 of file sil_board.h.

float rosflight_sim::SIL_Board::battery_current_multiplier {1.0}
private

Definition at line 131 of file sil_board.h.

float rosflight_sim::SIL_Board::battery_voltage_multiplier {1.0}
private

Definition at line 130 of file sil_board.h.

gazebo::common::Time rosflight_sim::SIL_Board::boot_time_
private

Definition at line 118 of file sil_board.h.

double rosflight_sim::SIL_Board::gps_velocity_stdev_
private

Definition at line 87 of file sil_board.h.

GazeboVector rosflight_sim::SIL_Board::gravity_
private

Definition at line 99 of file sil_board.h.

GazeboVector rosflight_sim::SIL_Board::gyro_bias_
private

Definition at line 89 of file sil_board.h.

double rosflight_sim::SIL_Board::gyro_bias_range_
private

Definition at line 63 of file sil_board.h.

double rosflight_sim::SIL_Board::gyro_bias_walk_stdev_
private

Definition at line 62 of file sil_board.h.

double rosflight_sim::SIL_Board::gyro_stdev_
private

Definition at line 61 of file sil_board.h.

double rosflight_sim::SIL_Board::horizontal_gps_stdev_
private

Definition at line 85 of file sil_board.h.

uint64_t rosflight_sim::SIL_Board::imu_update_period_us_
private

Definition at line 120 of file sil_board.h.

double rosflight_sim::SIL_Board::imu_update_rate_
private

Definition at line 59 of file sil_board.h.

GazeboVector rosflight_sim::SIL_Board::inertial_magnetic_field_
private

Definition at line 57 of file sil_board.h.

ros::Time rosflight_sim::SIL_Board::last_rc_message_
private

Definition at line 112 of file sil_board.h.

gazebo::common::Time rosflight_sim::SIL_Board::last_time_
private

Definition at line 128 of file sil_board.h.

rosflight_msgs::RCRaw rosflight_sim::SIL_Board::latestRC_
private

Definition at line 110 of file sil_board.h.

gazebo::physics::LinkPtr rosflight_sim::SIL_Board::link_
private

Definition at line 106 of file sil_board.h.

GazeboVector rosflight_sim::SIL_Board::mag_bias_
private

Definition at line 91 of file sil_board.h.

double rosflight_sim::SIL_Board::mag_bias_range_
private

Definition at line 75 of file sil_board.h.

double rosflight_sim::SIL_Board::mag_bias_walk_stdev_
private

Definition at line 73 of file sil_board.h.

double rosflight_sim::SIL_Board::mag_stdev_
private

Definition at line 74 of file sil_board.h.

std::string rosflight_sim::SIL_Board::mav_type_
private

Definition at line 114 of file sil_board.h.

gazebo::physics::ModelPtr rosflight_sim::SIL_Board::model_
private

Definition at line 105 of file sil_board.h.

uint64_t rosflight_sim::SIL_Board::next_imu_update_time_us_
private

Definition at line 119 of file sil_board.h.

ros::NodeHandle* rosflight_sim::SIL_Board::nh_
private

Definition at line 108 of file sil_board.h.

std::normal_distribution<double> rosflight_sim::SIL_Board::normal_distribution_
private

Definition at line 96 of file sil_board.h.

double rosflight_sim::SIL_Board::origin_altitude_
private

Definition at line 102 of file sil_board.h.

double rosflight_sim::SIL_Board::origin_latitude_
private

Definition at line 100 of file sil_board.h.

double rosflight_sim::SIL_Board::origin_longitude_
private

Definition at line 101 of file sil_board.h.

GazeboVector rosflight_sim::SIL_Board::prev_vel_1_
private

Definition at line 125 of file sil_board.h.

GazeboVector rosflight_sim::SIL_Board::prev_vel_2_
private

Definition at line 126 of file sil_board.h.

GazeboVector rosflight_sim::SIL_Board::prev_vel_3_
private

Definition at line 127 of file sil_board.h.

int rosflight_sim::SIL_Board::pwm_outputs_[14]
private

Definition at line 115 of file sil_board.h.

std::default_random_engine rosflight_sim::SIL_Board::random_generator_
private

Definition at line 95 of file sil_board.h.

bool rosflight_sim::SIL_Board::rc_received_
private

Definition at line 111 of file sil_board.h.

ros::Subscriber rosflight_sim::SIL_Board::rc_sub_
private

Definition at line 109 of file sil_board.h.

double rosflight_sim::SIL_Board::sonar_max_range_
private

Definition at line 82 of file sil_board.h.

double rosflight_sim::SIL_Board::sonar_min_range_
private

Definition at line 83 of file sil_board.h.

double rosflight_sim::SIL_Board::sonar_stdev_
private

Definition at line 81 of file sil_board.h.

std::uniform_real_distribution<double> rosflight_sim::SIL_Board::uniform_distribution_
private

Definition at line 97 of file sil_board.h.

double rosflight_sim::SIL_Board::vertical_gps_stdev_
private

Definition at line 86 of file sil_board.h.

gazebo::physics::WorldPtr rosflight_sim::SIL_Board::world_
private

Definition at line 104 of file sil_board.h.


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


rosflight_sim
Author(s): James Jackson, Gary Ellingson, Daniel Koch
autogenerated on Thu Apr 15 2021 05:09:58