MAV'RIC
|
Simulation for sonars. More...
#include <sonar_sim.hpp>
Public Member Functions | |
Sonar_sim (Dynamic_model &dynamic_model, sonar_sim_conf_t config=sonar_sim_default_config()) | |
Constructor. | |
bool | init (void) |
Initialise the sensor. | |
bool | update (void) |
Main update function Reads new values from sensor. | |
const float & | last_update_us (void) const |
Get last update time in microseconds. | |
const std::array< float, 3 > & | orientation_bf (void) const |
Get sensor orientation relative to the platform (in body frame) | |
const float & | distance (void) const |
Get latest distance measure. | |
const float & | velocity (void) const |
Get velocity estimate from consecutive measurements. | |
const bool & | healthy (void) const |
Indicates whether the measurements can be trusted. |
Simulation for sonars.
Sonar_sim::Sonar_sim | ( | Dynamic_model & | dynamic_model, |
sonar_sim_conf_t | config = sonar_sim_default_config() |
||
) |
Constructor.
dynamic_model | Reference to dynamic model |
config | Configuration |
const float & Sonar_sim::distance | ( | void | ) | const [virtual] |
const bool & Sonar_sim::healthy | ( | void | ) | const [virtual] |
bool Sonar_sim::init | ( | void | ) | [virtual] |
const float & Sonar_sim::last_update_us | ( | void | ) | const [virtual] |
const std::array< float, 3 > & Sonar_sim::orientation_bf | ( | void | ) | const [virtual] |
Get sensor orientation relative to the platform (in body frame)
Implements Sonar.
bool Sonar_sim::update | ( | void | ) | [virtual] |
Main update function Reads new values from sensor.
H: scalar (altitude) D: scalar (measure) z: down vector ||z||=1 u: sensor vector ||u||=1
With Altitude = H.z Distance = D.u
We have D = H / (u.z)
Implements Sonar.
const float & Sonar_sim::velocity | ( | void | ) | const [virtual] |