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

Kuka LBR iiwa Primary Multi Mode Driver, supports communication over FRI and JAVA interfaces. More...

#include <KukaDriver.hpp>

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

Public Types

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
 

Public Member Functions

void construct ()
 
void construct (Params params)
 
bool destruct ()
 
KukaState::time_point_type get (time_point_tag)
 Get the timestamp of the most recent armState. More...
 
template<typename OutputIterator >
void get (OutputIterator output, grl::revolute_joint_angle_open_chain_state_tag)
 
template<typename OutputIterator >
void get (OutputIterator output, grl::revolute_joint_torque_open_chain_state_tag)
 
template<typename OutputIterator >
void get (OutputIterator output, grl::revolute_joint_torque_external_open_chain_state_tag)
 
template<typename OutputIterator >
void get (OutputIterator output, grl::cartesian_external_force_tag)
 
const ParamsgetParams ()
 
template<typename OutputIterator >
void getWrench (OutputIterator output)
 
 KukaDriver (Params params=defaultParams())
 
bool run_one ()
 
void set (const flatbuffer::ArmState &armControlMode)
 
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...
 
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...
 
void set (double duration_to_goal_command, time_duration_command_tag tag)
 Set the time duration expected between new position commands in ms. More...
 
template<typename Range >
void set (Range &&range, grl::cartesian_wrench_command_tag)
 Set the applied wrench vector of the current interpolation step. More...
 
 ~KukaDriver ()
 

Static Public Member Functions

static const Params defaultParams ()
 

Public Attributes

boost::asio::io_service device_driver_io_service
 
std::unique_ptr< boost::asio::io_service::work > device_driver_workP_
 
std::unique_ptr< std::thread > driver_threadP
 
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

Kuka LBR iiwa Primary Multi Mode Driver, supports communication over FRI and JAVA interfaces.

The most effective configuration of this driver is to command the KUKA in JAVA mode and receive robot status updates via FRI mode.

Todo:
enable commanding and monitoring to be independently configured for both FRI and JAVA interface.

Definition at line 41 of file KukaDriver.hpp.

Member Typedef Documentation

§ 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::KukaDriver::Params

Definition at line 70 of file KukaDriver.hpp.

Member Enumeration Documentation

§ ParamIndex

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

Definition at line 44 of file KukaDriver.hpp.

Constructor & Destructor Documentation

§ KukaDriver()

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

Definition at line 90 of file KukaDriver.hpp.

§ ~KukaDriver()

grl::robot::arm::KukaDriver::~KukaDriver ( )
inline

Definition at line 158 of file KukaDriver.hpp.

Member Function Documentation

§ construct() [1/2]

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

Definition at line 94 of file KukaDriver.hpp.

§ construct() [2/2]

void grl::robot::arm::KukaDriver::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:
figure out how to re-enable when .so isn't loaded
Todo:
implement reading configuration in both FRI and JAVA mode from JAVA interface
Todo:
perhaps allow user to control this?

Definition at line 101 of file KukaDriver.hpp.

§ defaultParams()

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

Definition at line 73 of file KukaDriver.hpp.

§ destruct()

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

Definition at line 96 of file KukaDriver.hpp.

§ get() [1/5]

KukaState::time_point_type grl::robot::arm::KukaDriver::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 327 of file KukaDriver.hpp.

§ get() [2/5]

template<typename OutputIterator >
void grl::robot::arm::KukaDriver::get ( OutputIterator  output,
grl::revolute_joint_angle_open_chain_state_tag   
)
inline
Todo:
implement get function

Definition at line 362 of file KukaDriver.hpp.

§ get() [3/5]

template<typename OutputIterator >
void grl::robot::arm::KukaDriver::get ( OutputIterator  output,
grl::revolute_joint_torque_open_chain_state_tag   
)
inline
Todo:
implement get function

Definition at line 370 of file KukaDriver.hpp.

§ get() [4/5]

template<typename OutputIterator >
void grl::robot::arm::KukaDriver::get ( OutputIterator  output,
grl::revolute_joint_torque_external_open_chain_state_tag   
)
inline

Definition at line 378 of file KukaDriver.hpp.

§ get() [5/5]

template<typename OutputIterator >
void grl::robot::arm::KukaDriver::get ( OutputIterator  output,
grl::cartesian_external_force_tag   
)
inline

Definition at line 386 of file KukaDriver.hpp.

§ getParams()

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

Definition at line 154 of file KukaDriver.hpp.

§ getWrench()

template<typename OutputIterator >
void grl::robot::arm::KukaDriver::getWrench ( OutputIterator  output)
inline

Definition at line 394 of file KukaDriver.hpp.

§ run_one()

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

spin once

Todo:
make this handled by template driver implementations/extensions

Definition at line 171 of file KukaDriver.hpp.

§ set() [1/5]

void grl::robot::arm::KukaDriver::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 246 of file KukaDriver.hpp.

§ set() [2/5]

template<typename Range >
void grl::robot::arm::KukaDriver::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 client is in a commanding state.

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 263 of file KukaDriver.hpp.

§ set() [3/5]

template<typename Range >
void grl::robot::arm::KukaDriver::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 284 of file KukaDriver.hpp.

§ set() [4/5]

void grl::robot::arm::KukaDriver::set ( double  duration_to_goal_command,
time_duration_command_tag  tag 
)
inline

Set the time duration expected between new position commands in ms.

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 305 of file KukaDriver.hpp.

§ set() [5/5]

template<typename Range >
void grl::robot::arm::KukaDriver::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 354 of file KukaDriver.hpp.

Member Data Documentation

§ device_driver_io_service

boost::asio::io_service grl::robot::arm::KukaDriver::device_driver_io_service

Definition at line 406 of file KukaDriver.hpp.

§ device_driver_workP_

std::unique_ptr<boost::asio::io_service::work> grl::robot::arm::KukaDriver::device_driver_workP_

Definition at line 407 of file KukaDriver.hpp.

§ driver_threadP

std::unique_ptr<std::thread> grl::robot::arm::KukaDriver::driver_threadP

Definition at line 408 of file KukaDriver.hpp.

§ m_attemptedCommunicationConsecutiveFailureCount

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

Definition at line 403 of file KukaDriver.hpp.

§ m_attemptedCommunicationConsecutiveSuccessCount

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

Definition at line 404 of file KukaDriver.hpp.

§ m_attemptedCommunicationCount

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

Definition at line 402 of file KukaDriver.hpp.

§ m_haveReceivedRealDataCount

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

Definition at line 401 of file KukaDriver.hpp.


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