Hekateros  3.4.3
RoadNarrows Robotics Robot Arm Project
hekRobot.cxx File Reference

HekRobot - Hekateros Robot Class implementation. More...

#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <math.h>
#include <string>
#include <vector>
#include <map>
#include "rnr/rnrconfig.h"
#include "rnr/units.h"
#include "rnr/log.h"
#include "rnr/i2c.h"
#include "Dynamixel/Dynamixel.h"
#include "Dynamixel/DynaComm.h"
#include "Dynamixel/DynaServo.h"
#include "Dynamixel/DynaChain.h"
#include "Dynamixel/DynaBgThread.h"
#include "Dynamixel/DynaError.h"
#include "Hekateros/hekateros.h"
#include "Hekateros/hekTune.h"
#include "Hekateros/hekUtils.h"
#include "Hekateros/hekOptical.h"
#include "Hekateros/hekMonitor.h"
#include "Hekateros/hekSpec.h"
#include "Hekateros/hekDesc.h"
#include "Hekateros/hekXmlTune.h"
#include "Hekateros/hekJoint.h"
#include "Hekateros/hekTraj.h"
#include "Hekateros/hekKin.h"
#include "Hekateros/hekState.h"
#include "Hekateros/hekRobot.h"

Go to the source code of this file.

Macros

#define HEK_TRY_NO_EXEC()
 Define if heketeros has RN system board. More...
 
#define HEK_TRY_GET_SERVO(nServoId, pServo)
 Convenience macro for trying to get a servo object from dynamixel chain. More...
 
#define HEK_TRY_CONN()
 Test for connection. More...
 
#define HEK_TRY_CALIB()
 Test for calibration. More...
 
#define HEK_TRY_NOT_ESTOP()
 Test for not estop. More...
 

Detailed Description

HekRobot - Hekateros Robot Class implementation.

LastChangedDate
2015-04-17 15:31:34 -0600 (Fri, 17 Apr 2015)
Rev
3942
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)
Daniel Packard (danie.nosp@m.l@ro.nosp@m.adnar.nosp@m.rows.nosp@m..com)

Definition in file hekRobot.cxx.

Macro Definition Documentation

#define HEK_TRY_CALIB ( )
Value:
do \
{ \
if( m_eOpState != HekOpStateCalibrated ) \
{ \
LOGERROR("Robot is not calibrated."); \
return -HEK_ECODE_NO_EXEC; \
} \
} while(0)

Test for calibration.

Only works in HekRobot methods.

Returns
On failure, forces return from calling function with the appropriate error code.

Definition at line 161 of file hekRobot.cxx.

Referenced by hekateros::HekRobot::closeGripper(), hekateros::HekRobot::gotoBalancedPos(), hekateros::HekRobot::gotoParkedPos(), hekateros::HekRobot::gotoZeroPtPos(), hekateros::HekRobot::moveArm(), and hekateros::HekRobot::openGripper().

#define HEK_TRY_CONN ( )
Value:
do \
{ \
if( !isConnected() ) \
{ \
LOGERROR("Robot is not connected."); \
return -HEK_ECODE_NO_EXEC; \
} \
} while(0)

Test for connection.

Only works in HekRobot methods.

Returns
On failure, forces return from calling function with the appropriate error code.

Definition at line 143 of file hekRobot.cxx.

Referenced by hekateros::HekRobot::calibrate(), hekateros::HekRobot::clearAlarms(), hekateros::HekRobot::closeGripper(), hekateros::HekRobot::estop(), hekateros::HekRobot::freeze(), hekateros::HekRobot::getJointState(), hekateros::HekRobot::gotoBalancedPos(), hekateros::HekRobot::gotoParkedPos(), hekateros::HekRobot::gotoZeroPtPos(), hekateros::HekRobot::moveArm(), hekateros::HekRobot::openGripper(), hekateros::HekRobot::release(), and hekateros::HekRobot::stop().

#define HEK_TRY_GET_SERVO (   nServoId,
  pServo 
)
Value:
do \
{ \
if( (pServo = m_pDynaChain->GetServo(nServoId)) == NULL ) \
{ \
LOGERROR("BUG: Servo %d: Cannot find in dynamixel chain.", nServoId); \
return -HEK_ECODE_INTERNAL; \
} \
} while(0)

Convenience macro for trying to get a servo object from dynamixel chain.

Failure is considered a software bug since the chain has already be verified.

Only works in HekRobot methods.

Parameters
[in]nServoIdServo id.
[out]pServoPointer to associated servo object.
Returns
On failure, forces return from calling function with the appropriate error code.

Definition at line 124 of file hekRobot.cxx.

Referenced by hekateros::HekRobot::configEEPROMForServo(), hekateros::HekRobot::configRAMForServo(), and hekateros::HekRobot::getJointState().

#define HEK_TRY_NO_EXEC ( )
Value:
do \
{ \
if( m_bNoExec ) \
{ \
return HEK_OK; \
} \
} while(0)

Define if heketeros has RN system board.

Test for no execute flag.

Only works in HekRobot methods.

Returns
On true, return with HEK_OK.

Definition at line 100 of file hekRobot.cxx.

Referenced by hekateros::HekRobot::calibrate(), hekateros::HekRobot::estop(), hekateros::HekRobot::freeze(), hekateros::HekRobot::release(), and hekateros::HekRobot::stop().

#define HEK_TRY_NOT_ESTOP ( )
Value:
do \
{ \
if( m_bIsEStopped ) \
{ \
LOGERROR("Robot is emergency stopped."); \
return -HEK_ECODE_NO_EXEC; \
} \
} while(0)

Test for not estop.

Only works in HekRobot methods.

Returns
On failure, forces return from calling function with the appropriate error code.

Definition at line 179 of file hekRobot.cxx.

Referenced by hekateros::HekRobot::closeGripper(), hekateros::HekRobot::gotoBalancedPos(), hekateros::HekRobot::gotoParkedPos(), hekateros::HekRobot::gotoZeroPtPos(), hekateros::HekRobot::moveArm(), hekateros::HekRobot::openGripper(), and hekateros::HekRobot::stop().