joint_limits_validator.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Pilz GmbH & Co. KG
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13 
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef JOINT_LIMITS_VALIDATOR_H
19 #define JOINT_LIMITS_VALIDATOR_H
20 
23 
24 namespace pilz {
25 
30  public:
37  static bool validateAllPositionLimitsEqual(const pilz::JointLimitsContainer& joint_limits);
38 
45  static bool validateAllVelocityLimitsEqual(const pilz::JointLimitsContainer& joint_limits);
46 
53  static bool validateAllAccelerationLimitsEqual(const pilz::JointLimitsContainer& joint_limits);
54 
61  static bool validateAllDecelerationLimitsEqual(const pilz::JointLimitsContainer& joint_limits);
62 
63  private:
64  static bool validateWithEqualFunc(bool (*eq_func)(const pilz_extensions::JointLimit&,
66  const pilz::JointLimitsContainer& joint_limits);
67 
68  static bool positionEqual(const pilz_extensions::JointLimit& lhs, const pilz_extensions::JointLimit& rhs);
69 
70  static bool velocityEqual(const pilz_extensions::JointLimit& lhs, const pilz_extensions::JointLimit& rhs);
71 
73 
75 
76 };
77 
82 class ValidationException: public std::runtime_error
83 {
84  public:
85  ValidationException(const std::string error_desc) : std::runtime_error(error_desc) {}
86 };
87 
94 {
95  public:
96  ValidationJointMissingException(const std::string error_desc) : ValidationException(error_desc) {}
97 };
98 
99 
106 {
107  public:
108  ValidationDifferentLimitsException(const std::string error_desc) : ValidationException(error_desc) {}
109 };
110 
117 {
118  public:
119  ValidationBoundsViolationException(const std::string error_desc) : ValidationException(error_desc) {}
120 };
121 
122 }
123 
124 #endif // JOINT_LIMITS_VALIDATOR_H
static bool validateWithEqualFunc(bool(*eq_func)(const pilz_extensions::JointLimit &, const pilz_extensions::JointLimit &), const pilz::JointLimitsContainer &joint_limits)
static bool validateAllAccelerationLimitsEqual(const pilz::JointLimitsContainer &joint_limits)
Validates that the acceleration of all limits is equal.
static bool validateAllVelocityLimitsEqual(const pilz::JointLimitsContainer &joint_limits)
Validates that the velocity of all limits is equal.
static bool validateAllDecelerationLimitsEqual(const pilz::JointLimitsContainer &joint_limits)
Validates that the deceleration of all limits is equal.
Thrown the limits for a joint are defined in the urdf but not on the parameter server (loaded from ya...
A base class for all validations exceptions inheriting from std::runtime_exception.
static bool velocityEqual(const pilz_extensions::JointLimit &lhs, const pilz_extensions::JointLimit &rhs)
ValidationJointMissingException(const std::string error_desc)
Container for JointLimits, essentially a map with convenience functions. Adds the ability to as for l...
Thrown when the limits from the param server are weaker than the ones obtained from the urdf...
Validates the equality of all limits inside a container.
static bool validateAllPositionLimitsEqual(const pilz::JointLimitsContainer &joint_limits)
Validates that the position limits of all limits are equal.
static bool positionEqual(const pilz_extensions::JointLimit &lhs, const pilz_extensions::JointLimit &rhs)
ValidationBoundsViolationException(const std::string error_desc)
ValidationDifferentLimitsException(const std::string error_desc)
static bool accelerationEqual(const pilz_extensions::JointLimit &lhs, const pilz_extensions::JointLimit &rhs)
ValidationException(const std::string error_desc)
static bool decelerationEqual(const pilz_extensions::JointLimit &lhs, const pilz_extensions::JointLimit &rhs)


pilz_trajectory_generation
Author(s):
autogenerated on Mon Apr 6 2020 03:17:33