Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
rosflight_firmware::CommLink Class Referenceabstract

#include <comm_link.h>

Inheritance diagram for rosflight_firmware::CommLink:
Inheritance graph
[legend]

Classes

struct  OffboardControl
 

Public Types

enum  Command {
  Command::COMMAND_READ_PARAMS, Command::COMMAND_WRITE_PARAMS, Command::COMMAND_SET_PARAM_DEFAULTS, Command::COMMAND_ACCEL_CALIBRATION,
  Command::COMMAND_GYRO_CALIBRATION, Command::COMMAND_BARO_CALIBRATION, Command::COMMAND_AIRSPEED_CALIBRATION, Command::COMMAND_RC_CALIBRATION,
  Command::COMMAND_REBOOT, Command::COMMAND_REBOOT_TO_BOOTLOADER, Command::COMMAND_SEND_VERSION
}
 
enum  LogSeverity { LogSeverity::LOG_INFO, LogSeverity::LOG_WARNING, LogSeverity::LOG_ERROR, LogSeverity::LOG_CRITICAL }
 

Public Member Functions

virtual void init (uint32_t baud_rate, uint32_t dev)=0
 
virtual void receive ()=0
 
void register_attitude_correction_callback (std::function< void(const turbomath::Quaternion)> callback)
 
void register_command_callback (std::function< void(Command)> callback)
 
void register_heartbeat_callback (std::function< void()> callback)
 
void register_offboard_control_callback (std::function< void(const OffboardControl &)> callback)
 
void register_param_request_list_callback (std::function< void(uint8_t)> callback)
 
void register_param_request_read_callback (std::function< void(uint8_t, const char *const ,uint16_t)> callback)
 
void register_param_set_float_callback (std::function< void(uint8_t, const char *const ,float)> callback)
 
void register_param_set_int_callback (std::function< void(uint8_t, const char *const ,int32_t)> callback)
 
void register_timesync_callback (std::function< void(int64_t, int64_t)> callback)
 
virtual void send_attitude_quaternion (uint8_t system_id, uint64_t timestamp_us, const turbomath::Quaternion &attitude, const turbomath::Vector &angular_velocity)=0
 
virtual void send_baro (uint8_t system_id, float altitude, float pressure, float temperature)=0
 
virtual void send_command_ack (uint8_t system_id, Command command, bool success)=0
 
virtual void send_diff_pressure (uint8_t system_id, float velocity, float pressure, float temperature)=0
 
virtual void send_error_data (uint8_t system_id, const BackupData &error_data)=0
 
virtual void send_gnss (uint8_t system_id, uint32_t time_of_week, uint8_t fix_type, uint64_t time, uint64_t nanos, int32_t lat, int32_t lon, int32_t height, int32_t vel_n, int32_t vel_e, int32_t vel_d, uint32_t h_acc, uint32_t v_acc, int32_t ecef_x, int32_t ecef_y, int32_t ecef_z, uint32_t p_acc, int32_t ecef_v_x, int32_t ecef_v_y, int32_t ecef_v_z, uint32_t s_acc, uint64_t rosflight_timestamp)=0
 
virtual void send_gnss_raw (uint8_t system_id, uint32_t time_of_week, uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t valid, uint32_t t_acc, int32_t nano, uint8_t fix_type, uint8_t num_sat, int32_t lon, int32_t lat, int32_t height, int32_t height_msl, uint32_t h_acc, uint32_t v_acc, int32_t vel_n, int32_t vel_e, int32_t vel_d, int32_t g_speed, int32_t head_mot, uint32_t s_acc, uint32_t head_acc, uint16_t p_dop, uint64_t rosflight_timestamp)=0
 
virtual void send_heartbeat (uint8_t system_id, bool fixed_wing)=0
 
virtual void send_imu (uint8_t system_id, uint64_t timestamp_us, const turbomath::Vector &accel, const turbomath::Vector &gyro, float temperature)=0
 
virtual void send_log_message (uint8_t system_id, LogSeverity severity, const char *text)=0
 
virtual void send_mag (uint8_t system_id, const turbomath::Vector &mag)=0
 
virtual void send_named_value_float (uint8_t system_id, uint32_t timestamp_ms, const char *const name, float value)=0
 
virtual void send_named_value_int (uint8_t system_id, uint32_t timestamp_ms, const char *const name, int32_t value)=0
 
virtual void send_output_raw (uint8_t system_id, uint32_t timestamp_ms, const float raw_outputs[8])=0
 
virtual void send_param_value_float (uint8_t system_id, uint16_t index, const char *const name, float value, uint16_t param_count)=0
 
