13#include <franka/robot_model_base.h>
15#include <research_interface/robot/service_types.h>
16#include <franka/commands/get_robot_model_command.hpp>
26class ActiveControlBase;
87 explicit Robot(
const std::string& franka_address,
89 size_t log_size = 50);
176 bool limit_rate = false,
177 double cutoff_frequency = kDefaultCutoffFrequency);
206 bool limit_rate = false,
207 double cutoff_frequency = kDefaultCutoffFrequency);
236 bool limit_rate = false,
237 double cutoff_frequency = kDefaultCutoffFrequency);
266 bool limit_rate = false,
267 double cutoff_frequency = kDefaultCutoffFrequency);
295 motion_generator_callback,
296 bool limit_rate = false,
297 double cutoff_frequency = kDefaultCutoffFrequency);
324 bool limit_rate = false,
325 double cutoff_frequency = kDefaultCutoffFrequency);
352 bool limit_rate = false,
353 double cutoff_frequency = kDefaultCutoffFrequency);
380 bool limit_rate = false,
381 double cutoff_frequency = kDefaultCutoffFrequency);
406 motion_generator_callback,
408 bool limit_rate = false,
409 double cutoff_frequency = kDefaultCutoffFrequency);
504 const std::array<
double, 7>& upper_torque_thresholds_acceleration,
505 const std::array<
double, 7>& lower_torque_thresholds_nominal,
506 const std::array<
double, 7>& upper_torque_thresholds_nominal,
507 const std::array<
double, 6>& lower_force_thresholds_acceleration,
508 const std::array<
double, 6>& upper_force_thresholds_acceleration,
509 const std::array<
double, 6>& lower_force_thresholds_nominal,
510 const std::array<
double, 6>& upper_force_thresholds_nominal);
539 const std::array<
double, 7>& upper_torque_thresholds,
540 const std::array<
double, 6>& lower_force_thresholds,
541 const std::array<
double, 6>& upper_force_thresholds);
555 const std::array<
double, 7>& K_theta);
572 const std::array<
double, 6>& K_x);
602 void setK(const std::array<
double, 16>& EE_T_K);
619 void setEE(const std::array<
double, 16>& NE_T_EE);
638 const std::array<
double, 3>& F_x_Cload,
639 const std::array<
double, 9>& load_inertia);
678 const research_interface::robot::Move::
ControllerMode& control_type);
693 const research_interface::robot::Move::
ControllerMode& control_type);
708 const research_interface::robot::Move::
ControllerMode& control_type);
724 const research_interface::robot::Move::
ControllerMode& control_type);
774 Robot(std::shared_ptr<Impl> robot_impl);
796 template <typename T>
798 const research_interface::robot::Move::
ControllerMode& controller_type);
800 std::shared_ptr<Impl> impl_;
801 std::mutex control_mutex_;
Robot dynamic parameters computed from the URDF model with Pinocchio.
Definition robot_model_base.h:10
Allows the user to read the state of a Robot and to send new control commands after starting a contro...
Definition active_control_base.h:27
Stores values for Cartesian pose motion generation.
Definition control_types.h:127
Stores values for Cartesian velocity motion generation.
Definition control_types.h:211
Represents a duration with millisecond resolution.
Definition duration.h:19
Stores values for joint position motion generation.
Definition control_types.h:72
Stores values for joint velocity motion generation.
Definition control_types.h:99
Calculates poses of joints and dynamic properties of the robot.
Definition model.h:52
Maintains a network connection to the robot, provides the current robot state, gives access to the mo...
Definition robot.h:68
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 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.
Model loadModel()
Loads the model library from the robot.
Robot & operator=(Robot &&other) noexcept
Move-assigns this Robot from another Robot instance.
Robot(Robot &&other) noexcept
Move-constructs a new Robot instance.
ServerVersion serverVersion() const noexcept
Returns the software version reported by the connected server.
virtual std::unique_ptr< ActiveControlBase > startJointPositionControl(const research_interface::robot::Move::ControllerMode &control_type)
Starts a new joint position motion generator.
auto getRobotModel() -> std::string
void stop()
Stops all currently running motions.
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 read(std::function< bool(const RobotState &)> read_callback)
Starts a loop for reading the current robot state.
virtual std::unique_ptr< ActiveControlBase > startCartesianVelocityControl(const research_interface::robot::Move::ControllerMode &control_type)
Starts a new cartesian velocity motion generator.
virtual std::unique_ptr< ActiveControlBase > startTorqueControl()
Starts a new torque controller.
void setJointImpedance(const std::array< double, 7 > &K_theta)
Sets the impedance for each joint in the internal controller.
virtual std::unique_ptr< ActiveControlBase > startCartesianPoseControl(const research_interface::robot::Move::ControllerMode &control_type)
Starts a new cartesian position motion generator.
virtual ~Robot() noexcept
Closes the connection.
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 setK(const std::array< double, 16 > &EE_T_K)
Sets the transformation from end effector frame to stiffness frame.
uint16_t ServerVersion
Version of the robot server.
Definition robot.h:73
virtual std::unique_ptr< ActiveControlBase > startJointVelocityControl(const research_interface::robot::Move::ControllerMode &control_type)
Starts a new joint velocity motion generator.
virtual RobotState readOnce()
Waits for a robot state update and returns it.
Robot(const std::string &franka_address, RealtimeConfig realtime_config=RealtimeConfig::kEnforce, size_t log_size=50)
Establishes a connection with the robot.
void setEE(const std::array< double, 16 > &NE_T_EE)
Sets the transformation from nominal end effector to end effector frame.
void automaticErrorRecovery()
Runs automatic error recovery on the robot.
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.
Stores joint-level torque commands without gravity and friction.
Definition control_types.h:45
Contains helper types for returning motion generation and joint-level torque commands.
ControllerMode
Available controller modes for a franka::Robot.
Definition control_types.h:19
RealtimeConfig
Used to decide whether to enforce realtime mode for a control loop thread.
Definition control_types.h:26
Contains the franka::Duration type.
Contains functions for filtering signals with a low-pass filter.
Contains the franka::RobotState types.
Describes the robot state.
Definition robot_state.h:34