![]() |
Laelaps
2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
|
Laelaps robotic manipulator plus accesories class. More...
#include <laeRobot.h>
Public Member Functions | |
LaeRobot (bool bNoExec=false) | |
Default initialization constructor. More... | |
virtual | ~LaeRobot () |
Destructor. | |
int | connect () |
Connect to Laelaps. More... | |
int | disconnect () |
Disconnect from Laelaps. More... | |
int | reload () |
Reload Laelaps's reloadable configuration and reset operational parameters. More... | |
int | estop () |
Emergency stop. More... | |
int | resetEStop () |
Reset (clears) emergency stop condition. More... | |
int | freeze () |
Freeze robot and accessories at current position. More... | |
int | release () |
Release robot and accessories. More... | |
int | stop () |
Stop robot with full dynamic braking. More... | |
int | move (const LaeMapVelocity &velocity) |
Move by setting powertrain angular wheel velocities. More... | |
int | move (double fVelLinear, double fVelAngular) |
Move at the given linear and angular velocities. More... | |
int | setDutyCycles (const LaeMapDutyCycle &duty) |
Set powertrain motor duty cycles. More... | |
double | setGovernor (double fGovernor) |
Set speed limit governor value. More... | |
double | incrementGovernor (double fDelta) |
Increment/decrement speed limit governor value. More... | |
double | getGovernor () |
Get current speed limit governor setting. More... | |
void | setRobotMode (LaeRobotMode eRobotMode) |
Set robot's operational mode. More... | |
int | setAuxPower (const std::string &strName, LaeTriState eState) |
Set top deck auxilliary power out enable state. More... | |
int | clearAlarms () |
Attempt to clear all alarms. More... | |
virtual int | configDigitalPin (uint_t pin, uint_t dir) |
Configure a digital pin on the the watchdog subprocessor. More... | |
virtual int | readDigitalPin (uint_t pin, uint_t &val) |
Read the value of a digital pin on the watchdog subprocessor. More... | |
virtual int | writeDigitalPin (uint_t pin, uint_t val) |
Write a value to a digital pin on the watchdog subprocessor. More... | |
virtual int | readAnalogPin (uint_t pin, uint_t &val) |
Read the value of an analog pin on the watchdog subprocessor. More... | |
virtual int | getImu (double accel[], double gyro[], double rpy[], sensor::imu::Quaternion &q) |
Get the last read and converted inertia data. More... | |
virtual int | getRangeSensorProps (const std::string &strKey, std::string &strRadiationType, double &fFoV, double &fBeamDir, double &fMin, double &fMax) |
Get range sensor properties. More... | |
virtual int | getRange (const std::string &strKey, double &fRange) |
Get a range measurement. More... | |
virtual int | getRange (std::vector< std::string > &vecNames, std::vector< double > &vecRanges) |
Get all sensor range measurements. More... | |
virtual int | getAmbientLight (const std::string &strKey, double &fAmbient) |
Get an ambient light illuminance measurement. More... | |
virtual int | getAmbientLight (std::vector< std::string > &vecNames, std::vector< double > &vecAmbient) |
Get all sensor ambient light illuminance measurements. More... | |
int | runAsyncJob () |
Run asynchronous job. More... | |
void | cancelAsyncJob () |
Cancel any asynchronous job. More... | |
LaeAsyncJob::JobState | getAsyncJobState () |
Get the current asynchronous job state. More... | |
int | getAsyncJobRc () |
Get the last asynchronous job exit return code. More... | |
int | getRobotStatus (LaeRptRobotStatus &rptBotStatus) |
Get the robot current status. More... | |
int | getDynamics (LaeRptDynamics &rptDynamics) |
Get the robot full dynamic state. More... | |
int | getNavigationState (LaeSimplePathFeedback &pathFeedback) |
Get simple navigation feedback. More... | |
int | getNavigationState (LaePathFeedback &pathFeedback) |
Get navigation feedback. More... | |
bool | isConnected () |
Test if connected to Laelaps hardware. More... | |
void | getVersion (int &nVerMajor, int &nVerMinor, int &nRevision) |
Get the Laelaps hardware version number. More... | |
std::string | getVersionString () |
Get the Laelaps robotic arm hardware version string. More... | |
LaeDesc & | getLaelapsDesc () |
Get the Laelaps product description. More... | |
int | getProdId () |
Convenience function to get this Laelaps description's base product id. More... | |
std::string | getProdName () |
Convenience function to get this Laelaps description's base product name. More... | |
std::string | getFullProdBrief () |
Get the Laelaps full brief descirption. More... | |
bool | isDescribed () |
Test if robot is fully described via configuration XML. More... | |
LaeRobotMode | getRobotMode () |
Get robot's operational mode. More... | |
bool | isEStopped () |
Test if robot is current emergency stopped. More... | |
bool | areMotorsPowered () |
Test if robot motor are currently being driven (powered). More... | |
bool | isInMotion () |
Test if any joint in any of the kinematic chains is moving. More... | |
bool | isAlarmed () |
Test if robot is alarmed. More... | |
bool | canMove () |
Test if robot is safe to operate, given the current robot and alarm state. More... | |
LaePowertrain * | getPowertrain (const std::string &strName) |
Get the robotic joint in kinematic chain. More... | |
LaePowertrain * | getPowertrain (int nMotorId) |
Get robotic joint in kinematic chain. More... | |
Static Public Attributes | |
static const double | GovernorDft = 1.0 |
speed limit governor start-up default | |
Protected Member Functions | |
void | syncDb () |
Synchronize real-time database with current robot state. | |
int | connSensors () |
Connect to the Laelaps built-in sensors. More... | |
int | connWatchDog () |
Connect to the watchdog subprocessor. More... | |
int | connMotorControllers (const std::string &strDevMotorCtlrs, const int nBaudRate) |
Connect to the Laelaps motor controllers. More... | |
int | configForOperation () |
Configure Laelaps for normal operation. More... | |
int | startCoreThreads () |
Create and start all real-time persistent core threads. More... | |
int | startThread (LaeThread *pThread, int nPriority, double fHz) |
Create and start a thread at the given priority and hertz. More... | |
Protected Attributes | |
bool | m_bNoExec |
do [not] execute physical movements | |
LaeDesc | m_descLaelaps |
Laelaps description | |
bool | m_bIsConnected |
critical hardware [not] connected | |
LaeRobotMode | m_eRobotMode |
robot operating mode | |
bool | m_bIsEStopped |
robot is [not] emergency stopped | |
bool | m_bAlarmState |
robot is [not] alarmed | |
double | m_fGovernor |
speed limit governor setting | |
LaeTunes | m_tunes |
tuning parameters | |
LaeI2C | m_i2cBus |
I2C sensor bus. | |
sensor::vl6180::LaeRangeSensorGroup | m_range |
range sensor group. | |
sensor::imu::LaeImuCleanFlight | m_imu |
inertia measurement unit | |
LaeWd | m_watchdog |
watchdog sub-processor | |
LaeKinematics | m_kin |
robot base dynamics and kinematics | |
LaeThreadAsync | m_threadAsync |
asynchronous action thread | |
LaeThreadImu | m_threadImu |
IMU thread. | |
LaeThreadKin | m_threadKin |
kinodynamics thread | |
LaeThreadRange | m_threadRange |
ToF range sensors thread. | |
LaeThreadWd | m_threadWatchDog |
watchdog thread | |
LaeAsyncJob * | m_pAsyncJob |
asynchronous job | |
Friends | |
class | LaeRptDynamics |
class | LaeRptRobotStatus |
Laelaps robotic manipulator plus accesories class.
Definition at line 103 of file laeRobot.h.
LaeRobot::LaeRobot | ( | bool | bNoExec = false | ) |
Default initialization constructor.
bNoExec | Do [not] execute on physical hardware. All commands and responses are supported but the lower level hardware commands will not be issued. |
Definition at line 164 of file laeRobot.cxx.
References GovernorDft, laelaps::LaeRobotModeUnknown, m_bAlarmState, m_bIsConnected, m_bIsEStopped, m_bNoExec, m_eRobotMode, m_pAsyncJob, setGovernor(), and syncDb().
bool LaeRobot::areMotorsPowered | ( | ) |
Test if robot motor are currently being driven (powered).
Definition at line 781 of file laeRobot.cxx.
References laelaps::LaeKinematics::areMotorsPowered(), and m_kin.
Referenced by canMove().
void LaeRobot::cancelAsyncJob | ( | ) |
Cancel any asynchronous job.
Definition at line 1125 of file laeRobot.cxx.
References m_threadAsync, and laelaps::LaeThreadAsync::terminateThread().
Referenced by disconnect().
bool LaeRobot::canMove | ( | ) |
Test if robot is safe to operate, given the current robot and alarm state.
Definition at line 807 of file laeRobot.cxx.
References areMotorsPowered(), laelaps::LaeAlarms::isSafeToOperate(), and m_bIsEStopped.
Referenced by laelaps::LaeRptRobotStatus::generate().
int LaeRobot::clearAlarms | ( | ) |
Attempt to clear all alarms.
Definition at line 598 of file laeRobot.cxx.
References laelaps::LAE_OK, and LAE_TRY_CONN.
|
virtual |
Configure a digital pin on the the watchdog subprocessor.
pin | Digital pin number. |
dir | Pin direction. 0 == input, 1 == output. |
Definition at line 614 of file laeRobot.cxx.
References laelaps::LaeWd::cmdConfigDPin(), and m_watchdog.
|
protected |
Configure Laelaps for normal operation.
The arm, end effector, and accessory effectors are configured for normal operation.
Definition at line 947 of file laeRobot.cxx.
References laelaps::LaeWd::configure(), laelaps::LaeKinematics::configure(), sensor::imu::LaeImu::configure(), sensor::vl6180::LaeRangeSensorGroup::configure(), laelaps::LAE_OK, m_descLaelaps, m_imu, m_kin, m_range, m_tunes, and m_watchdog.
Referenced by connect().
int LaeRobot::connect | ( | ) |
Connect to Laelaps.
Definition at line 193 of file laeRobot.cxx.
References configForOperation(), connMotorControllers(), connSensors(), connWatchDog(), disconnect(), freeze(), laelaps::i2cTryOpen(), laelaps::LaeDesc::isDescribed(), laelaps::LAE_ECODE_BAD_OP, laelaps::LAE_OK, laelaps::LaeBaudRateMotorCtlrs, laelaps::LaeDevMotorCtlrs, laelaps::LaeEtcTune, laelaps::LaeI2CAddrWd, laelaps::LaeRobotModeAuto, laelaps::LaeRobotModeUnknown, laelaps::LaeSysCfgPath, laelaps::LaeXmlTune::load(), m_bAlarmState, m_bIsConnected, m_bIsEStopped, m_descLaelaps, m_eRobotMode, m_i2cBus, m_tunes, startCoreThreads(), and syncDb().
Referenced by main().
|
protected |
Connect to the Laelaps motor controllers.
Motors controller serial interface support multi-drop, so one serial device can support up to 8 motor controllers.
strDevMotorCtlrs | Motor controllers serial device name. |
nBaudRate | Motor controllers serial baudrate. |
Definition at line 928 of file laeRobot.cxx.
References laelaps::LaeWd::enableMotorCtlrs(), m_kin, m_watchdog, and laelaps::LaeKinematics::open().
Referenced by connect().
|
protected |
Connect to the Laelaps built-in sensors.
Sensors are not critical to core operation, so failed sensors are simply blacklisted, rather than failing the robot.
Definition at line 849 of file laeRobot.cxx.
References sensor::imu::LaeImu::blacklist(), sensor::vl6180::LaeRangeSensorGroup::blacklist(), sensor::vl6180::LaeRangeSensorGroup::clearSensedData(), sensor::vl6180::LaeRangeSensorGroup::getInterfaceVersion(), laelaps::LaeDesc::getProdHwVer(), laelaps::LAE_OK, laelaps::LaeBaudRateIMU, laelaps::LaeDevIMU, m_descLaelaps, m_imu, m_range, sensor::imu::LaeImu::open(), sensor::imu::LaeImuCleanFlight::readIdentity(), and sensor::vl6180::LaeRangeSensorGroup::setInterface().
Referenced by connect().
|
protected |
Connect to the watchdog subprocessor.
Definition at line 909 of file laeRobot.cxx.
References laelaps::LaeWd::cmdGetFwVersion(), laelaps::LAE_OK, m_watchdog, and laelaps::LaeWd::sync().
Referenced by connect().
int LaeRobot::disconnect | ( | ) |
Disconnect from Laelaps.
Definition at line 333 of file laeRobot.cxx.
References cancelAsyncJob(), sensor::imu::LaeImu::clearSensedData(), sensor::vl6180::LaeRangeSensorGroup::clearSensedData(), laelaps::LaeI2C::close(), laelaps::LaeKinematics::close(), sensor::imu::LaeImu::close(), isConnected(), laelaps::LAE_OK, laelaps::LaeRobotModeUnknown, m_bAlarmState, m_bIsConnected, m_bIsEStopped, m_eRobotMode, m_i2cBus, m_imu, m_kin, m_range, m_threadImu, m_threadKin, m_threadRange, m_threadWatchDog, syncDb(), and laelaps::LaeThread::terminateThread().
Referenced by connect(), main(), and ~LaeRobot().
int LaeRobot::estop | ( | ) |
Emergency stop.
All motor will stop driving, so arm or accessories may fall.
Definition at line 421 of file laeRobot.cxx.
References laelaps::LaeKinematics::estop(), laelaps::LaeKinematics::isEnabled(), laelaps::LAE_ECODE_MOT_CTLR, laelaps::LAE_OK, LAE_TRY_CONN, LAE_TRY_NO_EXEC, m_bAlarmState, m_bIsEStopped, m_kin, and syncDb().
int LaeRobot::freeze | ( | ) |
Freeze robot and accessories at current position.
Motors are still being driven. The motors are either dynamically or regeneratively braked.
Definition at line 486 of file laeRobot.cxx.
References laelaps::LAE_OK, LAE_TRY_CONN, LAE_TRY_NO_EXEC, m_kin, and laelaps::LaeKinematics::stop().
Referenced by connect(), and stop().
|
virtual |
Get an ambient light illuminance measurement.
strKey | Sensor's unique name (key). | |
[out] | fAmbient | Sensed ambient light (lux). |
Referenced by getRangeSensorProps().
|
virtual |
Get all sensor ambient light illuminance measurements.
[out] | vecNames | Vector of sensor unique names. |
[out] | vecAmbient | Vector of associated sensor measured ambients (lux). |
int LaeRobot::getAsyncJobRc | ( | ) |
Get the last asynchronous job exit return code.
Definition at line 1142 of file laeRobot.cxx.
References laelaps::LaeAsyncJob::getRc(), laelaps::LAE_ECODE_NO_RSRC, and m_pAsyncJob.
LaeAsyncJob::JobState LaeRobot::getAsyncJobState | ( | ) |
Get the current asynchronous job state.
Definition at line 1130 of file laeRobot.cxx.
References laelaps::LaeAsyncJob::getState(), laelaps::LaeAsyncJob::JobStateNoJob, and m_pAsyncJob.
int LaeRobot::getDynamics | ( | LaeRptDynamics & | rptDynamics | ) |
Get the robot full dynamic state.
[in,out] | rptDynamics | Robot dynamics state report. |
Definition at line 682 of file laeRobot.cxx.
References laelaps::LaeRptDynamics::clear(), laelaps::LaeRptDynamics::generate(), laelaps::LAE_OK, and LAE_TRY_CONN.
string LaeRobot::getFullProdBrief | ( | ) |
Get the Laelaps full brief descirption.
Definition at line 761 of file laeRobot.cxx.
References laelaps::LaeDesc::getProdBrief(), and m_descLaelaps.
double LaeRobot::getGovernor | ( | ) |
Get current speed limit governor setting.
Definition at line 559 of file laeRobot.cxx.
References m_fGovernor.
|
virtual |
Get the last read and converted inertia data.
Not applicable data are set to zero.
[out] | accel | Accelerometer data (m/s^2). The array size must be ≥ NumOfAxes. |
[out] | gyro | Gyroscope data (radians/s). The array size must be ≥ NumOfAxes. |
[out] | rpy | Roll,pitch,yaw data (radians). The array size must be ≥ NumOfAxes. |
[out] | q | Vehicle quaternion. |
Definition at line 634 of file laeRobot.cxx.
References sensor::imu::LaeImu::getImuData(), laelaps::LAE_OK, m_imu, and sensor::imu::NumOfAxes.
LaeDesc & LaeRobot::getLaelapsDesc | ( | ) |
Get the Laelaps product description.
Definition at line 746 of file laeRobot.cxx.
References m_descLaelaps.
Referenced by main().
int LaeRobot::getNavigationState | ( | LaeSimplePathFeedback & | pathFeedback | ) |
Get simple navigation feedback.
[in,out] | pathFeedback | Navigation feedback state. |
Definition at line 693 of file laeRobot.cxx.
References laelaps::LaeSimplePathFeedback::clear(), and laelaps::LAE_OK.
int LaeRobot::getNavigationState | ( | LaePathFeedback & | pathFeedback | ) |
Get navigation feedback.
[in,out] | pathFeedback | Navigation feedback state. |
Definition at line 702 of file laeRobot.cxx.
References laelaps::LaePathFeedback::clear(), laelaps::LaeKinematics::getPowertrain(), getPowertrain(), laelaps::LAE_OK, and m_kin.
LaePowertrain* laelaps::LaeRobot::getPowertrain | ( | const std::string & | strName | ) |
Get the robotic joint in kinematic chain.
strName | Powertrain unique name (primary key). |
Referenced by getNavigationState().
LaePowertrain * LaeRobot::getPowertrain | ( | int | nMotorId | ) |
Get robotic joint in kinematic chain.
nMotorId | Motor id (secondary key). |
Definition at line 716 of file laeRobot.cxx.
References laelaps::LaeKinematics::getPowertrain(), and m_kin.
int LaeRobot::getProdId | ( | ) |
Convenience function to get this Laelaps description's base product id.
Definition at line 751 of file laeRobot.cxx.
References laelaps::LaeDesc::getProdId(), and m_descLaelaps.
string LaeRobot::getProdName | ( | ) |
Convenience function to get this Laelaps description's base product name.
Definition at line 756 of file laeRobot.cxx.
References laelaps::LaeDesc::getProdName(), and m_descLaelaps.
|
virtual |
Get a range measurement.
strKey | Sensor's unique name (key). | |
[out] | fRange | Sensed object range (meters). |
Referenced by getRangeSensorProps().
|
virtual |
Get all sensor range measurements.
[out] | vecNames | Vector of sensor unique names. |
[out] | vecRanges | Vector of associated sensor measured ranges (meters). |
|
virtual |
Get range sensor properties.
strKey | Sensor's unique name id (key). | |
[out] | strRadiationType | Radiation type. |
[out] | fFoV | Field of View (radians). |
[out] | fBeamdir | Center of beam direction (radians). |
[out] | fMin | Minimum range (meters). |
[out] | fMax | Maximum range (meters). |
Definition at line 643 of file laeRobot.cxx.
References getAmbientLight(), sensor::vl6180::LaeRangeSensorGroup::getAmbientLight(), getRange(), sensor::vl6180::LaeRangeSensorGroup::getRange(), sensor::vl6180::LaeRangeSensorGroup::getSensorProps(), and m_range.
LaeRobotMode LaeRobot::getRobotMode | ( | ) |
Get robot's operational mode.
Definition at line 771 of file laeRobot.cxx.
References m_eRobotMode.
int LaeRobot::getRobotStatus | ( | LaeRptRobotStatus & | rptBotStatus | ) |
Get the robot current status.
[in,out] | rptBotStatus | Robot status report. |
Definition at line 605 of file laeRobot.cxx.
References laelaps::LaeRptRobotStatus::clear(), laelaps::LaeRptRobotStatus::generate(), and laelaps::LAE_OK.
void LaeRobot::getVersion | ( | int & | nVerMajor, |
int & | nVerMinor, | ||
int & | nRevision | ||
) |
Get the Laelaps hardware version number.
[out] | nVerMajor | Major version number. |
[out] | nVerMinor | Minor version number. |
[out] | nVerRevision | Revision version number. |
Definition at line 731 of file laeRobot.cxx.
References laelaps::LaeDesc::getProdHwVer(), LAE_VER_MAJOR, LAE_VER_MINOR, LAE_VER_REV, and m_descLaelaps.
string LaeRobot::getVersionString | ( | ) |
Get the Laelaps robotic arm hardware version string.
Version number strings are of the dotted form maj.min.rev.
Definition at line 741 of file laeRobot.cxx.
References laelaps::LaeDesc::getProdHwVerString(), and m_descLaelaps.
double LaeRobot::incrementGovernor | ( | double | fDelta | ) |
Increment/decrement speed limit governor value.
Governor is defined as:
speed = set_speed * governor
fDelta | Governor ± delta. |
Definition at line 554 of file laeRobot.cxx.
References m_fGovernor, and setGovernor().
bool LaeRobot::isAlarmed | ( | ) |
Test if robot is alarmed.
Definition at line 791 of file laeRobot.cxx.
References isEStopped(), laelaps::LAE_ALARM_NONE, laelaps::LaeDb::m_alarms, m_bAlarmState, laelaps::LaeDbAlarms::m_system, laelaps::LaeAlarmInfo::m_uAlarms, and laelaps::RtDb.
bool LaeRobot::isConnected | ( | ) |
Test if connected to Laelaps hardware.
Definition at line 726 of file laeRobot.cxx.
References m_bIsConnected.
Referenced by disconnect(), and main().
bool LaeRobot::isDescribed | ( | ) |
Test if robot is fully described via configuration XML.
Definition at line 766 of file laeRobot.cxx.
References laelaps::LaeDesc::isDescribed(), and m_descLaelaps.
bool LaeRobot::isEStopped | ( | ) |
Test if robot is current emergency stopped.
Definition at line 776 of file laeRobot.cxx.
References m_bIsEStopped.
Referenced by isAlarmed().
bool LaeRobot::isInMotion | ( | ) |
Test if any joint in any of the kinematic chains is moving.
Definition at line 786 of file laeRobot.cxx.
References laelaps::LaeKinematics::isStopped(), and m_kin.
int LaeRobot::move | ( | const LaeMapVelocity & | velocity | ) |
Move by setting powertrain angular wheel velocities.
The robot is controlled by setting the goal velocities of a [sub]set of powertrain motors.
velocity | Map of powertrain velocities. Keys are left_front, right_front, left_rear, and right_rear. Values are drive shaft/wheel angular velocities (radians/second). |
Definition at line 517 of file laeRobot.cxx.
References LAE_TRY_CONN, m_kin, and laelaps::LaeKinematics::setGoalVelocities().
int LaeRobot::move | ( | double | fVelLinear, |
double | fVelAngular | ||
) |
Move at the given linear and angular velocities.
This move is typically used with the ROS Twist message where:
fVelLinear | Linear velocity (meters/second). |
fVelAngular | Angular velocity (radians/second). |
Definition at line 528 of file laeRobot.cxx.
References LAE_TRY_CONN, m_kin, and laelaps::LaeKinematics::setGoalTwist().
|
virtual |
Read the value of an analog pin on the watchdog subprocessor.
pin | Analog pin number. | |
[out] | val | Analog 10-bit value [0-1023]. |
Definition at line 629 of file laeRobot.cxx.
References laelaps::LaeWd::cmdReadAPin(), and m_watchdog.
|
virtual |
Read the value of a digital pin on the watchdog subprocessor.
pin | Digital pin number. | |
[out] | val | Digital pin low (0) or high (1) value. |
Definition at line 619 of file laeRobot.cxx.
References laelaps::LaeWd::cmdReadDPin(), and m_watchdog.
int LaeRobot::release | ( | ) |
Release robot and accessories.
Motors will stop being driven. The robot will coast to a stop (on a flat surface) and is capabable of being externally pushed.
Definition at line 501 of file laeRobot.cxx.
References laelaps::LAE_OK, LAE_TRY_CONN, LAE_TRY_NO_EXEC, m_kin, and laelaps::LaeKinematics::release().
int LaeRobot::reload | ( | ) |
Reload Laelaps's reloadable configuration and reset operational parameters.
The robot connection and calibration states are uneffected.
Definition at line 372 of file laeRobot.cxx.
References laelaps::LAE_OK, laelaps::LaeEtcTune, laelaps::LaeSysCfgPath, laelaps::LaeXmlTune::load(), m_threadImu, m_threadKin, m_threadRange, m_threadWatchDog, m_tunes, laelaps::LaeThreadImu::reload(), laelaps::LaeThreadKin::reload(), laelaps::LaeThreadRange::reload(), and laelaps::LaeThreadWd::reload().
int LaeRobot::resetEStop | ( | ) |
Reset (clears) emergency stop condition.
Definition at line 451 of file laeRobot.cxx.
References laelaps::LaeKinematics::isEnabled(), laelaps::LAE_ECODE_MOT_CTLR, laelaps::LAE_OK, LAE_TRY_CONN, LAE_TRY_NO_EXEC, m_bAlarmState, m_bIsEStopped, m_kin, laelaps::LaeKinematics::resetEStop(), and syncDb().
int LaeRobot::runAsyncJob | ( | ) |
Run asynchronous job.
The new job object must be already created.
Definition at line 1113 of file laeRobot.cxx.
References laelaps::LaeThreadAsync::createThread(), laelaps::LAE_OK, m_pAsyncJob, m_threadAsync, and laelaps::LaeThreadAsync::runThread().
int LaeRobot::setAuxPower | ( | const std::string & | strName, |
LaeTriState | eState | ||
) |
Set top deck auxilliary power out enable state.
strName | Aux. power port name. One of: aux_batt_en aux_5v_en |
eState | Aux. power state. One of: DISABLED(0) ENABLED(1) |
Definition at line 570 of file laeRobot.cxx.
References laelaps::LaeWd::cmdEnableAuxPort5V(), laelaps::LaeWd::cmdEnableAuxPortBatt(), laelaps::LAE_ECODE_BAD_VAL, laelaps::LAE_OK, LAE_TRY_CONN, laelaps::LaeTriStateEnabled, and m_watchdog.
int LaeRobot::setDutyCycles | ( | const LaeMapDutyCycle & | duty | ) |
Set powertrain motor duty cycles.
The robot is controlled by setting the goal duties of a [sub]set of powertrain motors.
duty | Map of powertrain duty cycles. Keys are left_front, right_front, left_rear, and right_rear. Values are normalized duty cycles [-1.0, 1.0]. |
Definition at line 536 of file laeRobot.cxx.
References LAE_TRY_CONN, m_kin, and laelaps::LaeKinematics::setGoalDutyCycles().
double LaeRobot::setGovernor | ( | double | fGovernor | ) |
Set speed limit governor value.
Governor is defined as:
speed = cap(set_speed, min_speed * governor, max_speed * governor)
fGovernor | Governor value between [0.0, 1.0]. |
Definition at line 547 of file laeRobot.cxx.
References laelaps::fcap(), and m_fGovernor.
Referenced by incrementGovernor(), and LaeRobot().
void LaeRobot::setRobotMode | ( | LaeRobotMode | eRobotMode | ) |
Set robot's operational mode.
eRobotMode | Robot operation mode. See LaeRobotMode. |
Definition at line 564 of file laeRobot.cxx.
References laelaps::LaeDbRobotStatus::m_eRobotMode, m_eRobotMode, laelaps::LaeDb::m_robotstatus, and laelaps::RtDb.
|
protected |
Create and start all real-time persistent core threads.
Definition at line 1035 of file laeRobot.cxx.
References laelaps::LaeTunes::getImuHz(), laelaps::LaeTunes::getKinematicsHz(), laelaps::LaeTunes::getRangeHz(), laelaps::LaeTunes::getWatchDogTimeout(), laelaps::LAE_OK, m_threadImu, m_threadKin, m_threadRange, m_threadWatchDog, m_tunes, laelaps::LaeThreadWd::optimizeHz(), startThread(), laelaps::LaeThreadImu::ThreadImuPrioDft, laelaps::LaeThreadKin::ThreadKinPrioDft, laelaps::LaeThreadRange::ThreadRangePrioDft, and laelaps::LaeThreadWd::ThreadWdPrioDft.
Referenced by connect().
|
protected |
Create and start a thread at the given priority and hertz.
pThread | Pointer the thread object. |
nPriority | Thread priority. |
fHz | Thread execution hertz. |
Definition at line 1088 of file laeRobot.cxx.
References laelaps::LaeThread::createThread(), laelaps::LaeThread::getThreadName(), laelaps::LAE_OK, and laelaps::LaeThread::runThread().
Referenced by startCoreThreads().
int LaeRobot::stop | ( | ) |
Stop robot with full dynamic braking.
Definition at line 481 of file laeRobot.cxx.
References freeze().
Referenced by laelaps_tune_motors.window::createLeftButtons().
|
virtual |
Write a value to a digital pin on the watchdog subprocessor.
pin | Digital pin number. |
val | Digital pin low (0) or high (1) value. |
Definition at line 624 of file laeRobot.cxx.
References laelaps::LaeWd::cmdWriteDPin(), and m_watchdog.