Fast Research Interface Library  Manual and Documentation
Public Member Functions
LWRCartImpedanceController Class Reference

Cartesian impedance controller interface for the KUKA Light-Weight Robot IV. More...

#include <LWRCartImpedanceController.h>

Inheritance diagram for LWRCartImpedanceController:
LWRBaseControllerInterface

List of all members.

Public Member Functions

 LWRCartImpedanceController (const char *InitFileName)
 Constructor.
 ~LWRCartImpedanceController (void)
 Destructor.
int StartRobot (const float &TimeOutValueInSeconds=120.0)
 Starts the robot.
void GetMeasuredCartPose (float *MeasuredCartPose)
 Reads the measured Cartesian pose frame from the latest data telegram of the KRC unit.
void SetCommandedCartPose (const float *CommandedCartPose)
 Copies the desired Cartesian pose frame into the data telegram to be send to the KRC unit.
void SetCommandedCartForcesAndTorques (const float *CartForcesAndTorques)
 Copies the desired Cartesian force/torque vector into the data telegram to be send to the KRC unit.
void SetCommandedCartStiffness (const float *CommandedCartStiffness)
 Copies the desired Cartesian stiffness vector into the data telegram to be send to the KRC unit.
void SetCommandedCartDamping (const float *CommandedCartDamping)
 Copies the desired Cartesian damping vector into the data telegram to be send to the KRC unit.
void GetEstimatedExternalCartForcesAndTorques (float *EstimatedExternalCartForcesAndTorques)
 Reads the estimated external force and torque values w.r.t. the tool frame from the latest data telegram of the KRC unit.

Detailed Description

Cartesian impedance controller interface for the KUKA Light-Weight Robot IV.

Definition at line 72 of file LWRCartImpedanceController.h.


Constructor & Destructor Documentation

LWRCartImpedanceController::LWRCartImpedanceController ( const char *  InitFileName) [inline]

Constructor.

The constructor creates the actual object of the class FastResearchInterface, which is used by this class.This constructor performs several procedures. It

In case,

the constructor lets the calling process terminate and exits with a value of EXIT_FAILURE.

Parameters:
InitFileNameA pointer to an array of char values containing the path and filename of the initialization file (e.g., "/home/lwrcontrol/etc/980039-FRI-Driver.init"). For details about this file, please refer to The Initialization File for the Fast Research Interface Library.
Note:
All threads of this class, that is,

use the Fifo scheduling policy (SCHED_FIFO).
Attention:
The call of the constructor does not fulfill any real-time requirements.

Definition at line 87 of file LWRCartImpedanceController.h.

Destructor.

The destructor deletes the actual object of the class FastResearchInterface, which is used by this class.This destructor performs a set of procedures to cleanly shutdown the robot:

Attention:
The call of the destructor does not fulfill any real-time requirements.

Definition at line 100 of file LWRCartImpedanceController.h.


Member Function Documentation

void LWRCartImpedanceController::GetEstimatedExternalCartForcesAndTorques ( float *  EstimatedExternalCartForcesAndTorques) [inline]

Reads the estimated external force and torque values w.r.t. the tool frame from the latest data telegram of the KRC unit.

Parameters:
EstimatedExternalCartForcesAndTorquesA pointer to an array of float values; the array has to have at least a size of six elements. The estimated external force and torque values are written into this array.
See also:
tFriMsrData

Definition at line 208 of file LWRCartImpedanceController.h.

void LWRCartImpedanceController::GetMeasuredCartPose ( float *  MeasuredCartPose) [inline]

Reads the measured Cartesian pose frame from the latest data telegram of the KRC unit.

Parameters:
MeasuredCartPoseA pointer to an array of float values; the array has to have at least a size of twelve elements. The measured Cartesian pose frame is written into this array.
See also:
tFriMsrData

Definition at line 133 of file LWRCartImpedanceController.h.

void LWRCartImpedanceController::SetCommandedCartDamping ( const float *  CommandedCartDamping) [inline]

Copies the desired Cartesian damping vector into the data telegram to be send to the KRC unit.

Parameters:
CommandedCartDampingA pointer to an array of float values; the array has to have at least a size of six elements. The desired Cartesian damping vector is copied from this array.
Note:
This value will only be relevant if the Cartesian impedance controller is active.
See also:
tFriCmdData

Definition at line 193 of file LWRCartImpedanceController.h.

void LWRCartImpedanceController::SetCommandedCartForcesAndTorques ( const float *  CartForcesAndTorques) [inline]

Copies the desired Cartesian force/torque vector into the data telegram to be send to the KRC unit.

