Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
rosflight_firmware::CommManager Class Reference

#include <comm_manager.h>

Classes

class  Stream
 

Public Member Functions

 CommManager (ROSflight &rf, CommLink &comm_link)
 
void init ()
 
void log (CommLink::LogSeverity severity, const char *fmt,...)
 
void receive (void)
 
void send_named_value_float (const char *const name, float value)
 
void send_param_value (uint16_t param_id)
 
void send_parameter_list ()
 
void set_streaming_rate (uint8_t stream_id, int16_t param_id)
 
void stream ()
 
void update_status ()
 

Private Types

enum  OffboardControlMode { MODE_PASS_THROUGH, MODE_ROLLRATE_PITCHRATE_YAWRATE_THROTTLE, MODE_ROLL_PITCH_YAWRATE_THROTTLE, MODE_ROLL_PITCH_YAWRATE_ALTITUDE }
 
enum  StreamId {
  STREAM_ID_HEARTBEAT, STREAM_ID_STATUS, STREAM_ID_ATTITUDE, STREAM_ID_IMU,
  STREAM_ID_DIFF_PRESSURE, STREAM_ID_BARO, STREAM_ID_SONAR, STREAM_ID_MAG,
  STREAM_ID_SERVO_OUTPUT_RAW, STREAM_ID_GNSS, STREAM_ID_GNSS_RAW, STREAM_ID_RC_RAW,
  STREAM_ID_LOW_PRIORITY, STREAM_COUNT
}
 

Private Member Functions

void attitude_correction_callback (const turbomath::Quaternion &q)
 
void command_callback (CommLink::Command command)
 
void heartbeat_callback (void)
 
void offboard_control_callback (const CommLink::OffboardControl &control)
 
void param_request_list_callback (uint8_t target_system)
 
void param_request_read_callback (uint8_t target_system, const char *const param_name, int16_t param_index)
 
void param_set_float_callback (uint8_t target_system, const char *const param_name, float param_value)
 
void param_set_int_callback (uint8_t target_system, const char *const param_name, int32_t param_value)
 
void send_attitude (void)
 
void send_baro (void)
 
void send_diff_pressure (void)
 
void send_error_data (void)
 
void send_gnss (void)
 
void send_gnss_raw (void)
 
void send_heartbeat (void)
 
void send_imu (void)
 
void send_low_priority (void)
 
void send_mag (void)
 
void send_named_value_int (const char *const name, int32_t value)
 
void send_next_param (void)
 
void send_output_raw (void)
 
void send_rc_raw (void)
 
void send_sonar (void)
 
void send_status (void)
 
void timesync_callback (int64_t tc1, int64_t ts1)
 
void update_system_id (uint16_t param_id)
 

Private Attributes

CommLinkcomm_link_
 
bool initialized_
 
uint32_t last_sent_gnss_raw_tow =0
 
uint32_t last_sent_gnss_tow =0
 
uint64_t offboard_control_time_
 
ROSflightRF_
 
uint8_t send_params_index_
 
Stream streams_ [STREAM_COUNT]
 
uint8_t sysid_
 

Detailed Description

Definition at line 46 of file comm_manager.h.

Member Enumeration Documentation

Enumerator
MODE_PASS_THROUGH 
MODE_ROLLRATE_PITCHRATE_YAWRATE_THROTTLE 
MODE_ROLL_PITCH_YAWRATE_THROTTLE 
MODE_ROLL_PITCH_YAWRATE_ALTITUDE 

Definition at line 70 of file comm_manager.h.

Enumerator
STREAM_ID_HEARTBEAT 
STREAM_ID_STATUS 
STREAM_ID_ATTITUDE 
STREAM_ID_IMU 
STREAM_ID_DIFF_PRESSURE 
STREAM_ID_BARO 
STREAM_ID_SONAR 
STREAM_ID_MAG 
STREAM_ID_SERVO_OUTPUT_RAW 
STREAM_ID_GNSS 
STREAM_ID_GNSS_RAW 
STREAM_ID_RC_RAW 
STREAM_ID_LOW_PRIORITY 
STREAM_COUNT 

Definition at line 49 of file comm_manager.h.

Constructor & Destructor Documentation

rosflight_firmware::CommManager::CommManager ( ROSflight rf,
CommLink comm_link 
)

Definition at line 40 of file comm_manager.cpp.

Member Function Documentation

void rosflight_firmware::CommManager::attitude_correction_callback ( const turbomath::Quaternion q)
private

Definition at line 354 of file comm_manager.cpp.

void rosflight_firmware::CommManager::command_callback ( CommLink::Command  command)
private

Definition at line 241 of file comm_manager.cpp.

void rosflight_firmware::CommManager::heartbeat_callback ( void  )
private

Definition at line 358 of file comm_manager.cpp.

void rosflight_firmware::CommManager::init ( )

Definition at line 49 of file comm_manager.cpp.

