libfranka 0.19.0
FCI C++ API
Loading...
Searching...
No Matches
errors.h
Go to the documentation of this file.
1// Copyright (c) 2023 Franka Robotics GmbH
2// Use of this source code is governed by the Apache-2.0 license, see LICENSE
3#pragma once
4
5#include <array>
6#include <ostream>
7
13namespace franka {
14
18struct Errors {
19 private:
20 std::array<bool, 41> errors_{};
21
22 public:
27
33 Errors(const Errors& other);
34
43
49 Errors(const std::array<bool, 41>& errors);
50
56 explicit operator bool() const noexcept;
57
65 explicit operator std::string() const;
66
70 const bool&
71 joint_position_limits_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
75 const bool&
76 cartesian_position_limits_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
80 const bool&
81 self_collision_avoidance_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
85 const bool&
86 joint_velocity_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
90 const bool&
91 cartesian_velocity_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
95 const bool&
96 force_control_safety_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
101 const bool& joint_reflex; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
106 const bool& cartesian_reflex; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
110 const bool&
111 max_goal_pose_deviation_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
115 const bool&
116 max_path_pose_deviation_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
120 const bool&
121 cartesian_velocity_profile_safety_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
126 const bool&
127 joint_position_motion_generator_start_pose_invalid; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
131 const bool&
132 joint_motion_generator_position_limits_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
136 const bool&
137 joint_motion_generator_velocity_limits_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
142 const bool&
143 joint_motion_generator_velocity_discontinuity; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
148 const bool&
149 joint_motion_generator_acceleration_discontinuity; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
154 const bool&
155 cartesian_position_motion_generator_start_pose_invalid; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
159 const bool&
160 cartesian_motion_generator_elbow_limit_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
164 const bool&
165 cartesian_motion_generator_velocity_limits_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
170 const bool&
171 cartesian_motion_generator_velocity_discontinuity; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
176 const bool&
177 cartesian_motion_generator_acceleration_discontinuity; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
181 const bool&
182 cartesian_motion_generator_elbow_sign_inconsistent; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
186 const bool&
187 cartesian_motion_generator_start_elbow_invalid; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
191 const bool&
192 cartesian_motion_generator_joint_position_limits_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
196 const bool&
197 cartesian_motion_generator_joint_velocity_limits_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
202 const bool&
203 cartesian_motion_generator_joint_velocity_discontinuity; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
208 const bool&
209 cartesian_motion_generator_joint_acceleration_discontinuity; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
213 const bool&
214 cartesian_position_motion_generator_invalid_frame; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
218 const bool&
219 force_controller_desired_force_tolerance_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
223 const bool&
224 controller_torque_discontinuity; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
230 const bool&
231 start_elbow_sign_inconsistent; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
235 const bool&
236 communication_constraints_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
240 const bool& power_limit_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
246 const bool&
247 joint_p2p_insufficient_torque_for_planning; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
251 const bool& tau_j_range_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
255 const bool& instability_detected; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
260 const bool&
261 joint_move_in_wrong_direction; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
265 const bool&
266 cartesian_spline_motion_generator_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
270 const bool&
271 joint_via_motion_generator_planning_joint_limit_violation; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
275 const bool&
276 base_acceleration_initialization_timeout; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
280 const bool&
281 base_acceleration_invalid_reading; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
282};
283
292std::ostream& operator<<(std::ostream& ostream, const Errors& errors);
293
294} // namespace franka
Enumerates errors that can occur while controlling a franka::Robot.
Definition errors.h:18
const bool & cartesian_motion_generator_acceleration_discontinuity
True if commanded acceleration in Cartesian motion generators is discontinuous (target values are too...
Definition errors.h:177
const bool & tau_j_range_violation
True if the measured torque signal is out of the safe range.
Definition errors.h:251
const bool & cartesian_motion_generator_velocity_discontinuity
True if commanded velocity in Cartesian motion generators is discontinuous (target values are too far...
Definition errors.h:171
const bool & joint_p2p_insufficient_torque_for_planning
True if the robot is overloaded for the required motion.
Definition errors.h:247
const bool & cartesian_motion_generator_joint_velocity_discontinuity
True if the joint velocity in Cartesian motion generators is discontinuous after IK calculation.
Definition errors.h:203
const bool & cartesian_motion_generator_joint_acceleration_discontinuity
True if the joint acceleration in Cartesian motion generators is discontinuous after IK calculation.
Definition errors.h:209
const bool & cartesian_velocity_violation
True if the robot exceeded Cartesian velocity limits.
Definition errors.h:91
const bool & cartesian_position_limits_violation
True if the robot moved past any of the virtual walls.
Definition errors.h:76
const bool & cartesian_motion_generator_joint_velocity_limits_violation
True if the joint velocity limits would be exceeded after IK calculation.
Definition errors.h:197
const bool & joint_position_limits_violation
True if the robot moved past the joint limits.
Definition errors.h:71
Errors(const Errors &other)
Copy constructs a new Errors instance.
const bool & cartesian_reflex
True if a collision was detected, i.e. the robot exceeded a torque threshold in a Cartesian motion.
Definition errors.h:106
const bool & communication_constraints_violation
True if minimum network communication quality could not be held during a motion.
Definition errors.h:236
const bool & base_acceleration_initialization_timeout
True if the gravity vector could not be initialized by measureing the base acceleration.
Definition errors.h:276
const bool & cartesian_spline_motion_generator_violation
True if the generated motion violates a joint limit.
Definition errors.h:266
const bool & cartesian_motion_generator_elbow_sign_inconsistent
True if commanded elbow values in Cartesian motion generators are inconsistent.
Definition errors.h:182
const bool & joint_motion_generator_acceleration_discontinuity
True if commanded acceleration in joint motion generators is discontinuous (target values are too far...
Definition errors.h:149
const bool & power_limit_violation
True if commanded values would result in exceeding the power limit.
Definition errors.h:240
Errors & operator=(Errors other)
Assigns this Errors instance from another Errors value.
const bool & cartesian_motion_generator_start_elbow_invalid
True if the first elbow value in Cartesian motion generators is too far from initial one.
Definition errors.h:187
const bool & cartesian_motion_generator_joint_position_limits_violation
True if the joint position limits would be exceeded after IK calculation.
Definition errors.h:192
const bool & joint_position_motion_generator_start_pose_invalid
True if an external joint position motion generator was started with a pose too far from the current ...
Definition errors.h:127
const bool & joint_move_in_wrong_direction
True if the robot is in joint position limits violation error and the user guides the robot further t...
Definition errors.h:261
const bool & joint_velocity_violation
True if the robot exceeded joint velocity limits.
Definition errors.h:86
const bool & base_acceleration_invalid_reading
True if the base acceleration O_ddP_O cannot be determined.
Definition errors.h:281
const bool & cartesian_motion_generator_velocity_limits_violation
True if an external Cartesian motion generator would move with too high velocity.
Definition errors.h:165
const bool & joint_motion_generator_position_limits_violation
True if an external joint motion generator would move into a joint limit.
Definition errors.h:132
const bool & cartesian_position_motion_generator_invalid_frame
True if the Cartesian pose is not a valid transformation matrix.
Definition errors.h:214
const bool & start_elbow_sign_inconsistent
True if the start elbow sign was inconsistent.
Definition errors.h:231
const bool & cartesian_position_motion_generator_start_pose_invalid
True if an external Cartesian position motion generator was started with a pose too far from the curr...
Definition errors.h:155
const bool & joint_motion_generator_velocity_discontinuity
True if commanded velocity in joint motion generators is discontinuous (target values are too far apa...
Definition errors.h:143
const bool & cartesian_motion_generator_elbow_limit_violation
True if an external Cartesian motion generator would move into an elbow limit.
Definition errors.h:160
const bool & max_goal_pose_deviation_violation
True if internal motion generator did not reach the goal pose.
Definition errors.h:111
const bool & max_path_pose_deviation_violation
True if internal motion generator deviated from the path.
Definition errors.h:116
const bool & self_collision_avoidance_violation
True if the robot would have collided with itself.
Definition errors.h:81
Errors(const std::array< bool, 41 > &errors)
Creates a new Errors instance from the given array.
const bool & joint_motion_generator_velocity_limits_violation
True if an external joint motion generator exceeded velocity limits.
Definition errors.h:137
const bool & force_controller_desired_force_tolerance_violation
True if desired force exceeds the safety thresholds.
Definition errors.h:219
const bool & force_control_safety_violation
True if the robot exceeded safety threshold during force control.
Definition errors.h:96
const bool & instability_detected
True if an instability is detected.
Definition errors.h:255
Errors()
Creates an empty Errors instance.
const bool & joint_via_motion_generator_planning_joint_limit_violation
True if the generated motion violates a joint limit.
Definition errors.h:271
const bool & controller_torque_discontinuity
True if the torque set by the external controller is discontinuous.
Definition errors.h:224
const bool & joint_reflex
True if a collision was detected, i.e. the robot exceeded a torque threshold in a joint motion.
Definition errors.h:101
const bool & cartesian_velocity_profile_safety_violation
True if Cartesian velocity profile for internal motions was exceeded.
Definition errors.h:121