Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
grl::robot::arm::KukaJAVAdriver Class Reference

#include <KukaJAVAdriver.hpp>

+ Inheritance diagram for grl::robot::arm::KukaJAVAdriver:
+ Collaboration diagram for grl::robot::arm::KukaJAVAdriver:

Classes

struct  JointStateTag
 

Public Types

typedef std::vector< double > JointScalar
 
enum  JointStateIndex {
  JointPosition, JointForce, JointTargetPosition, JointLowerPositionLimit,
  JointUpperPositionLimit, JointMatrix, JointStateTagIndex
}
 
enum  ParamIndex {
  RobotName, RobotModel, LocalUDPAddress, LocalUDPPort,
  RemoteUDPAddress, LocalHostKukaKoniUDPAddress, LocalHostKukaKoniUDPPort, RemoteHostKukaKoniUDPAddress,
  RemoteHostKukaKoniUDPPort, KukaCommandMode, KukaMonitorMode
}
 
typedef std::tuple< std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string > Params
 
typedef std::tuple< JointScalar, JointScalar, JointScalar, JointScalar, JointScalar, TransformationMatrices, JointStateTagState
 
typedef std::vector< TransformationMatrixTransformationMatrices
 
typedef std::array< double, 12 > TransformationMatrix
 

Public Member Functions

void construct ()
 
void construct (Params params)
 
bool destruct ()
 shuts down the arm More...
 
KukaState::time_point_type get (time_point_tag)
 Get the timestamp of the most recent armState. More...
 
void get (KukaState &state)
 
const ParamsgetParams ()
 
void getWrench (KukaState &state)
 
 KukaJAVAdriver (Params params=defaultParams())
 
bool run_one ()
 SEND COMMAND TO ARM. Call this often Performs the main update spin once. More...
 
template<typename Range >
void set (Range &&range, grl::revolute_joint_angle_open_chain_command_tag)
 Set the joint positions for the current interpolation step. More...
 
void set (flatbuffer::KUKAiiwaInterface cif, command_tag)
 set the interface over which commands are sent (FRI interface, alternately SmartServo/DirectServo == JAVA interface, ) More...
 
void set (flatbuffer::KUKAiiwaInterface mif, state_tag)
 set the interface over which state is monitored (FRI interface, alternately SmartServo/DirectServo == JAVA interface, ) More...
 
template<typename TimeDuration >
void set (TimeDuration &&duration_to_goal_command, time_duration_command_tag)
 Set the time duration expected between new position commands. More...
 
template<typename Range >
void set (Range &&range, grl::revolute_joint_torque_open_chain_command_tag)
 Set the applied joint torques for the current interpolation step. More...
 
template<typename Range >
void set (Range &&range, grl::cartesian_wrench_command_tag)
 Set the applied wrench vector of the current interpolation step. More...
 
void set (const flatbuffer::ArmState &armControlMode)
 
 ~KukaJAVAdriver ()
 

Static Public Member Functions

static const Params defaultParams ()
 

Public Attributes

volatile std::size_t m_attemptedCommunicationConsecutiveFailureCount = 0
 
volatile std::size_t m_attemptedCommunicationConsecutiveSuccessCount = 0
 
volatile std::size_t m_attemptedCommunicationCount = 0
 
volatile std::size_t m_haveReceivedRealDataCount = 0
 

Detailed Description

This class contains code to offer a simple communication layer between ROS and the KUKA LBR iiwa

Initally:

Todo:
make sure mutex is locked when appropriate

Definition at line 90 of file KukaJAVAdriver.hpp.

Member Typedef Documentation

§ JointScalar

typedef std::vector<double> grl::robot::arm::KukaJAVAdriver::JointScalar

Definition at line 154 of file KukaJAVAdriver.hpp.

§ Params

typedef std::tuple< std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string, std::string > grl::robot::arm::KukaJAVAdriver::Params

Definition at line 119 of file KukaJAVAdriver.hpp.

§ State

Definition at line 169 of file KukaJAVAdriver.hpp.

§ TransformationMatrices

Definition at line 158 of file KukaJAVAdriver.hpp.

§ TransformationMatrix

See also
http://www.coppeliarobotics.com/helpFiles/en/apiFunctions.htm#simGetJointMatrix for data layout information

Definition at line 157 of file KukaJAVAdriver.hpp.

Member Enumeration Documentation

§ JointStateIndex

Enumerator
JointPosition 
JointForce 
JointTargetPosition 
JointLowerPositionLimit 
JointUpperPositionLimit 
JointMatrix 
JointStateTagIndex 

Definition at line 143 of file KukaJAVAdriver.hpp.

§ ParamIndex

