Basic RT components and utilities  ..
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
python.hrpsys_config.HrpsysConfigurator Class Reference

Public Member Functions

def connectComps
 
def activateComps
 
def createComp
 
def createComps
 
def findComp
 
def findComps
 
def getRTCList
 
def getRTCListUnstable
 
def getJointAngleControllerList
 
def getRTCInstanceList
 
def getBodyInfo
 
def getSensors
 
def connectLoggerPort
 
def setupLogger
 
def waitForRTCManager
 
def waitForRobotHardware
 
def checkSimulationMode
 
def waitForRTCManagerAndRoboHardware
 
def findModelLoader
 
def waitForModelLoader
 
def setSelfGroups
 
def goActual
 
def setJointAngle
 
def setJointAngles
 
def setJointAnglesOfGroup
 
def loadPattern
 
def waitInterpolation
 
def waitInterpolationOfGroup
 
def getJointAngles
 
def getCurrentPose
 
def getCurrentPosition
 
def getCurrentRotation
 
def getCurrentRPY
 
def getReferencePose
 
def getReferencePosition
 
def getReferenceRotation
 
def getReferenceRPY
 
def setTargetPose
 
def setTargetPoseRelative
 
def clear
 
def clearOfGroup
 
def saveLog
 
def clearLog
 
def lengthDigitalInput
 
def lengthDigitalOutput
 
def writeDigitalOutput
 
def writeDigitalOutputWithMask
 
def readDigitalInput
 
def getActualState
 
def isCalibDone
 
def isServoOn
 
def flat2Groups
 
def servoOn
 
def servoOff
 
def checkEncoders
 
def init
 
def __init__
 

Public Attributes

 configurator_name
 

Static Public Attributes

 rh = None
 
 rh_svc = None
 
 ep_svc = None
 
 seq = None
 
 seq_svc = None
 
 sh = None
 
 sh_svc = None
 
 fk = None
 
 fk_svc = None
 
 tf = None
 
 kf = None
 
 vs = None
 
 rmfo = None
 
 ic = None
 
 abc = None
 
 st = None
 
 co = None
 
 co_svc = None
 
 gc = None
 
 gc_svc = None
 
 el = None
 
 el_svc = None
 
 te = None
 
 te_svc = None
 
 tl = None
 
 tl_svc = None
 
 tc = None
 
 tc_svc = None
 
 log = None
 
 log_svc = None
 
 ms = None
 
 hgc = None
 
 simulation_mode = None
 
 sensors = None
 
list Groups = []
 

Constructor & Destructor Documentation

def python.hrpsys_config.HrpsysConfigurator.__init__ (   self,
  cname = "[hrpsys.py] " 
)

Member Function Documentation

def python.hrpsys_config.HrpsysConfigurator.activateComps (   self)
def python.hrpsys_config.HrpsysConfigurator.checkEncoders (   self,
  jname = 'all',
  option = '' 
)
Run the encoder checking sequence for specified joints,
run goActual and turn on servos.

@type jname: str
@param jname: The value 'all' works iteratively for all servos.
@type option: str
@param option: Possible values are follows (w/o double quote):\
        "-overwrite": Overwrite calibration value.

References python.hrpsys_config.HrpsysConfigurator.configurator_name, python.hrpsys_config.HrpsysConfigurator.goActual(), python.hrpsys_config.HrpsysConfigurator.isCalibDone(), and python.hrpsys_config.HrpsysConfigurator.isServoOn().

def python.hrpsys_config.HrpsysConfigurator.checkSimulationMode (   self)
def python.hrpsys_config.HrpsysConfigurator.clear (   self)
def python.hrpsys_config.HrpsysConfigurator.clearLog (   self)
def python.hrpsys_config.HrpsysConfigurator.clearOfGroup (   self,
  gname,
  tm = 0.0 
)
def python.hrpsys_config.HrpsysConfigurator.connectComps (   self)
def python.hrpsys_config.HrpsysConfigurator.connectLoggerPort (   self,
  artc,
  sen_name,
  log_name = None 
)
def python.hrpsys_config.HrpsysConfigurator.createComp (   self,
  compName,
  instanceName 
)
def python.hrpsys_config.HrpsysConfigurator.createComps (   self)
def python.hrpsys_config.HrpsysConfigurator.findComp (   self,
  compName,
  instanceName,
  max_timeout_count = 10 
)
def python.hrpsys_config.HrpsysConfigurator.findComps (   self)
def python.hrpsys_config.HrpsysConfigurator.findModelLoader (   self)
def python.hrpsys_config.HrpsysConfigurator.flat2Groups (   self,
  flatList 
)
@type flatList: []
@param flatList: single dimension list with its length of 15
@rtype: [[]]
@return: 2-dimensional list of Groups.

