86 #include "rnr/rnrconfig.h" 146 int open(
const std::string &strDevMotorCtlrs,
148 int (*fnEnable)(
void *,
bool) = NULL,
149 void *pEnableArg = NULL);
314 virtual bool isStopped(
const std::string &strName);
335 virtual void estop();
397 virtual int stop(
const std::vector<std::string> &vecNames);
409 virtual int stop(
const std::string &strName);
480 virtual int setGoalTwist(
double fVelLinear,
double fVelAngular);
507 #ifdef LAE_DEPRECATED 511 #endif // LAE_DEPRECATED 541 pthread_mutex_lock(&m_mutex);
552 pthread_mutex_unlock(&m_mutex);
799 ActionStateTerminated
809 m_kin(kin), m_eActionType(eActionType)
811 m_eActionState = ActionStateIdle;
880 m_eActionState = ActionStateTerminated;
891 return m_eActionState == ActionStateIdle;
901 return m_eActionState == ActionStatePlan;
911 return m_eActionState == ActionStateExecute;
924 return m_eActionState == ActionStateTerminated;
934 return m_eActionType;
944 return m_eActionState;
1008 virtual int execute();
1017 virtual int terminate();
1075 virtual int execute();
1084 virtual int terminate();
1133 int update(
double fVelLinear,
double fVelAngular);
1151 virtual int execute();
1160 virtual int terminate();
1177 #endif // _LAE_KIN_H int open(const std::string &strDevMotorCtlrs, const int nBaudRate, int(*fnEnable)(void *, bool)=NULL, void *pEnableArg=NULL)
Open communication with the <b><i>Laelaps</i></b> motor controllers.
Laelaps kinematics base action class.
std::map< std::string, double > LaeMapDutyCycle
Duty cycle trajectory type.
RoboClaw 2 motor controller class.
virtual int waitForAllStop(double fSeconds)
Wait for all motors to stop.
virtual bool areMotorsPowered()
Test if motors are powered.
virtual int plan()
Plan kinematic action.
virtual int stop()
Stop all motors at the current position.
void resyncComm()
Attempt to resynchronize the serial communication between the host and the motor controllers.
void * m_pEnableArg
argument to enable function
Laelaps tuning data class.
Trajectory classes interfaces.
Laelaps robotic mobile platform full description class.
LaePowertrain * getPowertrain(const std::string &strName)
Get pointer to powertrain by name (key).
virtual bool isEnabled()
Test if motors are enabled.
ActionType
Supported kinematic extended actions.
LaeKinAction * m_pAction
current extended kinematics action
virtual void enableMotorCtlrs()
Enable power to motor controllers.
virtual ActionType getActionType() const
Get the action type for this class.
Laelaps kinematics class.
virtual void exec()
Execute kinematics task(s).
Laelaps motor controller power enable class.
LaeKinematics & m_kin
bound kinematics driver
virtual bool isOpen()
Test if connection is open.
virtual int setGoalVelocities(const LaeMapVelocity &velocity)
Set new or updated motor velocity goals.
virtual int configMotorCtlrEncoderModes(const LaeTunes &tunes, int nCtlr, bool &bNvmSave)
Configure motor controller encoder modes.
virtual int configurePtp(const LaeTunes &tunes, int nCtlr, bool &bNvSave)
Configure powertrain pair.
move robot by twist values
virtual int react()
React to any necessary time-critical events.
virtual int resetMotorCtlrEncoders(int nCtlr)
Reset all motor controller encoders to zero.
RoboClaw motor controller chip select class.
virtual int setGoalTwist(double fVelLinear, double fVelAngular)
Set new or updated robot twist velocity goals.
RoboClaw motor controller class interface.
LaePlatform m_kinPlatform
robot platform kinematics
virtual int configMotorVelocityPid(const LaeTunes &tunes, LaePowertrain &powertrain, bool &bNvmSave)
Configure motor velocity PID parameters.
virtual bool hasTerminated() const
Test if action has been terminated.
ActionType m_eActionType
action type enum
virtual bool isExecutionRequired() const
Test if more action requires (more) execution.
motor::roboclaw::RoboClawComm m_commMotorCtlrs
serial communication bus
double m_fGoalVelLinear
goal platform linear velocity
Laelaps kinematics duty cycle action class.
virtual ~LaeKinematics()
Desctructor.
virtual int act()
Act on current action.
virtual bool isPlanningRequired()
Test if action requires (re)planning.
motor::roboclaw::RoboClaw * getMotorCtlr(const int nMotorCtlrId)
Get pointer to motor controller by name (key).
virtual int configure(const LaeDesc &desc)
Configure kinematics chains and data from product description.
virtual int freeze()
Freeze (stop) all motors at the current position.
int(* m_fnEnableMotorCtlrs)(void *, bool)
enable power function
virtual bool isStopped()
Test if all motors are stopped.
ActionState m_eActionState
action state.
LaeMapPowertrain m_kinPowertrains
robot powertrain kinematics
LaeKinematics()
Default initializer constructor.
virtual int configMotorCtlrBatteryCutoffs(const LaeTunes &tunes, int nCtlr, bool &bNvmSave)
Configure motor controller battery cutoff voltages.
Laelaps Odroid General Purpose I/O class interfaces.
virtual ~LaeKinActionDutyCycle()
Destructor.
The <b><i>Laelaps</i></b> namespace encapsulates all <b><i>Laelaps</i></b> related constructs...
Laelaps robotic base mobile platform description class interface.
ActionState
Action states.
LaeMapPowertrain & getPowertrainMap()
Get map of all powertrain kinodynamics.
virtual void resetEStop()
Reset emergency stop condition.
virtual int resetOdometers()
Reset all motors' odometers to the current respective encoder positions.
bool m_bIsEnabled
is [not] enabled
bool m_bIsStopped
all motors are [not] stopped
Laelaps common utilities.
virtual bool isIdle()
Test if action is idle.
Laelaps kinematics velocity action class.
Laelaps powertrain class interfaces.
std::map< std::string, LaePowertrain > LaeMapPowertrain
Map of powertrain kinodynamics.
bool m_bAreMotorsPowered
motors are [not] powered
virtual int execute()
Execution [sub]action.
virtual int getPowertrainState(const std::string &strName, LaePowertrainState &state)
Get the current powertrain state.
pthread_mutex_t m_mutex
mutex
virtual int senseDynamics()
Sense real-time kinodynamics.
motor::roboclaw::RoboClaw * m_pMotorCtlr[LaeNumMotorCtlrs]
RoboClaw motor controllers.
virtual int sense()
Sense real-time state.
virtual ~LaeKinActionTwist()
Destructor.
virtual ActionState getActionState() const
Get the action state.
virtual void disableMotorCtlrs()
Disable power to motor controllers.
move by motor duty cycles
double m_fGoalVelAngular
goal platform angular velocity
LaePlatform & getPlatform()
Get robot platform kinodynamics.
virtual int setGoalDutyCycles(const LaeMapDutyCycle &duty)
Set new or updated motor duty cycle goals.
Laelaps motors, encoder, and controllers hardware abstraction interfaces.
virtual int configMotorMaxAmpLimit(const LaeTunes &tunes, LaePowertrain &powertrain, bool &bNvmSave)
Configure motor maximum ampere limit.
void unlock()
Unlock the shared resource.
void lock()
Lock the shared resource.
virtual ~LaeKinActionVelocity()
Destructor.
static const int LaeNumMotorCtlrs
number of motor controllers
virtual int terminate()
Terminate action.
LaeMapVelocity m_mapGoalVel
map of goal velocities
virtual int close()
Close communication.
move by angular velocities
LaeMapDutyCycle m_mapGoalDutyCycle
map of goal duty cycles
Powertrain state data class.
LaeKinAction(LaeKinematics &kin, ActionType eActionType=ActionTypeIdle)
Default intialization constructor.
RoboClaw communication class.
virtual int release()
Release motors.
std::map< std::string, double > LaeMapVelocity
Velocity trajectory type.
virtual int configureMotorController(const LaeTunes &tunes, int nCtlr)
Configure motor controller.
virtual bool isOpen() const
Test if connection is open.
virtual int configMotorCtlrLogicCutoffs(const LaeTunes &tunes, int nCtlr, bool &bNvmSave)
Configure motor controller logic cutoff voltages.
virtual int reload(const LaeTunes &tunes)
Reload configuration tuning parameters.
virtual int saveConfigToNvm(int nCtlr)
Save configuration to motor controller's non-volatile memory.
Laelaps kinematics velocity action class.
virtual int plan()
Plan next execution.
update action specific data
static const int LaeNumMotorsPerCtlr
number of motors/controller
virtual int monitorHealth()
Monitor kinematics health.
virtual void estop()
Emergency stop the robot.
Top-level package include file.
virtual ~LaeKinAction()
Destructor.
static const int LAE_OK
not an error, success