onboardsdk
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
blunux::drone::Drone Class Reference

Class representing a drone. More...

#include <Drone.hpp>

Inheritance diagram for blunux::drone::Drone:
blunux::drone::PioneerDrone

Public Member Functions

 Drone (std::array< std::shared_ptr< imu::IImu >, 2 > imu, std::shared_ptr< pmu::IPMU > pmu, std::shared_ptr< tilt::ITiltControl > tilt_controller)
 
void set_light (float intensity)
 Sets intensity of the drone lights.
 
void set_indicator (blunux::pmu::IndicatorsSetpoint indicators)
 Enable/diable the indicators on the light board.
 
float get_light () const
 Get the current light intensity.
 
float get_depth (bool wait_for_data=true) const
 Get the depth.
 
float get_water_temperature (bool wait_for_data=true) const
 Get the water temperature.
 
std::string get_blunux_version () const
 Get the Blunux version.
 
std::string get_model_name () const
 Get the model name.
 
blueye::protocol::Model get_model () const
 Get the drone Model.
 
pmu::IndicatorsSetpoint get_indicator () const
 Get the indicator status.
 
imu::ImuData get_imu_raw (unsigned int n) const
 Get the raw IMU data of IMU.
 
imu::ImuData get_imu () const
 Get the calibrated IMU data.
 
imu::ImuSelfTest imu_self_test (unsigned int n) const
 Get the IMU self test result.
 
sensors::DepthSelfTestResult depth_self_test () const
 Get the depth self test result.
 
std::optional< float > get_battery_percentage (bool wait_for_data=true) const
 Get the battery percentage.
 
std::optional< std::string > get_battery_type (bool wait_for_data=true) const
 Get the battery type.
 
void add_pressure_callback (std::function< void(const Pressure &)> cb)
 
void add_temperature_callback (std::function< void(const Temperature &)> cb)
 
void add_error_callback (std::function< void(const DroneError &)> cb)
 
std::shared_ptr< tilt::ITiltControltilt ()
 
std::shared_ptr< observer::ICompassCalibrationcompass_calibration ()
 
std::shared_ptr< pmu::IPMUCallbackspmu_callbacks ()
 
std::shared_ptr< observer::IObserverStateobserver_state ()
 
void set_fluid_density (double density)
 Set the fluid density to change between saltwater and freshwater for the depth output.
 
double get_fluid_density () const
 Get the fluid density.
 
blueye::protocol::PressureSensorType get_depth_sensor_type () const
 Get the depth sensor type.
 
void clear_callbacks ()
 

Protected Attributes

const std::array< std::shared_ptr< imu::IImu >, 2 > imu
 
const std::shared_ptr< pmu::IPMU > pmu
 
std::shared_ptr< observer::PioneerObserver > observer
 

Detailed Description

Class representing a drone.

This class represents a drone and provides functionalities for controlling and monitoring the drone's behavior. It encapsulates various components and subsystems of the drone, such as the flight controller, sensors, and communication interfaces.

Member Function Documentation

◆ depth_self_test()

sensors::DepthSelfTestResult blunux::drone::Drone::depth_self_test ( ) const

Get the depth self test result.

Returns
Depth self test result

◆ get_battery_percentage()

std::optional< float > blunux::drone::Drone::get_battery_percentage ( bool  wait_for_data = true) const

Get the battery percentage.

Parameters
wait_for_dataIf true, wait for data from the PMU
Returns
Battery state of charge in %
Examples
be-drone-battery.cpp.

◆ get_battery_type()

std::optional< std::string > blunux::drone::Drone::get_battery_type ( bool  wait_for_data = true) const

Get the battery type.

Parameters
wait_for_dataIf true, wait for data from the PMU
Returns
Batterytype
Examples
be-drone-battery.cpp.

◆ get_blunux_version()

std::string blunux::drone::Drone::get_blunux_version ( ) const

Get the Blunux version.

Returns
Blunux version

◆ get_depth()

float blunux::drone::Drone::get_depth ( bool  wait_for_data = true) const

Get the depth.

Returns
Depth in m
Examples
be-drone-depth.cpp.

◆ get_depth_sensor_type()

blueye::protocol::PressureSensorType blunux::drone::Drone::get_depth_sensor_type ( ) const
inline

Get the depth sensor type.

Returns
blueye::protocol::PressureSensorType Depth sensor type

◆ get_fluid_density()

double blunux::drone::Drone::get_fluid_density ( ) const
inline

Get the fluid density.

Returns
double density in [g/L]

◆ get_imu()

imu::ImuData blunux::drone::Drone::get_imu ( ) const

Get the calibrated IMU data.

Returns
Calibrated imu data
Examples
be-drone-imu.cpp.

◆ get_imu_raw()

imu::ImuData blunux::drone::Drone::get_imu_raw ( unsigned int  n) const

Get the raw IMU data of IMU.

Parameters
nIMU number
Returns
Imu data
Examples
be-drone-imu.cpp.

◆ get_indicator()

pmu::IndicatorsSetpoint blunux::drone::Drone::get_indicator ( ) const

Get the indicator status.

Returns
Indicator status
Examples
be-drone-indicators.cpp.

◆ get_light()

float blunux::drone::Drone::get_light ( ) const

Get the current light intensity.

Returns
Light intensity [0..1]
Examples
be-drone-lights.cpp.

◆ get_model()

blueye::protocol::Model blunux::drone::Drone::get_model ( ) const

Get the drone Model.

Returns
Drone model

◆ get_model_name()

std::string blunux::drone::Drone::get_model_name ( ) const

Get the model name.

Returns
Model name, f. ex. "X3"

◆ get_water_temperature()

float blunux::drone::Drone::get_water_temperature ( bool  wait_for_data = true) const

Get the water temperature.

Returns
Water temperature in °C

◆ imu_self_test()

imu::ImuSelfTest blunux::drone::Drone::imu_self_test ( unsigned int  n) const

Get the IMU self test result.

Parameters
nIMU number
Returns
Imu self test result

◆ set_fluid_density()

void blunux::drone::Drone::set_fluid_density ( double  density)
inline

Set the fluid density to change between saltwater and freshwater for the depth output.

Parameters
densityDensity in [g/L]
Returns
void

◆ set_indicator()

void blunux::drone::Drone::set_indicator ( blunux::pmu::IndicatorsSetpoint  indicators)

Enable/diable the indicators on the light board.

Parameters
indicatorsIndicator status
Examples
be-drone-indicators.cpp.

◆ set_light()

void blunux::drone::Drone::set_light ( float  intensity)

Sets intensity of the drone lights.

Parameters
intensityLight intensity [0..1]
Examples
be-drone-lights.cpp.

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