bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::boards::SIM_RCLink Class Referencefinal

The radio link to a simulated quadrotor: the transmitter end sends commands, and the simulated receiver reads the latest one. More...

#include <sim_rc_link.h>

Inheritance diagram for bitsim::boards::SIM_RCLink:
Collaboration diagram for bitsim::boards::SIM_RCLink:

Public Member Functions

 SIM_RCLink (real_t timeout=0.5)
void send (const control::RCCommand &command, real_t time) override
 Send a command at time [s], the clock of the application.
std::string backend_type_str () const override
 The name of the backend, such as SIMULATION.
control::RCCommand receive (real_t time) const
 What the receiver passes to the flight controller at time [s]: the last command, clamped, or the failsafe command.
bool in_failsafe (real_t time) const noexcept
 True when the receiver has heard nothing for longer than the timeout at time [s].
real_t timeout () const noexcept
Public Member Functions inherited from bitsim::boards::RCTransmitterBase
virtual ~RCTransmitterBase ()=default

Detailed Description

The radio link to a simulated quadrotor: the transmitter end sends commands, and the simulated receiver reads the latest one.

Like a real receiver, it goes into failsafe when it has heard nothing for longer than the timeout, or before the first command: it then gives control::failsafe_command(), which disarms the drone so that its motors stop.

Constructor & Destructor Documentation

◆ SIM_RCLink()

bitsim::boards::SIM_RCLink::SIM_RCLink ( real_t timeout = 0.5)
explicit
Parameters
timeoutHow long the receiver waits for a command before it goes into failsafe [s]

Member Function Documentation

◆ backend_type_str()

std::string bitsim::boards::SIM_RCLink::backend_type_str ( ) const
inlineoverridevirtual

The name of the backend, such as SIMULATION.

Implements bitsim::boards::RCTransmitterBase.

◆ in_failsafe()

bool bitsim::boards::SIM_RCLink::in_failsafe ( real_t time) const
noexcept

True when the receiver has heard nothing for longer than the timeout at time [s].

◆ receive()

control::RCCommand bitsim::boards::SIM_RCLink::receive ( real_t time) const

What the receiver passes to the flight controller at time [s]: the last command, clamped, or the failsafe command.

◆ send()

void bitsim::boards::SIM_RCLink::send ( const control::RCCommand & command,
real_t time )
overridevirtual

Send a command at time [s], the clock of the application.

Implements bitsim::boards::RCTransmitterBase.

◆ timeout()

real_t bitsim::boards::SIM_RCLink::timeout ( ) const
inlinenoexcept

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