void rosflight_firmware::CommManager::log ( CommLink::LogSeverity  severity,
const char *  fmt,
  ... 
)

Definition at line 378 of file comm_manager.cpp.

void rosflight_firmware::CommManager::offboard_control_callback ( const CommLink::OffboardControl control)
private

Definition at line 311 of file comm_manager.cpp.

void rosflight_firmware::CommManager::param_request_list_callback ( uint8_t  target_system)
private

Definition at line 193 of file comm_manager.cpp.

void rosflight_firmware::CommManager::param_request_read_callback ( uint8_t  target_system,
const char *const  param_name,
int16_t  param_index 
)
private

Definition at line 204 of file comm_manager.cpp.

void rosflight_firmware::CommManager::param_set_float_callback ( uint8_t  target_system,
const char *const  param_name,
float  param_value 
)
private

Definition at line 228 of file comm_manager.cpp.

void rosflight_firmware::CommManager::param_set_int_callback ( uint8_t  target_system,
const char *const  param_name,
int32_t  param_value 
)
private

Definition at line 215 of file comm_manager.cpp.

void rosflight_firmware::CommManager::receive ( void  )

Definition at line 373 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_attitude ( void  )
private

Definition at line 419 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_baro ( void  )
private

Definition at line 473 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_diff_pressure ( void  )
private

Definition at line 462 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_error_data ( void  )
private

Definition at line 501 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_gnss ( void  )
private

Definition at line 507 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_gnss_raw ( void  )
private

Definition at line 541 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_heartbeat ( void  )
private

Definition at line 389 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_imu ( void  )
private

Definition at line 427 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_low_priority ( void  )
private

Definition at line 579 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_mag ( void  )
private

Definition at line 496 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_named_value_float ( const char *const  name,
float  value 
)

Definition at line 605 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_named_value_int ( const char *const  name,
int32_t  value 
)
private

Definition at line 600 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_next_param ( void  )
private

Definition at line 610 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_output_raw ( void  )
private

Definition at line 440 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_param_value ( uint16_t  param_id)

Definition at line 167 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_parameter_list ( )

Definition at line 199 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_rc_raw ( void  )
private

Definition at line 447 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_sonar ( void  )
private

Definition at line 484 of file comm_manager.cpp.

void rosflight_firmware::CommManager::send_status ( void  )
private

Definition at line 394 of file comm_manager.cpp.

void rosflight_firmware::CommManager::set_streaming_rate ( uint8_t  stream_id,
int16_t  param_id 
)

Definition at line 595 of file comm_manager.cpp.

void rosflight_firmware::CommManager::stream ( )

Definition at line 585 of file comm_manager.cpp.

void rosflight_firmware::CommManager::timesync_callback ( int64_t  tc1,
int64_t  ts1 
)
private

Definition at line 303 of file comm_manager.cpp.

void rosflight_firmware::CommManager::update_status ( )

Definition at line 162 of file comm_manager.cpp.

void rosflight_firmware::CommManager::update_system_id ( uint16_t  param_id)
private

Definition at line 156 of file comm_manager.cpp.

Member Data Documentation

CommLink& rosflight_firmware::CommManager::comm_link_
private

Definition at line 81 of file comm_manager.h.

bool rosflight_firmware::CommManager::initialized_
private

Definition at line 83 of file comm_manager.h.

uint32_t rosflight_firmware::CommManager::last_sent_gnss_raw_tow =0
private

Definition at line 122 of file comm_manager.h.

uint32_t rosflight_firmware::CommManager::last_sent_gnss_tow =0
private

Definition at line 121 of file comm_manager.h.

uint64_t rosflight_firmware::CommManager::offboard_control_time_
private

Definition at line 79 of file comm_manager.h.

ROSflight& rosflight_firmware::CommManager::RF_
private

Definition at line 80 of file comm_manager.h.

uint8_t rosflight_firmware::CommManager::send_params_index_
private

Definition at line 82 of file comm_manager.h.

Stream rosflight_firmware::CommManager::streams_[STREAM_COUNT]
private
Initial value:
=
{
Stream(0, [this]{this->send_heartbeat();}),
Stream(0, [this]{this->send_status();}),
Stream(0, [this]{this->send_attitude();}),
Stream(0, [this]{this->send_imu();}),
Stream(0, [this]{this->send_diff_pressure();}),
Stream(0, [this]{this->send_baro();}),
Stream(0, [this]{this->send_sonar();}),
Stream(0, [this]{this->send_mag();}),
Stream(0, [this]{this->send_output_raw();}),
Stream(0, [this]{this->send_gnss();}),
Stream(0, [this]{this->send_gnss_raw();}),
Stream(0, [this]{this->send_rc_raw();}),
Stream(20000, [this]{this->send_low_priority();})
}

Definition at line 134 of file comm_manager.h.

uint8_t rosflight_firmware::CommManager::sysid_
private

Definition at line 78 of file comm_manager.h.


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


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