34 #ifndef _vpRobotFranka_h_
35 #define _vpRobotFranka_h_
37 #include <visp3/core/vpConfig.h>
39 #if defined(VISP_HAVE_FRANKA) && defined(VISP_HAVE_THREADS)
48 #include <franka/exception.h>
49 #include <franka/gripper.h>
50 #include <franka/model.h>
51 #include <franka/robot.h>
53 #include <visp3/core/vpColVector.h>
54 #include <visp3/core/vpException.h>
55 #include <visp3/robot/vpRobot.h>
236 franka::Robot *m_handler;
237 franka::Gripper *m_gripper;
238 franka::Model *m_model;
239 double m_positioningVelocity;
242 std::thread m_velControlThread;
243 std::atomic_bool m_velControlThreadIsRunning;
244 std::atomic_bool m_velControlThreadStopAsked;
245 std::array<double, 7> m_dq_des;
249 std::thread m_ftControlThread;
250 std::atomic_bool m_ftControlThreadIsRunning;
251 std::atomic_bool m_ftControlThreadStopAsked;
252 std::array<double, 7> m_tau_J_des;
255 std::array<double, 7> m_q_min;
256 std::array<double, 7> m_q_max;
257 std::array<double, 7> m_dq_max;
258 std::array<double, 7> m_ddq_max;
260 franka::RobotState m_robot_state;
264 std::string m_log_folder;
265 std::string m_franka_address;
271 franka::RealtimeConfig realtime_config = franka::RealtimeConfig::kEnforce);
275 void connect(
const std::string &franka_address,
276 franka::RealtimeConfig realtime_config = franka::RealtimeConfig::kEnforce);
292 franka::RobotState getRobotInternalState();
333 int gripperGrasp(
double grasping_width,
double force = 60.);
334 int gripperGrasp(
double grasping_width,
double speed,
double force);
335 void gripperHoming();
336 int gripperMove(
double width);
338 void gripperRelease();
340 void move(
const std::string &filename,
double velocity_percentage = 10.);
342 bool readPosFile(
const std::string &filename,
vpColVector &q);
343 bool savePosFile(
const std::string &filename,
const vpColVector &q);
347 const bool &activate_pi_controller =
false);
348 void setLogFolder(
const std::string &folder);
350 void setPositioningVelocity(
double velocity);
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of a matrix and operations on matrices.
Implementation of a pose vector and operations on poses.
franka::Robot * getHandler()
franka::Gripper * getGripperHandler()
Class that defines a generic virtual robot.
virtual void get_eJe(vpMatrix &_eJe)=0
Get the robot Jacobian expressed in the end-effector frame.
virtual void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)=0
virtual void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)=0
Get the robot position (frame has to be specified).
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
virtual void get_fJe(vpMatrix &_fJe)=0
virtual void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &q)=0
virtual void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)=0
Set a displacement (frame has to be specified) in position control.