Enumerator
RobotName 
RobotModel 
LocalUDPAddress 
LocalUDPPort 
RemoteUDPAddress 
LocalHostKukaKoniUDPAddress 
LocalHostKukaKoniUDPPort 
RemoteHostKukaKoniUDPAddress 
RemoteHostKukaKoniUDPPort 
KukaCommandMode 
KukaMonitorMode 

Definition at line 93 of file KukaJAVAdriver.hpp.

Constructor & Destructor Documentation

§ KukaJAVAdriver()

grl::robot::arm::KukaJAVAdriver::KukaJAVAdriver ( Params  params = defaultParams())
inline

Definition at line 172 of file KukaJAVAdriver.hpp.

§ ~KukaJAVAdriver()

grl::robot::arm::KukaJAVAdriver::~KukaJAVAdriver ( )
inline
Todo:
TODO(ahundt) switch to asio, remove destruct call from destructor

Definition at line 237 of file KukaJAVAdriver.hpp.

Member Function Documentation

§ construct() [1/2]

void grl::robot::arm::KukaJAVAdriver::construct ( )
inline

Definition at line 176 of file KukaJAVAdriver.hpp.

§ construct() [2/2]

void grl::robot::arm::KukaJAVAdriver::construct ( Params  params)
inline
Todo:
create a function that calls simGetObjectHandle and throws an exception when it fails
Warning
getting the ik group is optional, so it does not throw an exception
Todo:
TODO(ahundt) switch from linux socket to boost::asio::ip::udp::socket, see Kuka.hpp and KukaFRIdriver.hpp for examples, and make use of KukaUDP class.
Todo:
TODO(ahundt) Consider switching to boost::asio synchronous calls (async has high latency)!
Todo:
TODO(ahundt) Need to switch back to an appropriate exception rather than exiting so VREP isn't taken down.
Todo:
TODO(ahundt) switch from linux socket to boost::asio::ip::udp::socket, see Kuka.hpp and KukaFRIdriver.hpp for examples, and make use of KukaUDP class.

Definition at line 180 of file KukaJAVAdriver.hpp.

§ defaultParams()

static const Params grl::robot::arm::KukaJAVAdriver::defaultParams ( )
inlinestatic

Definition at line 122 of file KukaJAVAdriver.hpp.

§ destruct()

bool grl::robot::arm::KukaJAVAdriver::destruct ( )
inline

shuts down the arm

Definition at line 232 of file KukaJAVAdriver.hpp.

§ get() [1/2]

KukaState::time_point_type grl::robot::arm::KukaJAVAdriver::get ( time_point_tag  )
inline

Get the timestamp of the most recent armState.

See also
KukaFRIdriver::set(Range&& range, grl::revolute_joint_angle_open_chain_command_tag)

Definition at line 500 of file KukaJAVAdriver.hpp.

§ get() [2/2]

void grl::robot::arm::KukaJAVAdriver::get ( KukaState state)
inline
Todo:
should this exist? is it written correctly?

Definition at line 555 of file KukaJAVAdriver.hpp.

§ getParams()

const Params& grl::robot::arm::KukaJAVAdriver::getParams ( )
inline

Definition at line 227 of file KukaJAVAdriver.hpp.

§ getWrench()

void grl::robot::arm::KukaJAVAdriver::getWrench ( KukaState state)
inline

Definition at line 561 of file KukaJAVAdriver.hpp.

§ run_one()

bool grl::robot::arm::KukaJAVAdriver::run_one ( )
inline

SEND COMMAND TO ARM. Call this often Performs the main update spin once.

Todo:
ADD SUPPORT FOR READING ARM STATE OVER JAVA INTERFACE
Todo:
make this handled by template driver implementations/extensions
Todo:
is this the best string to pass for the full arm's name?
Todo:
when new
Todo:
TODO(ahundt) eventually run this in a separate thread so we can receive packets asap and minimize dropping

Definition at line 246 of file KukaJAVAdriver.hpp.

§ set() [1/7]

template<typename Range >
void grl::robot::arm::KukaJAVAdriver::set ( Range &&  range,
grl::revolute_joint_angle_open_chain_command_tag   
)
inline

Set the joint positions for the current interpolation step.

This method is only effective when the robot is in a commanding state and the set time point for reaching the destination is in the future. This function sets the goal time point for a motion to the epoch, aka "time 0" (which is in the past) for safety.

For position based motion to work, you must set both the position you want and the time you want it to get there. This is required because the robot can move extremely fast, so accidentally setting the velocity to the max is very dangerous. If the time point is in the past, the robot will not move. If the time point is too near in the future to make it, the robot will move at the max speed towards that position.

