Public Types | Public Member Functions | List of all members
grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType > Class Template Reference

Simple low level driver to communicate over the Kuka iiwa FRI interface using KUKA::FRI::ClientData status objects. More...

#include <KukaFRIdriver.hpp>

+ Inheritance diagram for grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >:
+ Collaboration diagram for grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >:

Public Types

enum  ParamIndex
 
typedef std::tuple< std::string, std::string, std::string, std::string, std::string, ThreadingRunModeParams
 
enum  ThreadingRunMode
 
- Public Types inherited from grl::robot::arm::KukaUDP
enum  ParamIndex {
  RobotModel, localhost, localport, remotehost,
  remoteport, is_running_automatically
}
 
typedef std::tuple< std::string, std::string, std::string, std::string, std::string, ThreadingRunModeParams
 
enum  ThreadingRunMode { run_manually = 0, run_automatically = 1 }
 

Public Member Functions

void construct (Params params=defaultParams())
 Call this to initialize the object after the constructor has been called. More...
 
void destruct ()
 
bool is_active ()
 
 KukaFRIClientDataDriver (boost::asio::io_service &ios, Params params=defaultParams())
 
 KukaFRIClientDataDriver (Params params=defaultParams())
 
void run ()
 blocking call to communicate with the robot continuously More...
 
bool update_state (LowLevelStepAlgorithmType &step_alg, std::shared_ptr< KUKA::FRI::ClientData > &friData, boost::system::error_code &receive_ec, std::size_t &receive_bytes_transferred, boost::system::error_code &send_ec, std::size_t &send_bytes_transferred)
 Updates the passed friData shared pointer to a pointer to newly updated data, plus any errors that occurred. More...
 
 ~KukaFRIClientDataDriver ()
 

Additional Inherited Members

- Static Public Member Functions inherited from grl::robot::arm::KukaUDP
static void add_details_to_connection_error (boost::exception &e, Params &params)
 
template<typename T >
static boost::asio::ip::udp::socket connect (T &params, boost::asio::io_service &io_service_, boost::asio::ip::udp::endpoint &sender_endpoint)
 Advanced functionality, do not use without a great reason. More...
 
static const Params defaultParams ()
 

Detailed Description

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
class grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >

Simple low level driver to communicate over the Kuka iiwa FRI interface using KUKA::FRI::ClientData status objects.

Note
If you aren't sure, see KukaDriver in KukaDriver.hpp.
If you want to change how the lowest level high rate updates are performed see KukaFRIdriver

One important aspect of this design is the is_running_automatically flag. If you are unsure, the suggested default is run_automatically (true/enabled). When it is enabled, the driver will create a thread internally and run the event loop (io_service) itself. If run manually, you are expected to call io_service.run() on the io_service you provide, or on the run() member function. When running manually you are also expected to call async_getLatestState(handler) frequently enought that the 5ms response requirement of the KUKA FRI interface is met.

Definition at line 421 of file KukaFRIdriver.hpp.

Member Typedef Documentation

§ Params

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
typedef std::tuple<std::string, std::string, std::string, std::string, std::string, ThreadingRunMode> grl::robot::arm::KukaUDP::Params

Definition at line 207 of file Kuka.hpp.

Member Enumeration Documentation

§ ParamIndex

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
enum grl::robot::arm::KukaUDP::ParamIndex

Definition at line 192 of file Kuka.hpp.

§ ThreadingRunMode

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
enum grl::robot::arm::KukaUDP::ThreadingRunMode

Definition at line 203 of file Kuka.hpp.

Constructor & Destructor Documentation

§ KukaFRIClientDataDriver() [1/2]

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::KukaFRIClientDataDriver ( boost::asio::io_service &  ios,
Params  params = defaultParams() 
)
inline

Definition at line 432 of file KukaFRIdriver.hpp.

§ KukaFRIClientDataDriver() [2/2]

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::KukaFRIClientDataDriver ( Params  params = defaultParams())
inline

Definition at line 443 of file KukaFRIdriver.hpp.

§ ~KukaFRIClientDataDriver()

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::~KukaFRIClientDataDriver ( )
inline

Definition at line 589 of file KukaFRIdriver.hpp.

Member Function Documentation

§ construct()

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
void grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::construct ( Params  params = defaultParams())
inline

Call this to initialize the object after the constructor has been called.

Definition at line 455 of file KukaFRIdriver.hpp.

§ destruct()

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
void grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::destruct ( )
inline

Definition at line 582 of file KukaFRIdriver.hpp.

§ is_active()

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
bool grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::is_active ( )
inline

Is everything ok?

Returns
true if the kuka fri connection is actively running without any issues
Todo:
consider expanding to support real error codes

Definition at line 595 of file KukaFRIdriver.hpp.

§ run()

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
void grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::run ( )
inline

blocking call to communicate with the robot continuously

Precondition
construct() should be called before run()

Definition at line 477 of file KukaFRIdriver.hpp.

§ update_state()

template<typename LowLevelStepAlgorithmType = LinearInterpolation>
bool grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType >::update_state ( LowLevelStepAlgorithmType &  step_alg,
std::shared_ptr< KUKA::FRI::ClientData > &  friData,
boost::system::error_code &  receive_ec,
std::size_t &  receive_bytes_transferred,
boost::system::error_code &  send_ec,
std::size_t &  send_bytes_transferred 
)
inline

Updates the passed friData shared pointer to a pointer to newly updated data, plus any errors that occurred.

We recommend you supply a valid shared_ptr to friData, even if all command elements are set to false. The friData pointer you pass in can contain a command to send to the arm. To update with new state and optional input state, you give up lifetime control of the input, and assume liftime control of the output.

This function is designed for single threaded use to quickly receive and send "non-blocking" updates to the robot. It is not thread safe cannot be called simultaneously from multiple threads.

Note
{ An error code is set if update_state is called with no new data available. In this special case, all error codes and bytes_transferred are 0, because there was no new data available for the user. }
Warning
Do not pound this call continuously in a very tight loop, because then the driver won't be able to acquire the lock and send updates to the robot.
Parameters
[in,out]friDatasupply a new command, receive a new update of the robot state. Pointer is null if no new data is available.
Precondition
If friData!=nullptr it is assumed valid for use and this class will take control of the object.
Returns
isError = false if you have new data, true when there is either an error or no new data
Note
this exception most likely came from the update() call running the kuka driver
Todo:
is this thread safe?

Definition at line 514 of file KukaFRIdriver.hpp.


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