libfranka 0.15.0
FCI C++ API
|
Maintains a network connection to the robot, provides the current robot state, gives access to the model library and allows to control the robot. More...
#include <robot.h>
Public Types | |
using | ServerVersion = uint16_t |
Version of the robot server. | |
Public Member Functions | |
Robot (const std::string &franka_address, RealtimeConfig realtime_config=RealtimeConfig::kEnforce, size_t log_size=50) | |
Establishes a connection with the robot. | |
Robot (Robot &&other) noexcept | |
Move-constructs a new Robot instance. | |
Robot & | operator= (Robot &&other) noexcept |
Move-assigns this Robot from another Robot instance. | |
virtual | ~Robot () noexcept |
Closes the connection. | |
void | read (std::function< bool(const RobotState &)> read_callback) |
Starts a loop for reading the current robot state. | |
virtual RobotState | readOnce () |
Waits for a robot state update and returns it. | |
Model | loadModel () |
Loads the model library from the robot. | |
Model | loadModel (std::unique_ptr< RobotModelBase > robot_model) |
ServerVersion | serverVersion () const noexcept |
Returns the software version reported by the connected server. | |
Motion generation and joint-level torque commands | |
The following methods allow to perform motion generation and/or send joint-level torque commands without gravity and friction by providing callback functions. Only one of these methods can be active at the same time; a franka::ControlException is thrown otherwise. When a robot state is received, the callback function is used to calculate the response: the desired values for that time step. After sending back the response, the callback function will be called again with the most recently received robot state. Since the robot is controlled with a 1 kHz frequency, the callback functions have to compute their result in a short time frame in order to be accepted. Callback functions take two parameters:
The following incomplete example shows the general structure of a callback function: double time = 0.0;
franka::Duration time_step) -> franka::JointPositions {
time += time_step.toSec(); // Update time at the beginning of the callback.
franka::JointPositions output = getJointPositions(time);
if (time >= max_time) {
// Return MotionFinished at the end of the trajectory.
return franka::MotionFinished(output);
}
return output;
}
Stores values for joint position motion generation. Definition control_types.h:72 Torques MotionFinished(Torques command) noexcept Helper method to indicate that a motion should stop after processing the given command. Definition control_types.h:294 | |
void | control (std::function< Torques(const RobotState &, franka::Duration)> control_callback, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for sending joint-level torque commands. | |
void | control (std::function< Torques(const RobotState &, franka::Duration)> control_callback, std::function< JointPositions(const RobotState &, franka::Duration)> motion_generator_callback, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for sending joint-level torque commands and joint positions. | |
void | control (std::function< Torques(const RobotState &, franka::Duration)> control_callback, std::function< JointVelocities(const RobotState &, franka::Duration)> motion_generator_callback, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for sending joint-level torque commands and joint velocities. | |
void | control (std::function< Torques(const RobotState &, franka::Duration)> control_callback, std::function< CartesianPose(const RobotState &, franka::Duration)> motion_generator_callback, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for sending joint-level torque commands and Cartesian poses. | |
void | control (std::function< Torques(const RobotState &, franka::Duration)> control_callback, std::function< CartesianVelocities(const RobotState &, franka::Duration)> motion_generator_callback, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for sending joint-level torque commands and Cartesian velocities. | |
void | control (std::function< JointPositions(const RobotState &, franka::Duration)> motion_generator_callback, ControllerMode controller_mode=ControllerMode::kJointImpedance, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for a joint position motion generator with a given controller mode. | |
void | control (std::function< JointVelocities(const RobotState &, franka::Duration)> motion_generator_callback, ControllerMode controller_mode=ControllerMode::kJointImpedance, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for a joint velocity motion generator with a given controller mode. | |
void | control (std::function< CartesianPose(const RobotState &, franka::Duration)> motion_generator_callback, ControllerMode controller_mode=ControllerMode::kJointImpedance, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for a Cartesian pose motion generator with a given controller mode. | |
void | control (std::function< CartesianVelocities(const RobotState &, franka::Duration)> motion_generator_callback, ControllerMode controller_mode=ControllerMode::kJointImpedance, bool limit_rate=false, double cutoff_frequency=kDefaultCutoffFrequency) |
Starts a control loop for a Cartesian velocity motion generator with a given controller mode. | |
Commands | |
Commands are executed by communicating with the robot over the network. These functions should therefore not be called from within control or motion generator loops. | |
auto | getRobotModel () -> std::string |
void | setCollisionBehavior (const std::array< double, 7 > &lower_torque_thresholds_acceleration, const std::array< double, 7 > &upper_torque_thresholds_acceleration, const std::array< double, 7 > &lower_torque_thresholds_nominal, const std::array< double, 7 > &upper_torque_thresholds_nominal, const std::array< double, 6 > &lower_force_thresholds_acceleration, const std::array< double, 6 > &upper_force_thresholds_acceleration, const std::array< double, 6 > &lower_force_thresholds_nominal, const std::array< double, 6 > &upper_force_thresholds_nominal) |
Changes the collision behavior. | |
void | setCollisionBehavior (const std::array< double, 7 > &lower_torque_thresholds, const std::array< double, 7 > &upper_torque_thresholds, const std::array< double, 6 > &lower_force_thresholds, const std::array< double, 6 > &upper_force_thresholds) |
Changes the collision behavior. | |
void | setJointImpedance (const std::array< double, 7 > &K_theta) |
Sets the impedance for each joint in the internal controller. | |
void | setCartesianImpedance (const std::array< double, 6 > &K_x) |
Sets the Cartesian stiffness/compliance (for x, y, z, roll, pitch, yaw) in the internal controller. | |
void | setGuidingMode (const std::array< bool, 6 > &guiding_mode, bool elbow) |
Locks or unlocks guiding mode movement in (x, y, z, roll, pitch, yaw). | |
void | setK (const std::array< double, 16 > &EE_T_K) |
Sets the transformation \(^{EE}T_K\) from end effector frame to stiffness frame. | |
void | setEE (const std::array< double, 16 > &NE_T_EE) |
Sets the transformation \(^{NE}T_{EE}\) from nominal end effector to end effector frame. | |
void | setLoad (double load_mass, const std::array< double, 3 > &F_x_Cload, const std::array< double, 9 > &load_inertia) |
Sets dynamic parameters of a payload. | |
void | automaticErrorRecovery () |
Runs automatic error recovery on the robot. | |
virtual std::unique_ptr< ActiveControlBase > | startTorqueControl () |
Starts a new torque controller. | |
virtual std::unique_ptr< ActiveControlBase > | startJointPositionControl (const research_interface::robot::Move::ControllerMode &control_type) |
Starts a new joint position motion generator. | |
virtual std::unique_ptr< ActiveControlBase > | startJointVelocityControl (const research_interface::robot::Move::ControllerMode &control_type) |
Starts a new joint velocity motion generator. | |
virtual std::unique_ptr< ActiveControlBase > | startCartesianPoseControl (const research_interface::robot::Move::ControllerMode &control_type) |
Starts a new cartesian position motion generator. | |
virtual std::unique_ptr< ActiveControlBase > | startCartesianVelocityControl (const research_interface::robot::Move::ControllerMode &control_type) |
Starts a new cartesian velocity motion generator. | |
void | stop () |
Stops all currently running motions. | |
Protected Member Functions | |
Robot (std::shared_ptr< Impl > robot_impl) | |
Constructs a new Robot given a Robot::Impl. | |
Robot ()=default | |
Default constructor to enable mocking and testing. | |
Maintains a network connection to the robot, provides the current robot state, gives access to the model library and allows to control the robot.
|
explicit |
Establishes a connection with the robot.
[in] | franka_address | IP/hostname of the robot. |
[in] | realtime_config | if set to Enforce, an exception will be thrown if realtime priority cannot be set when required. Setting realtime_config to Ignore disables this behavior. |
[in] | log_size | sets how many last states should be kept for logging purposes. The log is provided when a ControlException is thrown. |
NetworkException | if the connection is unsuccessful. |
IncompatibleVersionException | if this version of libfranka is not supported. |
|
noexcept |
|
protected |
Constructs a new Robot given a Robot::Impl.
This enables unittests with Robot::Impl-Mocks.
robot_impl | Robot::Impl to use |
void franka::Robot::automaticErrorRecovery | ( | ) |
Runs automatic error recovery on the robot.
Automatic error recovery e.g. resets the robot after a collision occurred.
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::control | ( | std::function< CartesianPose(const RobotState &, franka::Duration)> | motion_generator_callback, |
ControllerMode | controller_mode = ControllerMode::kJointImpedance , |
||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for a Cartesian pose motion generator with a given controller mode.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | controller_mode | Controller to use to execute the motion. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if Cartesian pose command elements are NaN or infinity. |
void franka::Robot::control | ( | std::function< CartesianVelocities(const RobotState &, franka::Duration)> | motion_generator_callback, |
ControllerMode | controller_mode = ControllerMode::kJointImpedance , |
||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for a Cartesian velocity motion generator with a given controller mode.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | controller_mode | Controller to use to execute the motion. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if Cartesian velocity command elements are NaN or infinity. |
void franka::Robot::control | ( | std::function< JointPositions(const RobotState &, franka::Duration)> | motion_generator_callback, |
ControllerMode | controller_mode = ControllerMode::kJointImpedance , |
||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for a joint position motion generator with a given controller mode.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | controller_mode | Controller to use to execute the motion. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if joint position commands are NaN or infinity. |
void franka::Robot::control | ( | std::function< JointVelocities(const RobotState &, franka::Duration)> | motion_generator_callback, |
ControllerMode | controller_mode = ControllerMode::kJointImpedance , |
||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for a joint velocity motion generator with a given controller mode.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | controller_mode | Controller to use to execute the motion. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if joint velocity commands are NaN or infinity. |
void franka::Robot::control | ( | std::function< Torques(const RobotState &, franka::Duration)> | control_callback, |
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for sending joint-level torque commands.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | control_callback | Callback function providing joint-level torque commands. See here for more details. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if joint-level torque commands are NaN or infinity. |
void franka::Robot::control | ( | std::function< Torques(const RobotState &, franka::Duration)> | control_callback, |
std::function< CartesianPose(const RobotState &, franka::Duration)> | motion_generator_callback, | ||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for sending joint-level torque commands and Cartesian poses.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | control_callback | Callback function providing joint-level torque commands. See here for more details. |
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if joint-level torque or Cartesian pose command elements are NaN or infinity. |
void franka::Robot::control | ( | std::function< Torques(const RobotState &, franka::Duration)> | control_callback, |
std::function< CartesianVelocities(const RobotState &, franka::Duration)> | motion_generator_callback, | ||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for sending joint-level torque commands and Cartesian velocities.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | control_callback | Callback function providing joint-level torque commands. See here for more details. |
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if joint-level torque or Cartesian velocity command elements are NaN or infinity. |
void franka::Robot::control | ( | std::function< Torques(const RobotState &, franka::Duration)> | control_callback, |
std::function< JointPositions(const RobotState &, franka::Duration)> | motion_generator_callback, | ||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for sending joint-level torque commands and joint positions.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | control_callback | Callback function providing joint-level torque commands. See here for more details. |
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if joint-level torque or joint position commands are NaN or infinity. |
void franka::Robot::control | ( | std::function< Torques(const RobotState &, franka::Duration)> | control_callback, |
std::function< JointVelocities(const RobotState &, franka::Duration)> | motion_generator_callback, | ||
bool | limit_rate = false , |
||
double | cutoff_frequency = kDefaultCutoffFrequency |
||
) |
Starts a control loop for sending joint-level torque commands and joint velocities.
Sets realtime priority for the current thread. Cannot be executed while another control or motion generator loop is active.
[in] | control_callback | Callback function providing joint-level torque commands. See here for more details. |
[in] | motion_generator_callback | Callback function for motion generation. See here for more details. |
[in] | limit_rate | True if rate limiting should be activated. False by default. This could distort your motion! |
[in] | cutoff_frequency | Cutoff frequency for a first order low-pass filter applied on the user commanded signal. Set to franka::kMaxCutoffFrequency to disable. |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
RealtimeException | if realtime priority cannot be set for the current thread. |
std::invalid_argument | if joint-level torque or joint velocity commands are NaN or infinity. |
auto franka::Robot::getRobotModel | ( | ) | -> std::string |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
Model franka::Robot::loadModel | ( | ) |
Loads the model library from the robot.
ModelException | if the model library cannot be loaded. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::read | ( | std::function< bool(const RobotState &)> | read_callback | ) |
Starts a loop for reading the current robot state.
Cannot be executed while a control or motion generator loop is running.
This minimal example will print the robot state 100 times:
[in] | read_callback | Callback function for robot state reading. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
|
virtual |
Waits for a robot state update and returns it.
Cannot be executed while a control or motion generator loop is running.
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
|
noexcept |
Returns the software version reported by the connected server.
void franka::Robot::setCartesianImpedance | ( | const std::array< double, 6 > & | K_x | ) |
Sets the Cartesian stiffness/compliance (for x, y, z, roll, pitch, yaw) in the internal controller.
The values set using Robot::setCartesianImpedance are used in the direction of the stiffness frame, which can be set with Robot::setK.
Inputs received by the torque controller are not affected by this setting.
[in] | K_x | Cartesian impedance values \(K_x=(K_{x_{x,y,z}} \in [10,3000] \frac{N}{m}, K_{x_{R,P,Y}} \in [1,300] \frac{Nm}{rad})\) |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::setCollisionBehavior | ( | const std::array< double, 7 > & | lower_torque_thresholds, |
const std::array< double, 7 > & | upper_torque_thresholds, | ||
const std::array< double, 6 > & | lower_force_thresholds, | ||
const std::array< double, 6 > & | upper_force_thresholds | ||
) |
Changes the collision behavior.
Set common torque and force boundaries for acceleration/deceleration and constant velocity movement phases.
Forces or torques between lower and upper threshold are shown as contacts in the RobotState. Forces or torques above the upper threshold are registered as collision and cause the robot to stop moving.
[in] | lower_torque_thresholds | Contact torque thresholds for each joint in \([Nm]\). |
[in] | upper_torque_thresholds | Collision torque thresholds for each joint in \([Nm]\). |
[in] | lower_force_thresholds | Contact force thresholds for \((x,y,z,R,P,Y)\) in \([N]\). |
[in] | upper_force_thresholds | Collision force thresholds for \((x,y,z,R,P,Y)\) in \([N]\). |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::setCollisionBehavior | ( | const std::array< double, 7 > & | lower_torque_thresholds_acceleration, |
const std::array< double, 7 > & | upper_torque_thresholds_acceleration, | ||
const std::array< double, 7 > & | lower_torque_thresholds_nominal, | ||
const std::array< double, 7 > & | upper_torque_thresholds_nominal, | ||
const std::array< double, 6 > & | lower_force_thresholds_acceleration, | ||
const std::array< double, 6 > & | upper_force_thresholds_acceleration, | ||
const std::array< double, 6 > & | lower_force_thresholds_nominal, | ||
const std::array< double, 6 > & | upper_force_thresholds_nominal | ||
) |
Changes the collision behavior.
Set separate torque and force boundaries for acceleration/deceleration and constant velocity movement phases.
Forces or torques between lower and upper threshold are shown as contacts in the RobotState. Forces or torques above the upper threshold are registered as collision and cause the robot to stop moving.
[in] | lower_torque_thresholds_acceleration | Contact torque thresholds during acceleration/deceleration for each joint in \([Nm]\). |
[in] | upper_torque_thresholds_acceleration | Collision torque thresholds during acceleration/deceleration for each joint in \([Nm]\). |
[in] | lower_torque_thresholds_nominal | Contact torque thresholds for each joint in \([Nm]\). |
[in] | upper_torque_thresholds_nominal | Collision torque thresholds for each joint in \([Nm]\). |
[in] | lower_force_thresholds_acceleration | Contact force thresholds during acceleration/deceleration for \((x,y,z,R,P,Y)\) in \([N]\). |
[in] | upper_force_thresholds_acceleration | Collision force thresholds during acceleration/deceleration for \((x,y,z,R,P,Y)\) in \([N]\). |
[in] | lower_force_thresholds_nominal | Contact force thresholds for \((x,y,z,R,P,Y)\) in \([N]\). |
[in] | upper_force_thresholds_nominal | Collision force thresholds for \((x,y,z,R,P,Y)\) in \([N]\). |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::setEE | ( | const std::array< double, 16 > & | NE_T_EE | ) |
Sets the transformation \(^{NE}T_{EE}\) from nominal end effector to end effector frame.
The transformation matrix is represented as a vectorized 4x4 matrix in column-major format.
[in] | NE_T_EE | Vectorized NE-to-EE transformation matrix \(^{NE}T_{EE}\), column-major. |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::setGuidingMode | ( | const std::array< bool, 6 > & | guiding_mode, |
bool | elbow | ||
) |
Locks or unlocks guiding mode movement in (x, y, z, roll, pitch, yaw).
If a flag is set to true, movement is unlocked.
[in] | guiding_mode | Unlocked movement in (x, y, z, R, P, Y) in guiding mode. |
[in] | elbow | True if the elbow is free in guiding mode, false otherwise. |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::setJointImpedance | ( | const std::array< double, 7 > & | K_theta | ) |
Sets the impedance for each joint in the internal controller.
User-provided torques are not affected by this setting.
[in] | K_theta | Joint impedance values \(K_{\theta_{1-7}} = \in [0,14250] \frac{Nm}{rad}\) |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::setK | ( | const std::array< double, 16 > & | EE_T_K | ) |
Sets the transformation \(^{EE}T_K\) from end effector frame to stiffness frame.
The transformation matrix is represented as a vectorized 4x4 matrix in column-major format.
[in] | EE_T_K | Vectorized EE-to-K transformation matrix \(^{EE}T_K\), column-major. |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
void franka::Robot::setLoad | ( | double | load_mass, |
const std::array< double, 3 > & | F_x_Cload, | ||
const std::array< double, 9 > & | load_inertia | ||
) |
Sets dynamic parameters of a payload.
[in] | load_mass | Mass of the load in \([kg]\). |
[in] | F_x_Cload | Translation from flange to center of mass of load \(^Fx_{C_\text{load}}\) in \([m]\). |
[in] | load_inertia | Inertia matrix \(I_\text{load}\) in \([kg \times m^2]\), column-major. |
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |
|
virtual |
Starts a new cartesian position motion generator.
control_type | research_interface::robot::Move::ControllerMode control type for the operation |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
std::invalid_argument | if joint-level torque commands are NaN or infinity. |
|
virtual |
Starts a new cartesian velocity motion generator.
control_type | research_interface::robot::Move::ControllerMode control type for the operation |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
std::invalid_argument | if joint-level torque commands are NaN or infinity. |
|
virtual |
Starts a new joint position motion generator.
control_type | research_interface::robot::Move::ControllerMode control type for the operation |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
std::invalid_argument | if joint-level torque commands are NaN or infinity. |
|
virtual |
Starts a new joint velocity motion generator.
control_type | research_interface::robot::Move::ControllerMode control type for the operation |
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
std::invalid_argument | if joint-level torque commands are NaN or infinity. |
|
virtual |
Starts a new torque controller.
ControlException | if an error related to torque control or motion generation occurred. |
InvalidOperationException | if a conflicting operation is already running. |
NetworkException | if the connection is lost, e.g. after a timeout. |
std::invalid_argument | if joint-level torque commands are NaN or infinity. |
void franka::Robot::stop | ( | ) |
Stops all currently running motions.
If a control or motion generator loop is running in another thread, it will be preempted with a franka::ControlException.
CommandException | if the Control reports an error. |
NetworkException | if the connection is lost, e.g. after a timeout. |