Simple low level driver to communicate over the Kuka iiwa FRI interface using KUKA::FRI::ClientData status objects.
More...
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.
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] | friData | supply 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.