7 #include <franka/control_types.h>
8 #include <franka/duration.h>
9 #include <franka/exception.h>
10 #include <franka/model.h>
11 #include <franka/robot.h>
12 #include <franka/robot_state.h>
14 #include <affx/affine.hpp>
28 using namespace movex;
31 class Robot:
public franka::Robot {
34 {{{0.0, 0.333, 0.0}, {-M_PI/2, 0.0, 0.0}, {M_PI/2, 0.316, 0.0}, {M_PI/2, 0.0, 0.0825}, {-M_PI/2, 0.384, -0.0825}, {M_PI/2, 0.0, 0.0}, {M_PI/2, 0.0, 0.088}}},
35 Affine(0, 0, 0.107, M_PI/4, 0, M_PI)
43 static constexpr
double max_translation_velocity {1.7};
44 static constexpr
double max_rotation_velocity {2.5};
45 static constexpr
double max_elbow_velocity {2.175};
46 static constexpr
double max_translation_acceleration {13.0};
47 static constexpr
double max_rotation_acceleration {25.0};
48 static constexpr
double max_elbow_acceleration {10.0};
49 static constexpr
double max_translation_jerk {6500.0};
50 static constexpr
double max_rotation_jerk {12500.0};
51 static constexpr
double max_elbow_jerk {5000.0};
54 static constexpr std::array<double, 7> max_joint_velocity {{2.175, 2.175, 2.175, 2.175, 2.610, 2.610, 2.610}};
55 static constexpr std::array<double, 7> max_joint_acceleration {{15.0, 7.5, 10.0, 12.5, 15.0, 20.0, 20.0}};
56 static constexpr std::array<double, 7> max_joint_jerk {{7500.0, 3750.0, 5000.0, 6250.0, 7500.0, 10000.0, 10000.0}};
58 static constexpr
size_t degrees_of_freedoms {7};
59 static constexpr
double control_rate {0.001};
61 double velocity_rel {1.0}, acceleration_rel {1.0}, jerk_rel {1.0};
63 franka::ControllerMode controller_mode {franka::ControllerMode::kJointImpedance};
66 bool repeat_on_error {
true};
69 bool stop_at_python_signal {
true};
72 explicit Robot(std::string fci_ip,
double dynamic_rel = 1.0,
bool repeat_on_error =
true,
bool stop_at_python_signal =
true);
74 void setDefaultBehavior();
75 void setDynamicRel(
double dynamic_rel);
78 bool recoverFromErrors();
81 std::array<double, 7> currentJointPositions();
82 Affine forwardKinematics(
const std::array<double, 7>& q);
83 std::array<double, 7> inverseKinematics(
const Affine& target,
const std::array<double, 7>& q0);
85 ::franka::RobotState get_state();