|
bitsim
Model, simulate, estimate and control robots in C++
|
The keyboard as a radio transmitter: More...
#include <keyboard_rc.h>


Public Member Functions | |
| KeyboardRC (real_t throttle_rate=0.25, real_t deflection=1.0) | |
| bool | OnEvent (const irr::SEvent &event) override |
| control::RCCommand | command (real_t dt) |
| The command for the keys held now, dt [s] after the last call. | |
| bool | reset_requested () |
| True once after R was pressed. | |
| void | reset () |
| Put the throttle down and disarm. | |
| void | set_key (irr::EKEY_CODE key, bool down) |
| Hold a key down or let it go, as if it were pressed, for tests and scripts. | |
The keyboard as a radio transmitter:
| Key | Stick |
|---|---|
| W, S | throttle up, down: it stays where it is left, as a throttle stick does |
| A, D | yaw left, right |
| Up, Down | pitch forward, back |
| Left, Right | roll left, right |
| Space | arm, or disarm |
| R | ask the application to start again |
The yaw, pitch and roll keys deflect their stick by deflection while they are held, and the stick springs back to the centre when they are let go. Add it to the window with chrono::irrlicht::ChVisualSystemIrrlicht::AddUserEventReceiver; it takes these keys, so the camera does not see them.
|
explicit |
| throttle_rate | How fast holding W or S moves the throttle [1/s] |
| deflection | How far the yaw, pitch and roll keys move their sticks, in [0, 1] |
| control::RCCommand bitsim::utils::render::KeyboardRC::command | ( | real_t | dt | ) |
The command for the keys held now, dt [s] after the last call.
|
override |
| void bitsim::utils::render::KeyboardRC::reset | ( | ) |
Put the throttle down and disarm.
| bool bitsim::utils::render::KeyboardRC::reset_requested | ( | ) |
True once after R was pressed.
| void bitsim::utils::render::KeyboardRC::set_key | ( | irr::EKEY_CODE | key, |
| bool | down ) |
Hold a key down or let it go, as if it were pressed, for tests and scripts.