moveit2
The MoveIt Motion Planning Framework for ROS 2.
cartesian_limit.cpp
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 
36 
38  : has_max_trans_vel_(false)
39  , max_trans_vel_(0.0)
40  , has_max_trans_acc_(false)
41  , max_trans_acc_(0.0)
42  , has_max_trans_dec_(false)
43  , max_trans_dec_(0.0)
44  , has_max_rot_vel_(false)
45  , max_rot_vel_(0.0)
46 {
47 }
48 
49 // Translational Velocity Limit
50 
52 {
53  return has_max_trans_vel_;
54 }
55 
57 {
58  has_max_trans_vel_ = true;
59  max_trans_vel_ = max_trans_vel;
60 }
61 
63 {
64  return max_trans_vel_;
65 }
66 
67 // Translational Acceleration Limit
68 
70 {
71  return has_max_trans_acc_;
72 }
73 
75 {
76  has_max_trans_acc_ = true;
77  max_trans_acc_ = max_trans_acc;
78 }
79 
81 {
82  return max_trans_acc_;
83 }
84 
85 // Translational Deceleration Limit
86 
88 {
89  return has_max_trans_dec_;
90 }
91 
93 {
94  has_max_trans_dec_ = true;
95  max_trans_dec_ = max_trans_dec;
96 }
97 
99 {
100  return max_trans_dec_;
101 }
102 
103 // Rotational Velocity Limit
104 
106 {
107  return has_max_rot_vel_;
108 }
109 
111 {
112  has_max_rot_vel_ = true;
113  max_rot_vel_ = max_rot_vel;
114 }
115 
117 {
118  return max_rot_vel_;
119 }
double getMaxRotationalVelocity() const
Return the maximal rotational velocity [rad/s], 0 if nothing was set.
void setMaxRotationalVelocity(double max_rot_vel)
Set the maximum rotational velocity.
bool hasMaxRotationalVelocity() const
Check if rotational velocity limit is set.
bool hasMaxTranslationalDeceleration() const
Check if translational deceleration limit is set.
void setMaxTranslationalVelocity(double max_trans_vel)
Set the maximal translational velocity.
double getMaxTranslationalDeceleration() const
Return the maximal translational deceleration [m/s^2], 0 if nothing was set.
void setMaxTranslationalAcceleration(double max_trans_acc)
Set the maximum translational acceleration.
bool hasMaxTranslationalVelocity() const
Check if translational velocity limit is set.
double getMaxTranslationalAcceleration() const
Return the maximal translational acceleration [m/s^2], 0 if nothing was set.
double getMaxTranslationalVelocity() const
Return the maximal translational velocity [m/s], 0 if nothing was set.
bool hasMaxTranslationalAcceleration() const
Check if translational acceleration limit is set.
void setMaxTranslationalDeceleration(double max_trans_dec)
Set the maximum translational deceleration.