virtual void send_param_value_int (uint8_t system_id, uint16_t index, const char *const name, int32_t value, uint16_t param_count)=0
 
virtual void send_rc_raw (uint8_t system_id, uint32_t timestamp_ms, const uint16_t channels[8])=0
 
virtual void send_sonar (uint8_t system_id, uint8_t type, float range, float max_range, float min_range)=0
 
virtual void send_status (uint8_t system_id, bool armed, bool failsafe, bool rc_override, bool offboard, uint8_t error_code, uint8_t control_mode, int16_t num_errors, int16_t loop_time_us)=0
 
virtual void send_timesync (uint8_t system_id, int64_t tc1, int64_t ts1)=0
 
virtual void send_version (uint8_t system_id, const char *const version)=0
 

Protected Attributes

std::function< void(const turbomath::Quaternion)> attitude_correction_callback_
 
std::function< void(Command)> command_callback_
 
std::function< void(void)> heartbeat_callback_
 
std::function< void(const OffboardControl)> offboard_control_callback_
 
std::function< void(uint8_t)> param_request_list_callback_
 
std::function< void(uint8_t, const char *const, uint16_t)> param_request_read_callback_
 
std::function< void(uint8_t, const char *const, float)> param_set_float_callback_
 
std::function< void(uint8_t, const char *const, int32_t)> param_set_int_callback_
 
std::function< void(int64_t, int64_t)> timesync_callback_
 

Detailed Description

Definition at line 46 of file comm_link.h.

Member Enumeration Documentation

Enumerator
COMMAND_READ_PARAMS 
COMMAND_WRITE_PARAMS 
COMMAND_SET_PARAM_DEFAULTS 
COMMAND_ACCEL_CALIBRATION 
COMMAND_GYRO_CALIBRATION 
COMMAND_BARO_CALIBRATION 
COMMAND_AIRSPEED_CALIBRATION 
COMMAND_RC_CALIBRATION 
COMMAND_REBOOT 
COMMAND_REBOOT_TO_BOOTLOADER 
COMMAND_SEND_VERSION 

Definition at line 58 of file comm_link.h.

Enumerator
LOG_INFO 
LOG_WARNING 
LOG_ERROR 
LOG_CRITICAL 

Definition at line 50 of file comm_link.h.

Member Function Documentation

