Primary Kuka FRI driver, only talks over realtime network FRI KONI ethernet port. More...
#include <KukaFRIdriver.hpp>
Public Types | |
enum | ParamIndex |
typedef std::tuple< std::string, std::string, std::string, std::string, std::string, ThreadingRunMode > | Params |
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, ThreadingRunMode > | Params |
enum | ThreadingRunMode { run_manually = 0, run_automatically = 1 } |
Public Member Functions | |
void | construct () |
void | construct (Params params) |
KukaState::time_point_type | get (time_point_tag) |
Get the timestamp of the most recent armState. More... | |
void | get (KukaState &state) |
KukaState::joint_state | getMaxVel () |
const Params & | getParams () |
double | getSecondsPerTick () |
KukaFRIdriver (Params params=defaultParams()) | |
bool | run_one () |
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 (double duration_to_goal_command, time_duration_command_tag) |
Set the time duration expected between new position commands in ms. 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... | |
~KukaFRIdriver () | |
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 |
std::shared_ptr< grl::robot::arm::KukaFRIClientDataDriver< LowLevelStepAlgorithmType > > | kukaFRIClientDataDriverP_ |
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 |
Additional Inherited Members | |
Static Public Member Functions inherited from grl::robot::arm::KukaUDP | |
static void | add_details_to_connection_error (boost::exception &e, Params ¶ms) |
template<typename T > | |
static boost::asio::ip::udp::socket | connect (T ¶ms, 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 () |
Primary Kuka FRI driver, only talks over realtime network FRI KONI ethernet port.
KukaFRIdriver is a low level driver at a slightly "higher level" than the the "lowest level" KukaFRIClientDataDriver to communicate. This is the class you will want to replace if you want to change how low level position updates are changed between FRI update steps, which occur at a configurable duration of 1-5 ms.
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.
While velocity limits are not provided explicitly by KUKA in their low level C++ API, if you send a command that violates the velocity limits specified in KUKA's documenation the arm stops immediately with an error, even over FRI.
support generic read/write
ensure commands stay within machine limits to avoid lockup
reset and resume if lockup occurs whenever possible
in classes that use this driver, make the use of this class templated so that the low level update algorithm can change.
add getter for number of milliseconds between fri updates (1-5) aka sync_period aka send_period aka ms per tick
Definition at line 870 of file KukaFRIdriver.hpp.
typedef std::tuple<std::string, std::string, std::string, std::string, std::string, ThreadingRunMode> grl::robot::arm::KukaUDP::Params |
enum grl::robot::arm::KukaUDP::ParamIndex |
enum grl::robot::arm::KukaUDP::ThreadingRunMode |
|
inline |
Definition at line 880 of file KukaFRIdriver.hpp.
|
inline |
Definition at line 919 of file KukaFRIdriver.hpp.
|
inline |
Definition at line 889 of file KukaFRIdriver.hpp.
|
inline |
Definition at line 895 of file KukaFRIdriver.hpp.
|
inline |
Get the timestamp of the most recent armState.
Definition at line 1172 of file KukaFRIdriver.hpp.
|
inline |
Definition at line 1230 of file KukaFRIdriver.hpp.
|
inline |
get max velocity constraint parameter for this robot model
Definition at line 939 of file KukaFRIdriver.hpp.
|
inline |
Definition at line 917 of file KukaFRIdriver.hpp.
|
inline |
gets the number of seconds in one message exchange "tick" aka "cycle", "time step"
Definition at line 930 of file KukaFRIdriver.hpp.
|
inline |
spin once, this is what you call each time you synchronize the client with the robot over UDP it is expected to be called at least once per send_period_millisec, which is the time between each FRI udp packet.
grl::robot::arm::copy(friData_->monitoringMsg,
std::back_inserter(armState.commandedPosition), grl::revolute_joint_angle_open_chain_command_tag());
grl::robot::arm::copy(friData_->monitoringMsg,
std::back_inserter(armState.commandedTorque) , grl::revolute_joint_torque_open_chain_command_tag());
Definition at line 963 of file KukaFRIdriver.hpp.
|
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.
state | Object which stores the current state of the robot, including the command to send next |
range | Array with the new joint positions (in radians) |
tag | identifier object indicating that revolute joint angle commands should be modified |
Definition at line 1131 of file KukaFRIdriver.hpp.
|
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.
duration_to_goal_command | std::chrono time format representing the time duration between updates |
Definition at line 1158 of file KukaFRIdriver.hpp.
|
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.
state | Object which stores the current state of the robot, including the command to send next |
torques | Array with the applied torque values (in Nm) |
tag | identifier object indicating that the torqe value command should be modified |
Definition at line 1191 of file KukaFRIdriver.hpp.
|
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.
state | object storing the command data that will be sent to the physical device |
range | wrench Applied Cartesian wrench vector, in x, y, z, roll, pitch, yaw force measurments. |
tag | identifier object indicating that the wrench value command should be modified |
Definition at line 1223 of file KukaFRIdriver.hpp.
boost::asio::io_service grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::device_driver_io_service |
Definition at line 1251 of file KukaFRIdriver.hpp.
std::unique_ptr<boost::asio::io_service::work> grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::device_driver_workP_ |
Definition at line 1252 of file KukaFRIdriver.hpp.
std::unique_ptr<std::thread> grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::driver_threadP |
Definition at line 1253 of file KukaFRIdriver.hpp.
std::shared_ptr< grl::robot::arm::KukaFRIClientDataDriver<LowLevelStepAlgorithmType> > grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::kukaFRIClientDataDriverP_ |
Definition at line 1256 of file KukaFRIdriver.hpp.
volatile std::size_t grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::m_attemptedCommunicationConsecutiveFailureCount = 0 |
Definition at line 1246 of file KukaFRIdriver.hpp.
volatile std::size_t grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::m_attemptedCommunicationConsecutiveSuccessCount = 0 |
Definition at line 1249 of file KukaFRIdriver.hpp.
volatile std::size_t grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::m_attemptedCommunicationCount = 0 |
Definition at line 1243 of file KukaFRIdriver.hpp.
volatile std::size_t grl::robot::arm::KukaFRIdriver< LowLevelStepAlgorithmType >::m_haveReceivedRealDataCount = 0 |
Definition at line 1238 of file KukaFRIdriver.hpp.