Simple fixed-wing airplane model with motor, rudder, elevator, and aileron control.
More...
|
| void | setPinsMotor (int in1, int in2) |
| |
| void | setPinRudder (int pin) |
| |
| void | setPinElevator (int pin) |
| |
| void | setPinsAilerons (int leftPin, int rightPin) |
| |
|
void | setPinServo (ControlSurface surface, int pin) |
| |
| void | setThrottle (int percent) |
| |
| void | setRudder (int angle) |
| |
| void | setElevator (int angle) |
| |
| void | setAilerons (int leftAngle, int rightAngle) |
| |
| void | end () |
| |
| bool | isPinsSet () const |
| | Check if the necessary pins for the vehicle's actuators have been set (pure virtual).
|
| |
| void | setPitch (int angle) |
| |
| void | setRoll (int angle) |
| |
| void | setYaw (int angle) |
| |
| bool | onMessage (const Message< float > &msg) override |
| | Handle an incoming message (pure virtual).
|
| |
| std::vector< MessageContent > | getControls () const override |
| |
|
MotorMT & | getMotor () |
| |
|
ServoMT & | getServo (ControlSurface surface) |
| |
| std::vector< IMotor< T > * > | getMotors () override |
| |
| bool | begin () |
| | Initialize the vehicle.
|
| |
| virtual void | end ()=0 |
| | Reset the vehicle to a safe or neutral state (pure virtual).
|
| |
| virtual bool | isPinsSet () const =0 |
| | Check if the necessary pins for the vehicle's actuators have been set (pure virtual).
|
| |
|
virtual std::vector< MessageContent > | getControls () const =0 |
| |
|
float | getSpeedFactor () const |
| | Get the speed factor (scaling for speed commands).
|
| |
|
void | setSpeedFactor (float factor) |
| | Set the speed factor (scaling for speed commands).
|
| |
|
virtual std::vector< IMotor< MotorT > * > | getMotors ()=0 |
| |
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) |
| |
| void | subscribe (MessageHandler &handler, MessageOrigin origin=MessageOrigin::Undefined, MessageContent content=MessageContent::Undefined) |
| | Subscribe a message handler to this source, with optional filtering.
|
| |
|
void | unsubscribeAll () |
| | Remove all registered message handlers.
|
| |
| void | sendMessage (Message< float > &msg) |
| | Publish a message to all registered handlers.
|
| |
| void | sendMessage (const Message< Coordinate< float > > &msg) |
| | Publish a message to all registered handlers.
|
| |
| void | sendMessage (const Message< GPSCoordinate > &msg) |
| | Publish a message to all registered handlers.
|
| |
|
void | sendMessage (const Message< MotionState3D > &msg) |
| | Overload for MotionState3D messages.
|
| |
template<typename T = float, typename MotorMT = BrushedMotor<T>, typename ServoMT = ServoMotor<T>>
class tinyrobotics::AirPlane< T, MotorMT, ServoMT >
Simple fixed-wing airplane model with motor, rudder, elevator, and aileron control.
This class abstracts the control of a basic RC airplane:
- Motor (throttle) via ServoMotor (ESC)
- Rudder (yaw), Elevator (pitch), and Ailerons (roll) via ServoMotor
Usage Example:
Simple fixed-wing airplane model with motor, rudder, elevator, and aileron control.
Definition: AirPlane.h:35
void setPinsAilerons(int leftPin, int rightPin)
Definition: AirPlane.h:69
void setPinElevator(int pin)
Definition: AirPlane.h:62
void setPinsMotor(int in1, int in2)
Definition: AirPlane.h:49
void setAilerons(int leftAngle, int rightAngle)
Definition: AirPlane.h:116
void setElevator(int angle)
Definition: AirPlane.h:107
void setRudder(int angle)
Definition: AirPlane.h:98
void setPinRudder(int pin)
Definition: AirPlane.h:55
void setThrottle(int percent)
Definition: AirPlane.h:87