moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
joint_limits_validator.h
Go to the documentation of this file.
1/*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2018 Pilz GmbH & Co. KG
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of Pilz GmbH & Co. KG nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34
35#pragma once
36
39
41{
46{
47public:
56
65
73 static bool
75
83 static bool
85
86private:
87 static bool validateWithEqualFunc(bool (*eq_func)(const JointLimit&, const JointLimit&),
89
90 static bool positionEqual(const JointLimit& lhs, const JointLimit& rhs);
91
92 static bool velocityEqual(const JointLimit& lhs, const JointLimit& rhs);
93
94 static bool accelerationEqual(const JointLimit& lhs, const JointLimit& rhs);
95
96 static bool decelerationEqual(const JointLimit& lhs, const JointLimit& rhs);
97};
98
104class ValidationException : public std::runtime_error
105{
106public:
107 ValidationException(const std::string& error_desc) : std::runtime_error(error_desc)
108 {
109 }
110};
111
119{
120public:
121 ValidationJointMissingException(const std::string& error_desc) : ValidationException(error_desc)
122 {
123 }
124};
125
132{
133public:
134 ValidationDifferentLimitsException(const std::string& error_desc) : ValidationException(error_desc)
135 {
136 }
137};
138
146{
147public:
148 ValidationBoundsViolationException(const std::string& error_desc) : ValidationException(error_desc)
149 {
150 }
151};
152
153} // namespace pilz_industrial_motion_planner
Container for JointLimits, essentially a map with convenience functions. Adds the ability to as for l...
Validates the equality of all limits inside a container.
static bool validateAllPositionLimitsEqual(const pilz_industrial_motion_planner::JointLimitsContainer &joint_limits)
Validates that the position limits of all limits are equal.
static bool validateAllDecelerationLimitsEqual(const pilz_industrial_motion_planner::JointLimitsContainer &joint_limits)
Validates that the deceleration of all limits is equal.
static bool validateAllVelocityLimitsEqual(const pilz_industrial_motion_planner::JointLimitsContainer &joint_limits)
Validates that the velocity of all limits is equal.
static bool validateAllAccelerationLimitsEqual(const pilz_industrial_motion_planner::JointLimitsContainer &joint_limits)
Validates that the acceleration of all limits is equal.
Thrown when the limits from the param server are weaker than the ones obtained from the urdf.
A base class for all validations exceptions inheriting from std::runtime_exception.
Thrown the limits for a joint are defined in the urdf but not in the node parameters (loaded from yam...
Extends joint_limits_interface::JointLimits with a deceleration parameter.