ros2_control - rolling
Loading...
Searching...
No Matches
limited_proxy.hpp
1// Copyright (c) 2008, Willow Garage, Inc.
2//
3// Redistribution and use in source and binary forms, with or without
4// modification, are permitted provided that the following conditions are met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8//
9// * Redistributions in binary form must reproduce the above copyright
10// notice, this list of conditions and the following disclaimer in the
11// documentation and/or other materials provided with the distribution.
12//
13// * Neither the name of the Willow Garage nor the names of its
14// contributors may be used to endorse or promote products derived from
15// this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27// POSSIBILITY OF SUCH DAMAGE.
28
29#ifndef CONTROL_TOOLBOX__LIMITED_PROXY_HPP_
30#define CONTROL_TOOLBOX__LIMITED_PROXY_HPP_
31
32namespace control_toolbox
33{
35{
36public:
37 // Controller parameter values
38 double mass_; // Estimate of the joint mass
39 double Kd_; // Damping gain
40 double Kp_; // Position gain
41 double Ki_; // Integral gain
42 double Ficl_; // Integral force clamp
43 double effort_limit_; // Limit on output force
44 double vel_limit_; // Limit on velocity
45 double pos_upper_limit_; // Upper position bound
46 double pos_lower_limit_; // Lower position bound
47 double lambda_proxy_; // Bandwidth of proxy reconvergence
48 double acc_converge_; // Acceleration of proxy reconvergence
49
51 : mass_(0.0),
52 Kd_(0.0),
53 Kp_(0.0),
54 Ki_(0.0),
55 Ficl_(0.0),
56 effort_limit_(0.0),
57 vel_limit_(0.0),
58 pos_upper_limit_(0.0),
59 pos_lower_limit_(0.0),
60 lambda_proxy_(0.0),
61 acc_converge_(0.0)
62 {
63 }
64
65 void reset(double pos_act, double vel_act);
66
67 double update(
68 double pos_des, double vel_des, double acc_des, double pos_act, double vel_act, double dt);
69
70private:
71 // Controller state values
72 double last_proxy_pos_; // Proxy position
73 double last_proxy_vel_; // Proxy velocity
74 double last_proxy_acc_; // Proxy acceleration
75
76 double last_vel_error_; // Velocity error
77 double last_pos_error_; // Position error
78 double last_int_error_; // Integral error
79};
80
81} // namespace control_toolbox
82
83#endif // CONTROL_TOOLBOX__LIMITED_PROXY_HPP_
Definition limited_proxy.hpp:35
Definition dither.hpp:42