|
TinyRobotics
|
IOdometryModel3D implementation for fixed-wing airplanes using control surface and throttle inputs. More...
#include <AirplaneOdometryModel3D.h>


Public Member Functions | |
| void | registerCallback (void(*callback)(void *), void *userData) override |
| Register a callback to be invoked on relevant events (e.g., input change). | |
| AirplaneOdometryModel3D (float maxSpeed=30.0f, float maxRollRate=57.0f, float maxPitchRate=40.0f, float maxYawRate=29.0f) | |
| Construct an AirplaneOdometryModel3D with configurable max rates. | |
| bool | onMessage (const Message< float > &msg) |
| Handle incoming control messages to set airplane control surfaces and throttle. Supports MessageContent::Throttle, Roll, Pitch, Yaw (float values). | |
| void | setThrottle (float percent) |
| void | setAileron (float deg) |
| void | setElevator (float deg) |
| void | setRudder (float deg) |
| void | getLinearVelocity (float &vx, float &vy, float &vz) const override |
| Get the current linear velocity (vx, vy, vz) in m/s (robot frame). | |
| void | getAngularVelocity (float &wx, float &wy, float &wz) const override |
| Get the current angular velocity (wx, wy, wz) in rad/s (robot frame). | |
| virtual void | registerCallback (void(*callback)(void *), void *userData) |
| Register a callback to be invoked on relevant events (e.g., input change, update). | |
| virtual void | getLinearVelocity (float &vx, float &vy, float &vz) const =0 |
| Get the current linear velocity (vx, vy, vz) in m/s (robot frame). | |
| virtual void | getAngularVelocity (float &wx, float &wy, float &wz) const =0 |
| Get the current angular velocity (wx, wy, wz) in rad/s (robot frame). | |
Public Member Functions inherited from MessageHandler | |
| virtual bool | onMessage (const Message< float > &msg)=0 |
| Handle an incoming message (pure virtual). | |
| virtual bool | onMessage (const Message< Coordinate< float > > &msg) |
| virtual bool | onMessage (const Message< GPSCoordinate > &msg) |
| virtual bool | onMessage (const Message< MotionState3D > &msg) |
Static Protected Member Functions | |
| static float | clamp (float v, float min, float max) |
IOdometryModel3D implementation for fixed-wing airplanes using control surface and throttle inputs.
This model computes linear and angular velocities for a fixed-wing airplane based on control inputs:
The model can be updated from messages (e.g., from an RC receiver or autopilot):
|
inline |
Construct an AirplaneOdometryModel3D with configurable max rates.
| maxSpeed | Maximum forward speed (m/s). Typical: 20–40 m/s for small UAVs. |
| maxRollRate | Maximum roll rate (deg/s). Typical: 40–85 deg/s (converted to rad/s internally). |
| maxPitchRate | Maximum pitch rate (deg/s). Typical: 30–60 deg/s (converted to rad/s internally). |
| maxYawRate | Maximum yaw rate (deg/s). Typical: 17–40 deg/s (converted to rad/s internally). |
These values should be set to match the physical or simulated aircraft's limits. For most fixed-wing RC airplanes:
Note: The constructor will convert the rates from deg/s to rad/s for internal use. Example: AirplaneOdometryModel3D(30.0f, 57.0f, 40.0f, 29.0f); // 30 m/s, 57°/s, 40°/s, 29°/s
|
inlineoverridevirtual |
Get the current angular velocity (wx, wy, wz) in rad/s (robot frame).
Implements IOdometryModel3D.
|
inlineoverridevirtual |
Get the current linear velocity (vx, vy, vz) in m/s (robot frame).
Implements IOdometryModel3D.
|
inlinevirtual |
Handle incoming control messages to set airplane control surfaces and throttle. Supports MessageContent::Throttle, Roll, Pitch, Yaw (float values).
Implements MessageHandler.
|
inlineoverridevirtual |
Register a callback to be invoked on relevant events (e.g., input change).
Reimplemented from IOdometryModel3D.