Parameters:
CartForcesAndTorquesA pointer to an array of float values; the array has to have at least a size of six elements. The desired Cartesian force/torque vector is copied from this array.
Note:
This value will only be relevant if the Cartesian impedance controller is active.
See also:
tFriCmdData

Definition at line 163 of file LWRCartImpedanceController.h.

void LWRCartImpedanceController::SetCommandedCartPose ( const float *  CommandedCartPose) [inline]

Copies the desired Cartesian pose frame into the data telegram to be send to the KRC unit.

Parameters:
CommandedCartPoseA pointer to an array of float values; the array has to have at least a size of twelve elements. The desired Cartesian pose frame is copied from this array.
Note:
This value will only be relevant if the Cartesian impedance controller is active.
See also:
tFriCmdData

Definition at line 148 of file LWRCartImpedanceController.h.

void LWRCartImpedanceController::SetCommandedCartStiffness ( const float *  CommandedCartStiffness) [inline]

Copies the desired Cartesian stiffness vector into the data telegram to be send to the KRC unit.

Parameters:
CommandedCartStiffnessA pointer to an array of float values; the array has to have at least a size of six elements. The desired Cartesian stiffness vector is copied from this array.
Note:
This value will only be relevant if the Cartesian impedance controller is active.
See also:
tFriCmdData

Definition at line 178 of file LWRCartImpedanceController.h.

int LWRCartImpedanceController::StartRobot ( const float &  TimeOutValueInSeconds = 120.0) [inline, virtual]

Starts the robot.

This method performs a complete start-up procedure of the robot arm. The following steps are executed:

  1. Before the KRL program FRIControl (cf.KRL File: FRIControl.src) is started by the user, the constructor FastResearchInterface::FastResearchInterface::() should be called in order to prevent any loss of UDP packages.
  2. If the KRC unit is not already in Monitor Mode (i.e., no communication between the remote host and the KRC unit is performed), the method waits for the call of the KRL function friOpen() to receive UDP messages in order to let the KRC unit switch to Monitor Mode.
  3. Once, the KRC unit runs in Monitor Mode, the method sets the KRL variable $FRI_FRM_INT[16] to a value of 10, which lets the KRL program FRIControl call the function friStart() in order to switch from Monitor Mode to Command Mode.
  4. In the transition phase, the following command variables are sent from the remote host to the KRC unit (see also: FastResearchInterface::SetControlScheme()):

    • Joint position control
      • Desired joint position vector = Current joint position vector

    • Cartesian impedance control
    • Joint impedance control
    • Joint torque control:
      • Desired joint torque vector = Zero vector

  5. After the KRC unit switched to Command Mode, the method waits until the robot is ready for operation, that is, until the result value of FastResearchInterface::IsMachineOK() is true.


The complete start-up procedure must not take longer than TimeOutValueInSeconds seconds. If completed successfully, the robot arm is ready for operation. This method should be used pairwise with the method FastResearchInterface::StopRobot() in order to ensure a safe and error-free operation.

Parameters:
ControlModeEither value of the enumeration FastResearchInterface::LWRControlModes:
If this method is called by an object derived from the class LWRBaseControllerInterface, this parameter is automatically set by their respective method for starting the robot.

TimeOutValueInSecondsTimeout value in seconds for the user to turn on the robot arm by using the KUKA Control Panel. The default value of this optional parameter is 120 seconds.
Returns:
  • ENOTCONN if no connection between the remote host and the KRC unit could be established. Please check
    • whether the KRC unit is turned on and the Ethernet cable (e.g., a crossed cable) is plugged in on both nodes,
    • whether the KRL program FRIControl (cf.KRL File: FRIControl.src) has been started, or
    • whether the KRC node is configured correctly in particular w.r.t. the network settings (cf. Introduction).
  • EALREADY if the KRC unit is already in command mode, that is, the KRL function friStart() was already called by a previous call of FastResearchInterface::StartRobot(). If the robot is not ready for operation (i.e., the result of FastResearchInterface::IsMachineOK() is false), call FastResearchInterface::StopRobot() first. It might be required to check whether the KRC unit is running correctly, and whether the KRL program KRL program FRIControl (cf.KRL File: FRIControl.src) is being executed.
  • ETIME if the start-up procedure could not be completed within the specified time interval of TimeOutValueInSeconds
  • EOK if no error occurred.
See also:
FastResearchInterface::StopRobot()

Implements LWRBaseControllerInterface.

Definition at line 114 of file LWRCartImpedanceController.h.


The documentation for this class was generated from the following file:
This document was generated with Doxygen on Thu Apr 12 2012 11:18:55. User documentation of the Fast Research Interface Library for the KUKA Lightweight Robot IV by the Stanford Robotics Research Group. Copyright 2010–2012.