RSeries astromech firmware
DomeDriveSerial Class Reference

#include <drive/DomeDriveSerial.h>

Detailed Description

Base template of automatic forwarder from i2c to CommandEvent.

+ Inheritance diagram for DomeDriveSerial:
+ Collaboration diagram for DomeDriveSerial:

Public Member Functions

 DomeDriveSerial (Stream &stream, JoystickController &domeStick)
 Constructor. More...
 
virtual void setup () override
 Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor. More...
 
virtual void stop () override
 
- Public Member Functions inherited from DomeDrive
 DomeDrive (JoystickController &domeStick)
 Constructor. More...
 
void setDomePosition (DomePosition *domePosition)
 
bool checkError ()
 
bool getEnable () const
 
void setEnable (bool enable)
 
uint32_t getSerialLatency () const
 
void setSerialLatency (uint32_t ms)
 
bool getInverted () const
 
void setInverted (bool invert)
 
bool getScaling () const
 
void setScaling (bool scaling)
 
float getMaxSpeed () const
 
void setMaxSpeed (float modifier)
 
unsigned getThrottleAccelerationScale () const
 
void setThrottleAccelerationScale (unsigned scale)
 
unsigned getThrottleDecelerationScale () const
 
void setThrottleDecelerationScale (unsigned scale)
 
void setDomeStick (JoystickController &domeStick)
 
bool useThrottle ()
 
bool useHardStop ()
 
bool useLeftStick ()
 
bool useRightStick ()
 
void setUseThrottle (bool use)
 
void setUseHardStop (bool use)
 
void setUseLeftStick ()
 
void setUseRightStick ()
 
bool isMoving ()
 
JoystickControllergetActiveStick ()
 
virtual void animate () override
 Subclasses must implement this function to run through a single frame of animation/activity. More...
 
virtual void driveDome (float m)
 
virtual void autonomousDriveDome (float m)
 
virtual bool idle ()
 
- Public Member Functions inherited from SetupEvent
 SetupEvent ()
 Default Constructor. More...
 
- Public Member Functions inherited from AnimatedEvent
 AnimatedEvent ()
 Default Constructor. More...
 
void setLoopDoneCallback (AnimatedLoopDone loopProc)
 

Protected Member Functions

virtual void motor (float m) override
 
void printNumZeroPad (unsigned num)
 
- Protected Member Functions inherited from DomeDrive
virtual float getThrottle ()
 
virtual float throttleSpeed (float speedModifier)
 
int normalize (int degrees)
 
int shortestDistance (int origin, int target)
 
float getSpeed (float percentage)
 
bool moveDomeToTarget (int pos, int target, int fudge, float speed, float &m)
 
void domeStick (JoystickController *stick, float speedModifier)
 

Protected Attributes

Stream * fSerial
 
bool fStopped
 
- Protected Attributes inherited from DomeDrive
JoystickControllerfDomeStick
 
bool fError = false
 
bool fEnabled = false
 
bool fWasConnected = false
 
bool fMotorStopped = false
 
bool fIdle = true
 
bool fScaling = false
 
bool fUseLeftStick = false
 
bool fUseThrottle = true
 
bool fUseHardStop = false
 
bool fInverted = false
 
bool fMoving = false
 
float fSpeedModifier
 
float fDrive = 0
 
float fAutoDrive = 0
 
int fLastDomePosition = -1
 
uint32_t fSerialLatency = 0
 
uint32_t fLastCommand = 0
 
uint32_t fLastDomeMovement = 0
 
bool fDomeMovementStarted = false
 
unsigned fThrottleAccelerationScale = 0
 
unsigned fThrottleDecelerationScale = 0
 
float fDomeThrottle = 0
 
int fLastDomeMode = -1
 
int fAutoDomeTargetPos = 0
 
bool fAutoDomeGoHome = false
 
bool fAutoDomeLeft = random(1)
 
uint32_t fNextAutoDomeMovement = 0
 
DomePositionfDomePosition = nullptr
 
uint32_t fMovementStartTime = 0
 
uint32_t fMovementFinishTime = 0
 
void(* fComplete )() = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from SetupEvent
static void ready ()
 Calls setup() for each created AnimatedEvent subclass. More...
 
- Static Public Member Functions inherited from AnimatedEvent
static void process ()
 Calls animate() for each created AnimatedEvent subclass. More...
 
- Protected Types inherited from DomeDrive
enum  DomeMode { kOff, kHome, kRandom }
 
- Static Protected Member Functions inherited from DomeDrive
static bool withinArc (double p1, double p2, double p3)
 

Constructor & Destructor Documentation

◆ DomeDriveSerial()

DomeDriveSerial::DomeDriveSerial ( Stream &  stream,
JoystickController domeStick 
)
inline

Constructor.

Will drive PWM pin

Member Function Documentation

◆ motor()

virtual void DomeDriveSerial::motor ( float  m)
inlineoverrideprotectedvirtual

Implements DomeDrive.

◆ printNumZeroPad()

void DomeDriveSerial::printNumZeroPad ( unsigned  num)
inlineprotected

◆ setup()

virtual void DomeDriveSerial::setup ( )
inlineoverridevirtual

Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor.

Reimplemented from DomeDrive.

◆ stop()

virtual void DomeDriveSerial::stop ( )
inlineoverridevirtual

Reimplemented from DomeDrive.

Member Data Documentation

◆ fSerial

Stream* DomeDriveSerial::fSerial
protected

◆ fStopped

bool DomeDriveSerial::fStopped
protected

The documentation for this class was generated from the following file:
DomeDriveSerial
Base template of automatic forwarder from i2c to CommandEvent.
Definition: DomeDriveSerial.h:22
DomeDriveSerial.h