virtual void rosflight_firmware::CommLink::init ( uint32_t  baud_rate,
uint32_t  dev 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::receive ( )
pure virtual

Implemented in rosflight_firmware::Mavlink.

void rosflight_firmware::CommLink::register_attitude_correction_callback ( std::function< void(const turbomath::Quaternion)>  callback)
inline

Definition at line 189 of file comm_link.h.

void rosflight_firmware::CommLink::register_command_callback ( std::function< void(Command)>  callback)
inline

Definition at line 194 of file comm_link.h.

void rosflight_firmware::CommLink::register_heartbeat_callback ( std::function< void()>  callback)
inline

Definition at line 203 of file comm_link.h.

void rosflight_firmware::CommLink::register_offboard_control_callback ( std::function< void(const OffboardControl &)>  callback)
inline

Definition at line 184 of file comm_link.h.

void rosflight_firmware::CommLink::register_param_request_list_callback ( std::function< void(uint8_t)>  callback)
inline

Definition at line 158 of file comm_link.h.

void rosflight_firmware::CommLink::register_param_request_read_callback ( std::function< void(uint8_t, const char *const ,uint16_t)>  callback)
inline

Definition at line 163 of file comm_link.h.

void rosflight_firmware::CommLink::register_param_set_float_callback ( std::function< void(uint8_t, const char *const ,float)>  callback)
inline

Definition at line 177 of file comm_link.h.

void rosflight_firmware::CommLink::register_param_set_int_callback ( std::function< void(uint8_t, const char *const ,int32_t)>  callback)
inline

Definition at line 170 of file comm_link.h.

void rosflight_firmware::CommLink::register_timesync_callback ( std::function< void(int64_t, int64_t)>  callback)
inline

Definition at line 199 of file comm_link.h.

virtual void rosflight_firmware::CommLink::send_attitude_quaternion ( uint8_t  system_id,
uint64_t  timestamp_us,
const turbomath::Quaternion attitude,
const turbomath::Vector angular_velocity 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_baro ( uint8_t  system_id,
float  altitude,
float  pressure,
float  temperature 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_command_ack ( uint8_t  system_id,
Command  command,
bool  success 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_diff_pressure ( uint8_t  system_id,
float  velocity,
float  pressure,
float  temperature 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_error_data ( uint8_t  system_id,
const BackupData error_data 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_gnss ( uint8_t  system_id,
uint32_t  time_of_week,
uint8_t  fix_type,
uint64_t  time,
uint64_t  nanos,
int32_t  lat,
int32_t  lon,
int32_t  height,
int32_t  vel_n,
int32_t  vel_e,
int32_t  vel_d,
uint32_t  h_acc,
uint32_t  v_acc,
int32_t  ecef_x,
int32_t  ecef_y,
int32_t  ecef_z,
uint32_t  p_acc,
int32_t  ecef_v_x,
int32_t  ecef_v_y,
int32_t  ecef_v_z,
uint32_t  s_acc,
uint64_t  rosflight_timestamp 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_gnss_raw ( uint8_t  system_id,
uint32_t  time_of_week,
uint16_t  year,
uint8_t  month,
uint8_t  day,
uint8_t  hour,
uint8_t  min,
uint8_t  sec,
uint8_t  valid,
uint32_t  t_acc,
int32_t  nano,
uint8_t  fix_type,
uint8_t  num_sat,
int32_t  lon,
int32_t  lat,
int32_t  height,
int32_t  height_msl,
uint32_t  h_acc,
uint32_t  v_acc,
int32_t  vel_n,
int32_t  vel_e,
int32_t  vel_d,
int32_t  g_speed,
int32_t  head_mot,
uint32_t  s_acc,
uint32_t  head_acc,
uint16_t  p_dop,
uint64_t  rosflight_timestamp 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_heartbeat ( uint8_t  system_id,
bool  fixed_wing 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_imu ( uint8_t  system_id,
uint64_t  timestamp_us,
const turbomath::Vector accel,
const turbomath::Vector gyro,
float  temperature 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_log_message ( uint8_t  system_id,
LogSeverity  severity,
const char *  text 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_mag ( uint8_t  system_id,
const turbomath::Vector mag 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_named_value_float ( uint8_t  system_id,
uint32_t  timestamp_ms,
const char *const  name,
float  value 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_named_value_int ( uint8_t  system_id,
uint32_t  timestamp_ms,
const char *const  name,
int32_t  value 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_output_raw ( uint8_t  system_id,
uint32_t  timestamp_ms,
const float  raw_outputs[8] 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_param_value_float ( uint8_t  system_id,
uint16_t  index,
const char *const  name,
float  value,
uint16_t  param_count 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_param_value_int ( uint8_t  system_id,
uint16_t  index,
const char *const  name,
int32_t  value,
uint16_t  param_count 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_rc_raw ( uint8_t  system_id,
uint32_t  timestamp_ms,
const uint16_t  channels[8] 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_sonar ( uint8_t  system_id,
uint8_t  type,
float  range,
float  max_range,
float  min_range 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_status ( uint8_t  system_id,
bool  armed,
bool  failsafe,
bool  rc_override,
bool  offboard,
uint8_t  error_code,
uint8_t  control_mode,
int16_t  num_errors,
int16_t  loop_time_us 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_timesync ( uint8_t  system_id,
int64_t  tc1,
int64_t  ts1 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

virtual void rosflight_firmware::CommLink::send_version ( uint8_t  system_id,
const char *const  version 
)
pure virtual

Implemented in rosflight_firmware::Mavlink.

Member Data Documentation

std::function<void(const turbomath::Quaternion)> rosflight_firmware::CommLink::attitude_correction_callback_
protected

Definition at line 215 of file comm_link.h.

std::function<void(Command)> rosflight_firmware::CommLink::command_callback_
protected

Definition at line 216 of file comm_link.h.

std::function<void(void)> rosflight_firmware::CommLink::heartbeat_callback_
protected

Definition at line 218 of file comm_link.h.

std::function<void(const OffboardControl)> rosflight_firmware::CommLink::offboard_control_callback_
protected

Definition at line 214 of file comm_link.h.

std::function<void(uint8_t)> rosflight_firmware::CommLink::param_request_list_callback_
protected

Definition at line 209 of file comm_link.h.

std::function<void(uint8_t, const char *const, uint16_t)> rosflight_firmware::CommLink::param_request_read_callback_
protected

Definition at line 210 of file comm_link.h.

std::function<void(uint8_t, const char *const, float)> rosflight_firmware::CommLink::param_set_float_callback_
protected

Definition at line 212 of file comm_link.h.

std::function<void(uint8_t, const char *const, int32_t)> rosflight_firmware::CommLink::param_set_int_callback_
protected

Definition at line 211 of file comm_link.h.

std::function<void(int64_t, int64_t)> rosflight_firmware::CommLink::timesync_callback_
protected

Definition at line 217 of file comm_link.h.


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


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:31