References python.hrpsys_config.HrpsysConfigurator.Groups.

def python.hrpsys_config.HrpsysConfigurator.getActualState (   self)
@return: This returns actual states of ther robot, which is defined in
RobotHardware.idl
(https://hrpsys-base.googlecode.com/svn/trunk/idl/RobotHardwareService.idl)
    /**
     * @brief status of the robot
     */
    struct RobotState
    {
      DblSequence               angle;  ///< current joint angles[rad]
      DblSequence               command;///< reference joint angles[rad]
      DblSequence               torque; ///< joint torques[Nm]
      /**
       * @brief servo statuses(32bit+extra states)
       *
       * 0: calib status ( 1 => done )\n
       * 1: servo status ( 1 => on )\n
       * 2: power status ( 1 => supplied )\n
       * 3-18: servo alarms (see @ref iob.h)\n
       * 19-23: unused
       * 24-31: driver temperature (deg)
       */
      LongSequenceSequence              servoState;
      sequence<DblSequence6>    force;    ///< forces[N] and torques[Nm]
      sequence<DblSequence3>    rateGyro; ///< angular velocities[rad/s]
      sequence<DblSequence3>    accel;    ///< accelerations[m/(s^2)]
      double                    voltage;  ///< voltage of power supply[V]
      double                    current;  ///< current[A]
    };

Referenced by python.hrpsys_config.HrpsysConfigurator.isServoOn().

def python.hrpsys_config.HrpsysConfigurator.getBodyInfo (   self,
  url 
)
def python.hrpsys_config.HrpsysConfigurator.getCurrentPose (   self,
  lname = None 
)
@type jointname: str
@rtype: List of float
@return: Rotational matrix and the position of the given joint in
 1-dimensional list, that is:

 [a11, a12, a13, x,
  a21, a22, a23, y,
  a31, a32, a33, z,
   0,   0,   0,  1]

References python.hrpsys_config.HrpsysConfigurator.getCurrentPose(), and python.hrpsys_config.HrpsysConfigurator.Groups.

Referenced by python.hrpsys_config.HrpsysConfigurator.getCurrentPose(), python.hrpsys_config.HrpsysConfigurator.getCurrentPosition(), and python.hrpsys_config.HrpsysConfigurator.getCurrentRotation().

def python.hrpsys_config.HrpsysConfigurator.getCurrentPosition (   self,
  lname = None 
)
def python.hrpsys_config.HrpsysConfigurator.getCurrentRotation (   self,
  lname 
)
@type jointname: str
@rtype: List of float
@return: Rotational matrix of the given joint in 2-dimensional list,
 that is:
 [[a11, a12, a13],
  [a21, a22, a23],
  [a31, a32, a33]]

References python.hrpsys_config.HrpsysConfigurator.getCurrentPose(), python.hrpsys_config.HrpsysConfigurator.getCurrentRotation(), and python.hrpsys_config.HrpsysConfigurator.Groups.

Referenced by python.hrpsys_config.HrpsysConfigurator.getCurrentRotation(), and python.hrpsys_config.HrpsysConfigurator.getCurrentRPY().

def python.hrpsys_config.HrpsysConfigurator.getCurrentRPY (   self,
  lname 
)
def python.hrpsys_config.HrpsysConfigurator.getJointAngleControllerList (   self)
def python.hrpsys_config.HrpsysConfigurator.getJointAngles (   self)
def python.hrpsys_config.HrpsysConfigurator.getReferencePose (   self,
  lname 
)
This returns reference(commanded) value,
and getCurrentPose returns current(actual) value

@rtype: List of float
@return: Rotational matrix and the position of the given joint in
 1-dimensional list, that is:

 [a11, a12, a13, x,
  a21, a22, a23, y,
  a31, a32, a33, z,
   0,   0,   0,  1]

References python.hrpsys_config.HrpsysConfigurator.getReferencePose(), and python.hrpsys_config.HrpsysConfigurator.Groups.

Referenced by python.hrpsys_config.HrpsysConfigurator.getReferencePose(), python.hrpsys_config.HrpsysConfigurator.getReferencePosition(), and python.hrpsys_config.HrpsysConfigurator.getReferenceRotation().

def python.hrpsys_config.HrpsysConfigurator.getReferencePosition (   self,
  lname 
)
@rtype: List of float
@return: List of angles (degree) of all joints, in the order defined
 in the member variable 'Groups' (eg. chest, head1, head2, ..).

References python.hrpsys_config.HrpsysConfigurator.getReferencePose(), python.hrpsys_config.HrpsysConfigurator.getReferencePosition(), and python.hrpsys_config.HrpsysConfigurator.Groups.

Referenced by python.hrpsys_config.HrpsysConfigurator.getReferencePosition().

def python.hrpsys_config.HrpsysConfigurator.getReferenceRotation (   self,
  lname 
)
This seturns reference(commanded) value,
and getCurrentRotation returns current(actual) value

@type jointname: str
@rtype: List of float
@return: Rotational matrix of the given joint in 2-dimensional list,
 that is:
 [[a11, a12, a13],
  [a21, a22, a23],
  [a31, a32, a33]]

References python.hrpsys_config.HrpsysConfigurator.getReferencePose(), and python.hrpsys_config.HrpsysConfigurator.Groups.

Referenced by python.hrpsys_config.HrpsysConfigurator.getReferenceRPY().

def python.hrpsys_config.HrpsysConfigurator.getReferenceRPY (   self,
  lname 
)
This seturns reference(commanded) value,
and getCurrentRPY returns current(actual) value

@type jointname: str
@rtype: List of float
@return: List of orientation in rpy form about the specified joint.

References python.hrpsys_config.euler_from_matrix(), python.hrpsys_config.HrpsysConfigurator.getReferenceRotation(), python.hrpsys_config.HrpsysConfigurator.getReferenceRPY(), and python.hrpsys_config.HrpsysConfigurator.Groups.

Referenced by python.hrpsys_config.HrpsysConfigurator.getReferenceRPY().

def python.hrpsys_config.HrpsysConfigurator.getRTCInstanceList (   self)
def python.hrpsys_config.HrpsysConfigurator.getRTCList (   self)
@rtype [[str]]
@rerutrn List of available components. Each element consists of a list
 of abbreviated and full names of the component.

Referenced by python.hrpsys_config.HrpsysConfigurator.createComps(), python.hrpsys_config.HrpsysConfigurator.findComps(), and python.hrpsys_config.HrpsysConfigurator.getRTCInstanceList().

def python.hrpsys_config.HrpsysConfigurator.getRTCListUnstable (   self)
@rtype [[str]]
@rerutrn List of available unstable components. Each element consists
 of a list of abbreviated and full names of the component.
def python.hrpsys_config.HrpsysConfigurator.getSensors (   self,
  url 
)
def python.hrpsys_config.HrpsysConfigurator.goActual (   self)
Reset reference joint agnles with actual joint angle values

Referenced by python.hrpsys_config.HrpsysConfigurator.checkEncoders(), and python.hrpsys_config.HrpsysConfigurator.servoOn().

def python.hrpsys_config.HrpsysConfigurator.init (   self,
  robotname = "Robot",
  url = "" 
)
def python.hrpsys_config.HrpsysConfigurator.isCalibDone (   self)
def python.hrpsys_config.HrpsysConfigurator.isServoOn (   self,
  jname = 'any' 
)
def python.hrpsys_config.HrpsysConfigurator.lengthDigitalInput (   self)
def python.hrpsys_config.HrpsysConfigurator.lengthDigitalOutput (   self)
def python.hrpsys_config.HrpsysConfigurator.loadPattern (   self,
  fname,
  tm 
)
def python.hrpsys_config.HrpsysConfigurator.readDigitalInput (   self)
@return: TODO: elaborate
def python.hrpsys_config.HrpsysConfigurator.saveLog (   self,
  fname = 'sample' 
)
def python.hrpsys_config.HrpsysConfigurator.servoOff (   self,
  jname = 'all',
  wait = True 
)
@type jname: str
@param jname: The value 'all' works iteratively for all servos.
@type wait: bool
@rtype: int
@return: 1 = all arm servo off. 2 = all servo on arms and hands off.
-1 = Something wrong happened.

References python.hrpsys_config.HrpsysConfigurator.configurator_name, python.hrpsys_config.HrpsysConfigurator.isServoOn(), and python.hrpsys_config.HrpsysConfigurator.simulation_mode.

def python.hrpsys_config.HrpsysConfigurator.servoOn (   self,
  jname = 'all',
  destroy = 1,
  tm = 3 
)
Turn on/off servos.
Joints need to be calibrated (otherwise error returns).

@type jname: str
@param jname: The value 'all' works iteratively for all servos.
@param destroy: Not used.
@type tm: float
@param tm: Second to complete.
@rtype: int
@return: 1 or -1 indicating success or failure, respectively.

References python.hrpsys_config.HrpsysConfigurator.configurator_name, python.hrpsys_config.HrpsysConfigurator.goActual(), python.hrpsys_config.HrpsysConfigurator.isCalibDone(), and python.hrpsys_config.HrpsysConfigurator.isServoOn().

def python.hrpsys_config.HrpsysConfigurator.setJointAngle (   self,
  jname,
  angle,
  tm 
)
Set angle to the given joint.

NOTE-1: It's known that this method does not do anything after
some group operation is done.
TODO: at least need elaborated to warn users.

NOTE-2: that while this method does not check angle value range,
any joints could emit position limit over error, which has not yet
been thrown by hrpsys so that there's no way to catch on this client
side. Worthwhile opening an enhancement ticket for that at
hironx' designated issue tracker.

@type jname: str
@type angle: float
@param angle: In degree.
@type tm: float
@param tm: Time to complete.
def python.hrpsys_config.HrpsysConfigurator.setJointAngles (   self,
  angles,
  tm 
)
NOTE-1: that while this method does not check angle value range,
any joints could emit position limit over error, which has not yet
been thrown by hrpsys so that there's no way to catch on this client
side. Worthwhile opening an enhancement ticket for that at
hironx' designated issue tracker.

@type angles: float
@param angles: In degree.
@type tm: float
@param tm: Time to complete.
def python.hrpsys_config.HrpsysConfigurator.setJointAnglesOfGroup (   self,
  gname,
  pose,
  tm,
  wait = True 
)
Note that while this method does not check angle value range,
any joints could emit position limit over error, which has not yet
been handled in hrpsys so that there's no way to catch on this client
class level. Please consider opening an enhancement ticket for that
at hironx' designated issue tracker.

@type gname: str
@param gname: Name of joint group.
@type pose: [float]
@param pose: list of positions and orientations
@type tm: float
@param tm: Time to complete.
@type wait: bool
@param wait: If true, SequencePlayer.waitInterpolationOfGroup gets run.
  (TODO: Elaborate what this means...Even after having taken
  a look at its source code I can't tell exactly what it means)

References python.hrpsys_config.HrpsysConfigurator.waitInterpolationOfGroup().

def python.hrpsys_config.HrpsysConfigurator.setSelfGroups (   self)
Set to the hrpsys.SequencePlayer the groups of links and joints that
are statically defined as member variables (Groups) within this class.

References python.hrpsys_config.HrpsysConfigurator.Groups.

Referenced by python.hrpsys_config.HrpsysConfigurator.init().

def python.hrpsys_config.HrpsysConfigurator.setTargetPose (   self,
  gname,
  pos,
  rpy,
  tm,
  frame_name = None 
)
Set absolute pose to a joint.
All d* arguments are in meter.

@param gname: Name of the joint group.
@type pos: float
@type rpy: TODO: ??
@rtype: bool

References python.hrpsys_config.HrpsysConfigurator.setTargetPoseRelative().

Referenced by python.hrpsys_config.HrpsysConfigurator.setTargetPoseRelative().

def python.hrpsys_config.HrpsysConfigurator.setTargetPoseRelative (   self,
  gname,
  eename,
  dx = 0,
  dy = 0,
  dz = 0,
  dr = 0,
  dp = 0,
  dw = 0,
  tm = 10,
  wait = True 
)
Set angles to a joint group relative to its current pose.
All d* arguments are in meter.

@param gname: Name of the joint group.
@param eename: Name of the link.
@rtype: bool

References python.hrpsys_config.euler_from_matrix(), python.hrpsys_config.HrpsysConfigurator.setTargetPose(), and python.hrpsys_config.HrpsysConfigurator.waitInterpolationOfGroup().

Referenced by python.hrpsys_config.HrpsysConfigurator.setTargetPose().

def python.hrpsys_config.HrpsysConfigurator.setupLogger (   self)
def python.hrpsys_config.HrpsysConfigurator.waitForModelLoader (   self)
def python.hrpsys_config.HrpsysConfigurator.waitForRobotHardware (   self,
  robotname = "Robot" 
)
def python.hrpsys_config.HrpsysConfigurator.waitForRTCManager (   self,
  managerhost = nshost 
)
def python.hrpsys_config.HrpsysConfigurator.waitForRTCManagerAndRoboHardware (   self,
  robotname = "Robot",
  managerhost = nshost 
)
def python.hrpsys_config.HrpsysConfigurator.waitInterpolation (   self)
def python.hrpsys_config.HrpsysConfigurator.waitInterpolationOfGroup (   self,
  gname 
)
Lets SequencePlayer wait until the movement currently happening to
finish.
@see: http://wiki.ros.org/joint_trajectory_action. This method
      corresponds to JointTrajectoryGoal in ROS.

@type groupname: str

Referenced by python.hrpsys_config.HrpsysConfigurator.setJointAnglesOfGroup(), and python.hrpsys_config.HrpsysConfigurator.setTargetPoseRelative().

def python.hrpsys_config.HrpsysConfigurator.writeDigitalOutput (   self,
  dout 
)
@type dout: [int]
@param dout: List of bits. Length might defer depending on
     robot's implementation.
@return: What RobotHardware.writeDigitalOutput returns (TODO: document)

References python.hrpsys_config.HrpsysConfigurator.lengthDigitalOutput().

def python.hrpsys_config.HrpsysConfigurator.writeDigitalOutputWithMask (   self,
  dout,
  mask 
)
@type dout: [int]
@param dout: List of bits. Length might defer depending on robot's
     implementation.
@type mask: [int]
@param mask: List of masking bits. Length depends on that of dout.
@return: What RobotHardware.writeDigitalOutput returns (TODO: document)

References python.hrpsys_config.HrpsysConfigurator.lengthDigitalOutput().

Member Data Documentation

python.hrpsys_config.HrpsysConfigurator.abc = None
static
python.hrpsys_config.HrpsysConfigurator.co = None
static
python.hrpsys_config.HrpsysConfigurator.co_svc = None
static
python.hrpsys_config.HrpsysConfigurator.configurator_name
python.hrpsys_config.HrpsysConfigurator.el = None
static
python.hrpsys_config.HrpsysConfigurator.el_svc = None
static
python.hrpsys_config.HrpsysConfigurator.ep_svc = None
static
python.hrpsys_config.HrpsysConfigurator.fk = None
static
python.hrpsys_config.HrpsysConfigurator.fk_svc = None
static
python.hrpsys_config.HrpsysConfigurator.gc = None
static
python.hrpsys_config.HrpsysConfigurator.gc_svc = None
static
list python.hrpsys_config.HrpsysConfigurator.Groups = []
static
python.hrpsys_config.HrpsysConfigurator.hgc = None
static
python.hrpsys_config.HrpsysConfigurator.ic = None
static
python.hrpsys_config.HrpsysConfigurator.kf = None
static
python.hrpsys_config.HrpsysConfigurator.log = None
static
python.hrpsys_config.HrpsysConfigurator.log_svc = None
static
python.hrpsys_config.HrpsysConfigurator.ms = None
static
python.hrpsys_config.HrpsysConfigurator.rh = None
static
python.hrpsys_config.HrpsysConfigurator.rh_svc = None
static
python.hrpsys_config.HrpsysConfigurator.rmfo = None
static
python.hrpsys_config.HrpsysConfigurator.sensors = None
static
python.hrpsys_config.HrpsysConfigurator.seq = None
static
python.hrpsys_config.HrpsysConfigurator.seq_svc = None
static
python.hrpsys_config.HrpsysConfigurator.sh = None
static
python.hrpsys_config.HrpsysConfigurator.sh_svc = None
static
python.hrpsys_config.HrpsysConfigurator.simulation_mode = None
static
python.hrpsys_config.HrpsysConfigurator.st = None
static
python.hrpsys_config.HrpsysConfigurator.tc = None
static
python.hrpsys_config.HrpsysConfigurator.tc_svc = None
static
python.hrpsys_config.HrpsysConfigurator.te = None
static
python.hrpsys_config.HrpsysConfigurator.te_svc = None
static
python.hrpsys_config.HrpsysConfigurator.tf = None
static
python.hrpsys_config.HrpsysConfigurator.tl = None
static
python.hrpsys_config.HrpsysConfigurator.tl_svc = None
static
python.hrpsys_config.HrpsysConfigurator.vs = None
static

The documentation for this class was generated from the following file: