Flexiv RDK APIs  2.1
safety.hpp
Go to the documentation of this file.
1 
6 #ifndef FLEXIV_RDK_SAFETY_HPP_
7 #define FLEXIV_RDK_SAFETY_HPP_
8 
9 #include "robot.hpp"
10 
11 namespace flexiv::rdk {
12 
14 constexpr size_t kSafetyIOPorts = 8;
15 
21 {
24  std::map<JointGroup, std::vector<double>> q_min = {};
25 
28  std::map<JointGroup, std::vector<double>> q_max = {};
29 
32  std::map<JointGroup, std::vector<double>> dq_max_normal = {};
33 
37  std::map<JointGroup, std::vector<double>> dq_max_reduced = {};
38 };
39 
47 class Safety
48 {
49 public:
57  Safety(const Robot& robot, const std::string& password);
58  virtual ~Safety();
59 
65 
71 
77  std::array<bool, kSafetyIOPorts> safety_inputs() const;
78 
99  void SetJointPositionLimits(JointGroup group, const std::vector<double>& min_positions,
100  const std::vector<double>& max_positions);
101 
119  void SetJointVelocityNormalLimits(JointGroup group, const std::vector<double>& max_velocities);
120 
138  void SetJointVelocityReducedLimits(JointGroup group, const std::vector<double>& max_velocities);
139 
159  double limiting_factor = 1.3, unsigned int error_threshold = 50);
160 
161 private:
162  class Impl;
163  std::unique_ptr<Impl> pimpl_;
164 };
165 
166 } /* namespace flexiv::rdk */
167 
168 #endif /* FLEXIV_RDK_SAFETY_HPP_ */
Main interface to control the robot, containing several function categories and background services.
Definition: robot.hpp:24
Interface to manage safety settings of the robot. A password is required to authenticate this interfa...
Definition: safety.hpp:48
void SetJointVelocityReducedLimits(JointGroup group, const std::vector< double > &max_velocities)
[Blocking] Set safety limits on the joint velocities of the manipulator, which will honor this settin...
Safety(const Robot &robot, const std::string &password)
[Non-blocking] Instantiate the safety settings interface.
void SetJointOutputTorqueRegulator(double limiting_factor=1.3, unsigned int error_threshold=50)
[Blocking] Change settings of the regulator on the joint output torques of the manipulator and extern...
SafetyLimits current_limits() const
[Non-blocking] Current values of the safety limits of the connected robot.
SafetyLimits default_limits() const
[Non-blocking] Default values of the safety limits of the connected robot.
void SetJointPositionLimits(JointGroup group, const std::vector< double > &min_positions, const std::vector< double > &max_positions)
[Blocking] Set safety limits on the joint positions of the manipulator, which will honor this setting...
void SetJointVelocityNormalLimits(JointGroup group, const std::vector< double > &max_velocities)
[Blocking] Set safety limits on the joint velocities of the manipulator, which will honor this settin...
std::array< bool, kSafetyIOPorts > safety_inputs() const
[Non-blocking] Current reading from all safety input ports.
JointGroup
All possible joint groups of the robot.
Definition: data.hpp:58
constexpr size_t kSafetyIOPorts
Definition: safety.hpp:14
Data structure containing configurable robot safety limits.
Definition: safety.hpp:21
std::map< JointGroup, std::vector< double > > q_min
Definition: safety.hpp:24
std::map< JointGroup, std::vector< double > > dq_max_normal
Definition: safety.hpp:32
std::map< JointGroup, std::vector< double > > q_max
Definition: safety.hpp:28
std::map< JointGroup, std::vector< double > > dq_max_reduced
Definition: safety.hpp:37