|
LRAUV
revA
|
This is the parent class for device drivers that interface with EZServos Since all EZServos shares the same RS-485 bus, this class has a static instance of the StdUart class to interact with the bus. More...
#include <EZServoServo.h>


Public Types | |
| enum | EZServoServoType { BUOYANCY, ELEVATOR, MASS_SHIFTER, RUDDER, THRUSTER, NUM_EZSERVO_SERVOS } |
Public Types inherited from Component | |
| enum | ComponentState { BLOCK_CONTINUOUS, BLOCK_PERIODIC, BLOCK_NORMAL, BLOCK_COMPLETED, BLOCK_UNKNOWN } |
| In this model, the component has basically two states: wanting to run, and completed (no longer needing to run). More... | |
| enum | ComponentType { COMPONENT_ASYNC, COMPONENT_CONFIG, COMPONENT_BEHAVIOR, COMPONENT_SYNC } |
| Components can indicate how they want to be handled by their type. More... | |
| enum | RunState { NO_RUN_STATE = 0, START, STARTING, RUNNABLE, SATISFIED, PAUSE, PAUSING, PAUSED, RESUME, RESUMING, RESETTING, STOP, STOPPING, STOPPED } |
Public Member Functions | |
| EZServoServo (const Str &name, const ConfigURI &uartCfg, const ConfigURI &baudCfg, const Module *module, EZServoServoType motorServoType, int divisor=1, int modulo=0) | |
| virtual | ~EZServoServo () |
Public Member Functions inherited from SyncComponent | |
| CycleOrder | getCycleOrder (void) |
| Getter function for controlThreadOrderPreference. More... | |
| void | setRepeating (bool repeating) |
| int | getDivisor () const |
| int | getModulo () const |
| bool | isRepeater () |
| bool | isRepeating () |
Public Member Functions inherited from Component | |
| virtual | ~Component () |
| Destructor cleans up readers_ and writers_. More... | |
| void | registerReader (DataReader *reader) |
| void | unregisterReader (DataReader *reader) |
| void | registerWriter (DataWriter *writer) |
| void | unregisterWriter (DataWriter *writer) |
| void | disableMetering (void) |
| FlexArray< DataReader * > & | getReaderList (void) |
| FlexArray< DataWriter * > & | getWriterList (void) |
| const Module * | getModule () |
| virtual void | initialize () |
| Provide a space for initialization before being run. More... | |
| virtual void | configure () |
| Read (or re-read!) configuration settings. More... | |
| virtual void | execute (void) |
| virtual void | run () |
| The actual "payload" of the component. More... | |
| virtual void | uninitialize () |
| Provide a space for uninitialization. More... | |
| bool | isActive () const |
| Indicates if the component is active. More... | |
| const CodedStr & | getName (void) const |
| Returns the name. More... | |
| const Timestamp & | getTimeOfLastRun (void) const |
| ComponentState | getState (void) |
| Return the component's current state. More... | |
| void | setState (ComponentState state) |
| RunState | getRunState (void) |
| Return the component's run state. More... | |
| bool | isUsingRunState () |
| Return true if using runState. More... | |
| void | requestData (bool requestingData) |
| Tell the component to start (or stop) sending data. More... | |
| void | requestStart () |
| Tell the component to start runnning. More... | |
| void | requestPause (const Timespan expectedPauseTime) |
| Tell the component to pause runnning. More... | |
| void | requestResume () |
| Tell the component resume from pause. More... | |
| void | requestStop () |
| Tell the component to stop runnning. More... | |
| virtual RunState | start () |
| Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence. More... | |
| virtual RunState | starting () |
| Might follow a STOP...START sequence Subseqent. More... | |
| virtual RunState | runnable () |
| Should eventually follow a START request or RESETTING. More... | |
| virtual RunState | satisfied () |
| Possible return value of a Behavior. More... | |
| virtual RunState | pause () |
| Pause for a short period (indicated by pauseTime) More... | |
| virtual RunState | pausing () |
| Might follow a PAUSE request. More... | |
| virtual RunState | paused () |
| Should eventually follow a PAUSE request: should set continueTime. More... | |
| virtual RunState | resume () |
| Resume from PAUSE. More... | |
| virtual RunState | resuming () |
| Might follow a PAUSE...RESUME sequence. More... | |
| virtual RunState | resetting () |
| Might occur in case of Error. More... | |
| virtual RunState | stop () |
| Initial state – can be later followed by START. More... | |
| virtual RunState | stopping () |
| Might follow a STOP request. More... | |
| virtual RunState | stopped () |
| Should eventually follow a STOP request. More... | |
| void | setCriticalFailureReported (bool boolVal) |
| void | setRecoveringFromCritical (bool boolVal) |
| void | setFailureReported (bool boolVal) |
| bool | isFailureUninitialized () |
| void | setFailureUninitialized (bool boolVal) |
| void | setRetryTimeout (const Timespan &timeout) |
| virtual bool | isCompleted (void) |
| Query if this component is completed. More... | |
| void | setPeriod (const Timespan &period) |
| Set the period of this component... used if it is periodic. More... | |
| const Timespan & | getPeriod (void) |
| Returns the component's period (regardless of whether it is periodic) More... | |
| ComponentType | getComponentType () |
| Getter function for ComponentType. More... | |
| virtual bool | isFailed (void) const |
| virtual FailureMode::FailType | getFailureType (void) const |
| virtual bool | getCriticalFailureReported (void) const |
| virtual bool | getFailureReported (void) const |
| virtual Timespan | getRetryTimeout (void) const |
| virtual FailureMode::FailType | setFailure (FailureMode::FailType failureType) |
| virtual int | getFailCount (void) const |
| virtual bool | isFailureMissionCritical () |
| virtual int | getAllowableFailures (void) const |
| virtual void | setAllowableFailures (int fails) |
| Logger & | getLogger (void) |
| virtual int | incrementFailCount (void) |
| virtual void | resetFailCount (void) |
| virtual int | getSkippedRunsSinceFail (void) const |
| virtual int | incrementSkippedRunsSinceFail (void) |
| virtual void | logVoltage (float voltage, float averageVoltage) |
| virtual void | logCurrent (float current, float averageCurrent) |
| const Timestamp & | getWriteTimestamp (void) |
| void | setWriteTimestamp (const Timestamp &writeTimestamp) |
| BlobReader * | newBlobReader (const BlobURI &blobURI) |
| BlobReader * | newBlobReaderFromUniversal (const Str &componentName, const UniversalBlobURI &blobURI) |
| BlobWriter * | newBlobWriter (const BlobURI &blobURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| ConfigReader * | newConfigReader (const ConfigURI &configURI) |
| DataReader * | newDataReader (const DataURI &dataURI) |
| DataReader * | newDataReaderFromUniversal (const Str &componentName, const UniversalURI &universalURI) |
| DataWriter * | newDataWriter (const DataURI &dataURI, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalBlobReader * | newUniversalBlobReader (const UniversalBlobURI &universalURI) |
| UniversalBlobWriter * | newUniversalBlobWriter (const UniversalBlobURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
| UniversalDataReader * | newUniversalReader (const UniversalURI &universalURI) |
| UniversalDataWriter * | newUniversalWriter (const UniversalURI &universalURI, const Unit &accuracyUnit=Units::NONE, const float accuracy=DataElement::NO_ACCURACY, Logger::TimePrecisionType timePrecision=Logger::TIME_PRECISION_MILLIS) |
Protected Types | |
| enum | EZServoError { NO_ERROR = 0x0, INIT_ERROR = 0x1, BAD_COMMAND_ERROR = 0x2, BAD_OPERAND_ERROR = 0x3, COMM_ERROR = 0x5, NOT_INIT_ERROR = 0x7, OVERLOAD_ERROR = 0x9, NOT_ALLOWED_ERROR = 0xB, COMMAND_OVERFLOW_ERROR = 0xF } |
Protected Types inherited from Component | |
| enum | ConfigOption { CONFIG_SIMULATE_HARDWARE, CONFIG_POWER, CONFIG_FREQUENCY, CONFIG_LATENCY } |
Protected Member Functions | |
| void | initializeStart (void) |
| void | uninitializeStart (void) |
| void | uninitializeEnd () |
| float | getPosition () |
| float | isCommunicating (char *cmd) |
| float | getVelocityCmd () |
| bool | checkPosition (float position) |
| virtual bool | checkResponse (bool checkForReady) |
| float | limit (float value) |
| virtual bool | readConfig () |
Protected Member Functions inherited from SyncServoComponent | |
| SyncServoComponent (const Str &name, const Module *module, int divisor=1, int modulo=0) | |
Protected Member Functions inherited from SyncComponent | |
| void | setRepeater (bool repeater) |
Protected Member Functions inherited from Component | |
| virtual ConfigURI | getConfigURI (ConfigOption configOption) const |
| Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc. More... | |
| virtual ConfigURI | getConfigURI (ConfigOption configOption, ElementURI forElement) const |
| Should return [myNamespace]::POWER_[forElement], [myNamespace]::LATENCY_[forElement], etc. More... | |
| virtual void | setDurationOfLastRun (const Timespan &span) |
| virtual void | setTimeOfRun (const Timestamp &time) |
| virtual void | setTimeOfLastRun (const Timestamp &time) |
| virtual void | setDt (const Timespan &dt) |
| virtual bool | setEnabled (bool enabled=true) |
| void | setRunState (const RunState runState) |
| const Timespan | getPauseTime () const |
| virtual void | setFailureMissionCritical (bool failureMissionCritical) |
| bool | simulateHardware () |
Static Protected Attributes | |
| static const int | RECEIVE_READY = 0x2 |
Private Member Functions | |
| EZServoServo (const EZServoServo &old) | |
Additional Inherited Members | |
Static Public Attributes inherited from SyncComponent | |
| static const int | CYCLE_INCREMENT |
| static const int | CYCLE_REPEAT_OFFSET |
| static const CycleOrder | CYCLE_STARTER |
| static const CycleOrder | CYCLE_SIMULATOR |
| static const CycleOrder | CYCLE_SENSOR |
| static const CycleOrder | CYCLE_DERIVATION |
| static const CycleOrder | CYCLE_ESTIMATION |
| static const CycleOrder | CYCLE_NAVIGATION |
| static const CycleOrder | CYCLE_MISSION_MANAGER |
| static const CycleOrder | CYCLE_MISSION |
| static const CycleOrder | CYCLE_CONTROL |
| static const CycleOrder | CYCLE_SERVO |
| static const CycleOrder | CYCLE_TEST |
| static const CycleOrder | CYCLE_REPORTER |
| static const CycleOrder | CYCLE_LOGGER |
This is the parent class for device drivers that interface with EZServos Since all EZServos shares the same RS-485 bus, this class has a static instance of the StdUart class to interact with the bus.
| EZServoServo::EZServoServo | ( | const Str & | name, |
| const ConfigURI & | uartCfg, | ||
| const ConfigURI & | baudCfg, | ||
| const Module * | module, | ||
| EZServoServoType | motorServoType, | ||
| int | divisor = 1, |
||
| int | modulo = 0 |
||
| ) |
References uartResponse_.
|
virtual |
|
private |
|
protected |
References limitHiCfg_, and limitLoCfg_.
Referenced by getPosition().
|
protectedvirtual |
Reimplemented in MassServo.
References BAD_COMMAND_ERROR, BAD_OPERAND_ERROR, COMM_ERROR, COMMAND_OVERFLOW_ERROR, FailureMode::COMMUNICATIONS, ezServoError_, Syslog::FAULT, FailureMode::HARDWARE, INIT_ERROR, Component::logger_, NO_ERROR, NOT_ALLOWED_ERROR, NOT_INIT_ERROR, OVERLOAD_ERROR, RECEIVE_READY, Component::setFailure(), Logger::syslog(), and uartResponse_.
Referenced by MassServo::checkResponse(), ElevatorServo::runnable(), BuoyancyServo::runnable(), RudderServo::runnable(), ThrusterServo::runnable(), ElevatorServo::starting(), RudderServo::starting(), and BuoyancyServo::starting().
|
protected |
References checkPosition(), controlAddress_, Syslog::ERROR, UartStream::errorString(), UartStream::flushCRLF(), UartStream::hasError(), Component::logger_, UartStream::readLine(), Logger::syslog(), uart_, and uartResponse_.
Referenced by ElevatorServo::runnable(), MassServo::runnable(), RudderServo::runnable(), and BuoyancyServo::runnable().
|
protected |
References controlAddress_, UartStream::errorString(), Syslog::FAULT, UartStream::flushCRLF(), UartStream::hasError(), Component::logger_, UartStream::readLine(), Logger::syslog(), uart_, and uartResponse_.
Referenced by ThrusterServo::runnable().
|
protected |
References UartStream::errorString(), Syslog::FAULT, UartStream::hasError(), Component::logger_, UartStream::open(), Component::simulateHardware(), Logger::syslog(), and uart_.
Referenced by ElevatorServo::start(), MassServo::start(), RudderServo::start(), BuoyancyServo::start(), and ThrusterServo::start().
|
protected |
References controlAddress_, Syslog::ERROR, UartStream::errorString(), UartStream::flushCRLF(), UartStream::hasError(), Component::logger_, UartStream::readLine(), Logger::syslog(), uart_, and uartResponse_.
Referenced by MassServo::waitForHoming().
|
protected |
References AuvMath::Limit(), limitHiCfg_, and limitLoCfg_.
Referenced by ElevatorServo::runnable(), MassServo::runnable(), RudderServo::runnable(), and BuoyancyServo::runnable().
|
protectedvirtual |
Reimplemented in BuoyancyServo, ThrusterServo, MassServo, RudderServo, and ElevatorServo.
References accelCfg_, accelCfgReader_, Units::COUNT, Units::COUNT_PER_ANGULAR_DEGREE, countsPerDegCfg_, countsPerDegCfgReader_, currLimitCfg_, currLimitCfgReader_, Units::DEGREE, deviationAngleCfg_, deviationAngleCfgReader_, limitHiCfg_, limitHiCfgReader_, limitLoCfg_, limitLoCfgReader_, Units::MILLISECOND, mtrCenterCfg_, mtrCenterCfgReader_, Units::NONE, offsetAngleCfg_, offsetAngleCfgReader_, overloadTimeoutCfg_, overloadTimeoutCfgReader_, Units::PERCENT, pidWCfg_, pidWCfgReader_, pidXCfg_, pidXCfgReader_, pidYCfg_, pidYCfgReader_, powerOffTimeoutCfg_, powerOffTimeoutCfgReader_, powerOnTimeoutCfg_, powerOnTimeoutCfgReader_, DataReader::read(), Units::SECOND, velocityCfg_, and velocityCfgReader_.
Referenced by ElevatorServo::readConfig(), RudderServo::readConfig(), MassServo::readConfig(), ThrusterServo::readConfig(), and BuoyancyServo::readConfig().
|
protected |
|
protected |
|
protected |
Referenced by BuoyancyServo::initBuoyancy(), MassServo::initMass(), ThrusterServo::initThruster(), and readConfig().
|
protected |
Referenced by BuoyancyServo::BuoyancyServo(), MassServo::MassServo(), readConfig(), and ThrusterServo::ThrusterServo().
|
protected |
Referenced by getPosition(), getVelocityCmd(), BuoyancyServo::initBuoyancy(), ElevatorServo::initElevator(), MassServo::initMass(), RudderServo::initRudder(), ThrusterServo::initThruster(), isCommunicating(), MassServo::resuming(), ElevatorServo::runnable(), MassServo::runnable(), RudderServo::runnable(), BuoyancyServo::runnable(), ThrusterServo::runnable(), ElevatorServo::starting(), MassServo::starting(), BuoyancyServo::starting(), RudderServo::starting(), ThrusterServo::starting(), and BuoyancyServo::uninitialize().
|
protected |
Referenced by readConfig(), ElevatorServo::runnable(), and RudderServo::runnable().
|
protected |
Referenced by ElevatorServo::ElevatorServo(), readConfig(), and RudderServo::RudderServo().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by ElevatorServo::ElevatorServo(), readConfig(), and RudderServo::RudderServo().
|
protected |
|
protected |
Referenced by checkResponse(), MassServo::checkResponse(), and ThrusterServo::runnable().
|
protected |
Referenced by checkPosition(), limit(), and readConfig().
|
protected |
|
protected |
Referenced by checkPosition(), limit(), and readConfig().
|
protected |
|
protected |
|
protected |
Referenced by readConfig(), ElevatorServo::runnable(), and RudderServo::runnable().
|
protected |
Referenced by ElevatorServo::ElevatorServo(), readConfig(), and RudderServo::RudderServo().
|
protected |
Referenced by ElevatorServo::isNeeded(), RudderServo::isNeeded(), readConfig(), ElevatorServo::runnable(), and RudderServo::runnable().
|
protected |
Referenced by ElevatorServo::ElevatorServo(), readConfig(), and RudderServo::RudderServo().
|
protected |
Referenced by BuoyancyServo::initBuoyancy(), MassServo::initMass(), ThrusterServo::initThruster(), and readConfig().
|
protected |
Referenced by BuoyancyServo::BuoyancyServo(), MassServo::MassServo(), readConfig(), and ThrusterServo::ThrusterServo().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by readConfig(), and BuoyancyServo::stopping().
|
protected |
Referenced by BuoyancyServo::BuoyancyServo(), and readConfig().
|
protected |
|
protected |
Config settings shared by all Servos:
Referenced by BuoyancyServo::BuoyancyServo(), ElevatorServo::ElevatorServo(), MassServo::MassServo(), readConfig(), RudderServo::RudderServo(), and ThrusterServo::ThrusterServo().
|
staticprotected |
Referenced by checkResponse().
|
protected |
Referenced by BuoyancyServo::isNeeded(), MassServo::resume(), MassServo::resuming(), MassServo::runnable(), BuoyancyServo::runnable(), ThrusterServo::runnable(), MassServo::start(), ElevatorServo::start(), BuoyancyServo::start(), RudderServo::start(), ThrusterServo::start(), ElevatorServo::starting(), MassServo::starting(), BuoyancyServo::starting(), RudderServo::starting(), ThrusterServo::starting(), BuoyancyServo::stop(), and BuoyancyServo::stopping().
|
protected |
Referenced by getPosition(), getVelocityCmd(), BuoyancyServo::initBuoyancy(), ElevatorServo::initElevator(), initializeStart(), MassServo::initMass(), RudderServo::initRudder(), ThrusterServo::initThruster(), isCommunicating(), ElevatorServo::pause(), MassServo::pause(), BuoyancyServo::pause(), RudderServo::pause(), ThrusterServo::pause(), ElevatorServo::resume(), MassServo::resume(), BuoyancyServo::resume(), RudderServo::resume(), ThrusterServo::resume(), MassServo::resuming(), MassServo::runnable(), ElevatorServo::runnable(), RudderServo::runnable(), BuoyancyServo::runnable(), ThrusterServo::runnable(), ElevatorServo::starting(), MassServo::starting(), RudderServo::starting(), BuoyancyServo::starting(), ThrusterServo::starting(), ElevatorServo::stopped(), MassServo::stopped(), RudderServo::stopped(), BuoyancyServo::stopped(), ThrusterServo::stopped(), BuoyancyServo::uninitialize(), and MassServo::waitForHoming().
|
protected |
Referenced by checkResponse(), EZServoServo(), getPosition(), getVelocityCmd(), BuoyancyServo::initBuoyancy(), ElevatorServo::initElevator(), RudderServo::initRudder(), ThrusterServo::initThruster(), isCommunicating(), MassServo::resuming(), ElevatorServo::runnable(), MassServo::runnable(), BuoyancyServo::runnable(), RudderServo::runnable(), ThrusterServo::runnable(), ElevatorServo::starting(), MassServo::starting(), RudderServo::starting(), BuoyancyServo::starting(), and ThrusterServo::starting().
|
protected |
Referenced by BuoyancyServo::initBuoyancy(), MassServo::initMass(), and readConfig().
|
protected |
Referenced by BuoyancyServo::BuoyancyServo(), MassServo::MassServo(), and readConfig().