See also
KukaFRIdriver::set(TimePoint && time, time_point_command_tag) to set the destination time point in the future so the position motion can start.
Parameters
stateObject which stores the current state of the robot, including the command to send next
rangeArray with the new joint positions (in radians)
tagidentifier object indicating that revolute joint angle commands should be modified

Definition at line 447 of file KukaJAVAdriver.hpp.

§ set() [2/7]

void grl::robot::arm::KukaJAVAdriver::set ( flatbuffer::KUKAiiwaInterface  cif,
command_tag   
)
inline

set the interface over which commands are sent (FRI interface, alternately SmartServo/DirectServo == JAVA interface, )

Definition at line 457 of file KukaJAVAdriver.hpp.

§ set() [3/7]

void grl::robot::arm::KukaJAVAdriver::set ( flatbuffer::KUKAiiwaInterface  mif,
state_tag   
)
inline

set the interface over which state is monitored (FRI interface, alternately SmartServo/DirectServo == JAVA interface, )

Definition at line 465 of file KukaJAVAdriver.hpp.

§ set() [4/7]

template<typename TimeDuration >
void grl::robot::arm::KukaJAVAdriver::set ( TimeDuration &&  duration_to_goal_command,
time_duration_command_tag   
)
inline

Set the time duration expected between new position commands.

The driver will likely be updated every so often, such as every 25ms, and the lowest level of the driver may update even more frequently, such as every 1ms. By providing as accurate an estimate between high level updates the low level driver can smooth out the motion through interpolation (the default), or another algorithm. See LowLevelStepAlgorithmType template parameter in the KukaFRIdriver class if you want to change out the low level algorithm.

See also
KukaFRIdriver::get(time_duration_command_tag)
Parameters
duration_to_goal_commandstd::chrono time format representing the time duration between updates

Definition at line 485 of file KukaJAVAdriver.hpp.

§ set() [5/7]

template<typename Range >
void grl::robot::arm::KukaJAVAdriver::set ( Range &&  range,
grl::revolute_joint_torque_open_chain_command_tag   
)
inline

Set the applied joint torques for the current interpolation step.

This method is only effective when the client is in a commanding state. The ControlMode of the robot has to be joint impedance control mode. The Client Command Mode has to be torque.

Parameters
stateObject which stores the current state of the robot, including the command to send next
torquesArray with the applied torque values (in Nm)
tagidentifier object indicating that the torqe value command should be modified

Definition at line 519 of file KukaJAVAdriver.hpp.

§ set() [6/7]

template<typename Range >
void grl::robot::arm::KukaJAVAdriver::set ( Range &&  range,
grl::cartesian_wrench_command_tag   
)
inline

Set the applied wrench vector of the current interpolation step.

The wrench vector consists of: [F_x, F_y, F_z, tau_A, tau_B, tau_C]

F ... forces (in N) applied along the Cartesian axes of the currently used motion center. tau ... torques (in Nm) applied along the orientation angles (Euler angles A, B, C) of the currently used motion center.

This method is only effective when the client is in a commanding state. The ControlMode of the robot has to be Cartesian impedance control mode. The Client Command Mode has to be wrench.

Parameters
stateobject storing the command data that will be sent to the physical device
rangewrench Applied Cartesian wrench vector, in x, y, z, roll, pitch, yaw force measurments.
tagidentifier object indicating that the wrench value command should be modified
Todo:
perhaps support some specific more useful data layouts

Definition at line 548 of file KukaJAVAdriver.hpp.

§ set() [7/7]

void grl::robot::arm::KukaJAVAdriver::set ( const flatbuffer::ArmState armControlMode)
inline

set the mode of the arm. Examples: Teach or MoveArmJointServo

See also
grl::flatbuffer::ArmState in ArmControlState_generated.h

Definition at line 571 of file KukaJAVAdriver.hpp.

Member Data Documentation

§ m_attemptedCommunicationConsecutiveFailureCount

volatile std::size_t grl::robot::arm::KukaJAVAdriver::m_attemptedCommunicationConsecutiveFailureCount = 0

Definition at line 423 of file KukaJAVAdriver.hpp.

§ m_attemptedCommunicationConsecutiveSuccessCount

volatile std::size_t grl::robot::arm::KukaJAVAdriver::m_attemptedCommunicationConsecutiveSuccessCount = 0

Definition at line 424 of file KukaJAVAdriver.hpp.

§ m_attemptedCommunicationCount

volatile std::size_t grl::robot::arm::KukaJAVAdriver::m_attemptedCommunicationCount = 0

Definition at line 422 of file KukaJAVAdriver.hpp.

§ m_haveReceivedRealDataCount

volatile std::size_t grl::robot::arm::KukaJAVAdriver::m_haveReceivedRealDataCount = 0

Definition at line 421 of file KukaJAVAdriver.hpp.


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