Flexiv RDK APIs  1.6.0
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 {
12 namespace rdk {
13 
15 constexpr size_t kSafetyIOPorts = 8;
16 
22 {
25  std::vector<double> q_min = {};
26 
29  std::vector<double> q_max = {};
30 
33  std::vector<double> dq_max_normal = {};
34 
38  std::vector<double> dq_max_reduced = {};
39 };
40 
46 class Safety
47 {
48 public:
56  Safety(const Robot& robot, const std::string& password);
57  virtual ~Safety();
58 
64 
70 
76  const std::array<bool, kSafetyIOPorts> safety_inputs() const;
77 
94  const std::vector<double>& min_positions, const std::vector<double>& max_positions);
95 
110  void SetJointVelocityNormalLimits(const std::vector<double>& max_velocities);
111 
126  void SetJointVelocityReducedLimits(const std::vector<double>& max_velocities);
127 
128 private:
129  class Impl;
130  std::unique_ptr<Impl> pimpl_;
131 };
132 
133 } /* namespace rdk */
134 } /* namespace flexiv */
135 
136 #endif /* FLEXIV_RDK_SAFETY_HPP_ */
Main interface with the robot, containing several function categories and background services.
Definition: robot.hpp:25
Interface to change robot safety settings. The robot must be in IDLE mode when applying any changes....
Definition: safety.hpp:47
const std::array< bool, kSafetyIOPorts > safety_inputs() const
[Non-blocking] Current reading from all safety input ports.
const SafetyLimits default_limits() const
[Non-blocking] Default values of the safety limits of the connected robot.
void SetJointPositionLimits(const std::vector< double > &min_positions, const std::vector< double > &max_positions)
[Blocking] Set new joint position safety limits to the connected robot, which will honor this setting...
Safety(const Robot &robot, const std::string &password)
[Non-blocking] Create an instance and initialize the interface.
void SetJointVelocityReducedLimits(const std::vector< double > &max_velocities)
[Blocking] Set new joint velocity safety limits to the connected robot, which will honor this setting...
void SetJointVelocityNormalLimits(const std::vector< double > &max_velocities)
[Blocking] Set new joint velocity safety limits to the connected robot, which will honor this setting...
const SafetyLimits current_limits() const
[Non-blocking] Current values of the safety limits of the connected robot.
constexpr size_t kSafetyIOPorts
Definition: safety.hpp:15
Data structure containing configurable robot safety limits.
Definition: safety.hpp:22
std::vector< double > dq_max_normal
Definition: safety.hpp:33
std::vector< double > q_min
Definition: safety.hpp:25
std::vector< double > q_max
Definition: safety.hpp:29
std::vector< double > dq_max_reduced
Definition: safety.hpp:38