RSeries astromech firmware
|
#include <body/Stance.h>
Manages transition from 2 to 3 legged stance using 4 limit switches.
Public Member Functions | |
Stance (HardwareSerial &saberSerialPort, byte tiltUpPin=6, byte tiltDownPin=7, byte legUpPin=8, byte legDownPin=9, byte legPotPin=A0, byte saberAddress=128) | |
Constructor. More... | |
Stance (byte tiltUpPin=6, byte tiltDownPin=7, byte legUpPin=8, byte legDownPin=9, byte legPotPin=A0, byte saberAddress=128) | |
void | setOrientationSensors (Orientation &bodyIMU, Orientation &tiltIMU) |
virtual void | handleCommand (const char *cmd) override |
Subclasses should implement this function to process commands specific to their device. More... | |
bool | isTwoLegged () |
Returns true if the current stance is two legged. More... | |
bool | isThreeLegged () |
Returns true if the current stance is three legged. More... | |
bool | isValid () |
Returns true if the current stance is either two legged or three legged. More... | |
void | changeToTwoLegged () |
Initiate a transition to two legged mode. More... | |
void | changeToThreeLegged () |
Initiate a transition to three legged mode. More... | |
virtual void | setup () override |
Perform any initialzation not possible in the constructor. More... | |
virtual void | animate () override |
Check status of Sabertooth and limit switches and manage transition if one has been initiated. More... | |
Public Member Functions inherited from AnimatedEvent | |
AnimatedEvent () | |
Default Constructor. More... | |
void | setLoopDoneCallback (AnimatedLoopDone loopProc) |
Additional Inherited Members | |
Static Public Member Functions inherited from AnimatedEvent | |
static void | process () |
Calls animate() for each created AnimatedEvent subclass. More... | |
|
inline |
Constructor.
|
inline |
|
inlineoverridevirtual |
Check status of Sabertooth and limit switches and manage transition if one has been initiated.
Implements AnimatedEvent.
|
inline |
Initiate a transition to three legged mode.
Does nothing if stance is invalid or already three legged.
|
inline |
Initiate a transition to two legged mode.
Does nothing if stance is invalid or already two legged.
|
inlineoverridevirtual |
Subclasses should implement this function to process commands specific to their device.
By convention the first two characters are the device type identifier. 'H' 'P' for holoprojector, etc.
Implements CommandEvent.
|
inline |
Returns true if the current stance is three legged.
|
inline |
Returns true if the current stance is two legged.
|
inline |
Returns true if the current stance is either two legged or three legged.
|
inline |
|
inlineoverridevirtual |
Perform any initialzation not possible in the constructor.
Implements SetupEvent.