moveit2
The MoveIt Motion Planning Framework for ROS 2.
acceleration_filter.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  * All MoveIt 2 headers have been updated to use the .hpp extension.
4  *
5  * .h headers are now autogenerated via create_deprecated_headers.py,
6  * and will import the corresponding .hpp with a deprecation warning.
7  *
8  * imports via .h files may be removed in future releases, so please
9  * modify your imports to use the corresponding .hpp imports.
10  *
11  * See https://github.com/moveit/moveit2/pull/3113 for extra details.
12  *********************************************************************/
13 /*********************************************************************
14  * Software License Agreement (BSD License)
15  *
16  * Copyright (c) 2024, PickNik Inc.
17  * All rights reserved.
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions
21  * are met:
22  *
23  * * Redistributions of source code must retain the above copyright
24  * notice, this list of conditions and the following disclaimer.
25  * * Redistributions in binary form must reproduce the above
26  * copyright notice, this list of conditions and the following
27  * disclaimer in the documentation and/or other materials provided
28  * with the distribution.
29  * * Neither the name of PickNik Inc. nor the names of its
30  * contributors may be used to endorse or promote products derived
31  * from this software without specific prior written permission.
32  *
33  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
36  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
38  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
39  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
43  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44  * POSSIBILITY OF SUCH DAMAGE.
45  *********************************************************************/
46 
47 /* Author: Paul Gesel
48 Description: applies smoothing by limiting the acceleration between consecutive commands.
49 The purpose of the plugin is to prevent the robot's acceleration limits from being violated by instantaneous changes
50 to the servo command topics.
51 
52  In the diagrams below, the c-v lines show the displacement that will occur given the current velocity. The t-c lines
53  shows the displacement between the current position and the desired position. The dashed lines shows the maximum
54  possible displacements that are within the acceleration limits. The v-t lines shows the acceleration commands that
55  will be used by this acceleration-limiting plugin. The x point shows the position that will be used for each scenario.
56 
57 Scenario A: The desired position is within the acceleration limits. The next commanded point will be exactly the
58 desired point.
59  ________
60  | |
61 c --|-----xt |
62  \__|__ v |
63  |________|
64 
65 Scenario B: The line between the current position and the desired position intersects the acceleration limits, but the
66 reference position is not within the bounds. The next commanded point will be the point on the displacement line that
67 is closest to the reference.
68  ________
69  | |
70 c --|--------x------t
71  \__|__ v |
72  |________|
73 
74 Scenario C: Neither the displacement line intersects the acceleration limits nor does the reference point lie within
75 the limits. In this case, the next commanded point will be the one that minimizes the robot's velocity while
76 maintaining its direction.
77  ________
78  | |
79 c --------x--- v |
80  \ | |
81  \ |________|
82  t
83  */
84 
85 #pragma once
86 #pragma message(".h header is obsolete. Please use the .hpp header instead.")