55 #include "rnr/rnrconfig.h" 57 #include "rnr/units.h" 63 #include "Dynamixel/Dynamixel.h" 64 #include "Dynamixel/DynaComm.h" 65 #include "Dynamixel/DynaServo.h" 66 #include "Dynamixel/DynaChain.h" 67 #include "Dynamixel/DynaBgThread.h" 293 int stop(
const std::vector<std::string> &vecNames);
419 void getVersion(
int &nVerMajor,
int &nVerMinor,
int &nRevision)
612 IMapRobotJoints::iterator iter;
633 MapRobotJoints::iterator iter;
637 return &(iter->second);
781 IMapRobotJoints &imap);
889 int moveWait(DynaServo *pServo,
int nOdGoalPos,
int nSpeed);
901 void stopWait(
const std::vector<std::string> &vecNames,
int nMaxTries=10);
982 pthread_mutex_lock(&m_mutex);
993 pthread_mutex_unlock(&m_mutex);
1006 return pthread_mutex_trylock(&m_mutex) == 0?
true:
false;
1013 #endif // _HEK_ROBOT_H void * m_pAsyncTaskArg
asynchronous argument
HekRobotJoint * getArmJoint(const std::string &strName)
Get robotic joint in arm+ee kinematic chain.
#define HEK_VER_REV(ver)
Get revision number from version.
HekRobotMode m_eRobotMode
robot operating mode
int createAsyncThread()
Create the asynchronous thread.
HekCalib - Hekateros calibration abstract base class interface.
int getAsyncRc()
Get the last asynchronous task return code.
MapRobotJoints m_jointsAux
robot auxiliary kinematic joints
void resetEStop()
Reset (clears) emergency stop condition.
Hekateros robotic manipulator calibration by stretching class.
void setRobotMode(HekRobotMode eRobotMode)
Set robot's operational mode.
DynaChain * getDynaChain()
Get the dynamixel chain object.
HekDesc * getHekDesc()
Get the <b><i>Hekateros</i></b> product description.
int configEEPROMForAllServos(MapRobotJoints &kin)
Configure the EEPROM for all <b><i>Hekateros</i></b> servos in kinematic chain.
int getJointState(HekJointStatePoint &jointStatePoint)
Get the joint states of a kinematic chain.
int isAlarmed()
Test if robot is alarmed.
void fauxcalibrate()
Faux calibrate <b><i>Hekateros</i></b>.
HekDesc - Hekateros full robotic manipulator descripition class interface.
Joint trajectory feedback class.
void markEStopCond(bool bEStopCond)
Mark emergency stop condition.
bool m_bAtBalancedPos
arm is [not] at balanced position
bool m_bAreServosPowered
arm servos are [not] driven
int estop()
Emergency stop.
int closeGripper()
Close gripper to its minimum closed position.
int configRAMForServo(int nServoId, HekRobotJoint &joint)
Configure one <b><i>Hekateros</i></b> servo RAM.
virtual ~HekRobot()
Destructor.
MapRobotJoints m_jointsArm
robot arm + end effector joints
int scanHw()
Scan <b><i>Hekateros</i></b> hardware and match against description.
void reload()
Reload <b><i>Hekateros</i></b>'s reloadable configuration and reset operational parameters.
HekRobotJoint * getArmJointAt(int index)
Get robotic joint in arm+ee kinematic chain at the given index.
Joint trajectory point class.
bool m_bNoExec
do [not] execute physical movements
Operational robotic joint description class.
DynaServo * getMasterServo(HekRobotJoint &joint)
Get robotic joint's master servo.
int m_rcAsyncTask
last async task return code
void adjustTuningFromSpecs()
Adjust tuning parameters for values in compiled product specifications.
int configRAMForAllServos(MapRobotJoints &kin)
Configure the RAM for all <b><i>Hekateros</i></b> servos in kinematic chain.
int scanDynaBus(int nMaxTries)
Scan <b><i>Hekateros</i></b> dynamixel bus hardware and match against description.
double m_fMaxJointRadsPerSec
maximum joint radians per second
HekCalibStretch - Hekateros calibration by stretching class interface.
calibrate hekateros arm task id
const int HekBaudRateDynabus
dynabus baudrate
#define HEK_VER_MAJOR(ver)
Get version major number from version.
int addRobotJoint(HekSpecJoint_T *pSpecJoint, HekSpecServo_T *pSpecServo, MapRobotJoints &kin, IMapRobotJoints &imap)
Add a joint to robot's kinematic chain.
Joint points and trajectory class interfaces.
HekRobotMode
<b><i>Hekateros</i></b> mode of operation.
bool isConnected()
Test if connected to <b><i>Hekateros</i></b> hardware.
const char *const HekDevDynabus
dynabus device name
HekKinematics * m_pKin
dynamics and kinematics
HekAsyncTaskState
Asynchronous task state.
int m_nMasterServoId
master servo id
int connect(const std::string &strDevDynabus=HekDevDynabus, int nBaudRateDynabus=HekBaudRateDynabus, const std::string &strDevArduino=HekDevArduino, int nBaudRateArduino=HekBaudRateArduino)
Connect to <b><i>Hekateros</i></b>.
map< std::string, int > IMapRobotJoints
Indirect map of robot joints.
bool m_bAtParkedPos
arm is [not] at parked position
int stop(const std::vector< std::string > &vecNames)
Stops specified joints at current position.
Hekateros tuning data class.
void setAllJointGoalsToNull()
Set all joint goals to a null trajectory.
int areServosPowered()
Test if robot servos are currently being driven (powered).
Hekateros Robot State classes interface.
AsyncTaskId
Asynchronous task id.
HekTunes m_tunes
tune parameters
void cancelAsyncTask()
Cancel any asynchronous task.
void lock()
Lock the robot mutex.
double pctOfMaxJointVelocity(HekRobotJoint &joint, double fVelPct)
Convert percent of maximum to joint velocity.
The Hekateros kinematics and dynamics class interface.
IMapRobotJoints m_imapJoints
joints indirect map
Hekateros Monitor Class interface.
int release()
Release arm and accessories.
int gotoParkedPos()
Move robotic arm to its pre-defined parked position.
int calibrateAsync(bool bForceRecalib=true)
Asynchronously calibrate <b><i>Hekateros</i></b>'s odometers and limit switch positions.
void getTrajectoryParams(HekNorm &eNorm, double &fEpsilon) const
Get trajectory tune parameters.
HekDescArm * getArmDesc()
Get the <b><i>Hekateros</i></b> base product description.
Hekateros joint classes interfaces.
void getVersion(int &nVerMajor, int &nVerMinor, int &nRevision)
Get the <b><i>Hekateros</i></b> robotic arm hardware version numbers.
int clearAlarms()
Attempt to clear all servo alarms in all kinematic chains.
int isCalibrated()
Test if robot is calibrated.
static void * asyncThread(void *pArg)
Asynchronous operation thread.
std::string getProdName()
Convenience function to get this <b><i>Hekateros</i></b> description's base product name...
HekOpState
Robot or joint operational states.
DynaComm * m_pDynaComm
dynamixel communication
bool m_bAlarmState
robot is [not] alarmed
bool isInMotion()
Test if any joint in any of the kinematic chains is moving.
MapRobotJoints m_jointsEquipDeck
robot equipement deck kin. joints
void unlock()
Unlock the robot mutex.
HekRobot(bool bNoExec=false)
Default initialization constructor.
int freeze()
Freeze arm and accessories at current position.
int isAtParkedPos()
Test if robot is as pre-defined parked position.
int getRobotState(HekRobotState &robotState)
Get the robot current state.
int openGripper()
Open gripper to its maximum opened position.
std::map< int, HekRobotJoint > MapRobotJoints
Map of robot joints.
void getTrajectoryParams(HekNorm &eNorm, double &fEpsilon)
Get trajectory parameters.
int getTrajectoryState(HekJointTrajectoryFeedback &trajectoryFeedback)
Get trajectory feedback.
Hekateros robotic manipulator full description class.
DynaChain * m_pDynaChain
dynamixel chain
std::map< std::string, double > MapDouble
Map of doubles.
DynaBgThread * m_pDynaBgThread
dynamixel background thread
void setJointGoalToNull(const std::string &strName)
Set joint goal to null a trajectory.
Hekateros robotic manipulator calibration abstract base class.
pthread_t m_threadAsync
async pthread identifier
int configServos()
Configure <b><i>Hekateros</i></b> servos.
std::string getProdHwVer()
Get this base description's hardware version.
int isDescribed()
Test if robot is fully described via configuration XML.
Top-level package include file.
HekOpState determineRobotOpState()
Determine robot operational state from collective joint operational states.
#define HEK_VER_MINOR(ver)
Get version minor number from version.
void moveWristRot()
Move wrist rotation for any necessary final position adjustments.
int isAtBalancedPos()
Test if robot is as pre-defined balanced position.
uint_t getVersionNum()
Get the <b><i>Hekateros</i></b> robotic arm hardware version compact number.
int calibrate(bool bForceRecalib=true)
Calibrate <b><i>Hekateros</i></b>'s odometers and limit switch positions.
std::string getFullProdBrief()
Get the <b><i>Hekateros</i></b> full brief descirption.
HekMonitor m_monitor
power, health, and safety monitor
HekJointTrajectoryPoint m_lastTrajArm
last trajectory point for arm
const int HekBaudRateArduino
arduino baudrate
void stopWait(const std::vector< std::string > &vecNames, int nMaxTries=10)
Wait for the specified joints to stop moving.
static void cbWristRot(void *pUserArg)
Callback to control wrist rotation.
HekNorm
Length/Distance Norm.
uint_t strToVersion(const std::string &str)
Convert version dotted string to integer equivalent.
int gotoZeroPtPos()
Move robotic arm to its pre-defined calibrated zero point position.
int gotoBalancedPos()
Move robotic arm to its pre-defined balanced position.
AsyncTaskId m_eAsyncTaskId
asynchronous task id
<b><i>Hekateros</i></b> power, joint limits, and alarm monitoring class.
int moveWait(DynaServo *pServo, int nOdGoalPos, int nSpeed)
Move servo to position.
int isEStopped()
Test if robot is current emergency stopped.
Hekateros robotic manipulator plus accesories class.
std::string getProdName()
Get this base description's name.
Hekateros common utilities.
pthread_mutex_t m_mutex
synchronization mutex
const char *const HekDevArduino
arduino device name
HekDesc m_descHek
<b><i>Hekateros</i></b> description
HekAsyncTaskState m_eAsyncTaskState
asynchronous task state
int convertSpecs()
Convert specification(s) to operational parameters.
int disconnect()
Disconnect from <b><i>Hekateros</i></b>.
Robotic joint specification.
Robotic servo specification.
bool isDescribed()
Test if required descriptions are described.
void setJointGoalsToNull(const std::vector< std::string > &vecNames)
Set a set of joint goals to a null trajectory.
HekRobotJoint * getArmJoint(int nServoId)
Get robotic joint in arm+ee kinematic chain.
int moveArm(HekJointTrajectoryPoint &trajectoryPoint)
Move arm through trajectory point.
void resetCalibStateForAllJoints(bool bForceRecalib)
Mark all relevant joints for recalibration.
int getAlarmCond()
Get monitoring alarm condition.
bool trylock()
Try to lock the robot mutex.
int getProdId()
Get this base description's base product id.
std::string getVersion()
Get the <b><i>Hekateros</i></b> robotic arm hardware version string.
The <b><i>Hekateros</i></b> namespace encapsulates all <b><i>Hekateros</i></b> related constructs...
std::string getFullProdBrief()
Get the <b><i>Hekateros</i></b> full brief descirption.
HekOpState m_eOpState
arm operational state
int configEEPROMForServo(int nServoId, HekRobotJoint &joint)
Configure one <b><i>Hekateros</i></b> servo EEPROM.
HekAsyncTaskState getAsyncState()
Get the current asynchronous task state.
bool m_bIsEStopped
arm is [not] emergency stopped
int getProdId()
Convenience function to get this <b><i>Hekateros</i></b> description's base product id...