simple_trapezoidal_velocity_profile.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2018 ROBOTIS CO., LTD.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *******************************************************************************/
16 
17 /*
18  * simple_trapezoidal_velocity_profile.h
19  *
20  * Created on: 2016. 8. 24.
21  * Author: Jay Song
22  */
23 
24 #ifndef ROBOTIS_MATH_TRAPEZOIDAL_VELOCITY_PROFILE_H_
25 #define ROBOTIS_MATH_TRAPEZOIDAL_VELOCITY_PROFILE_H_
26 
27 #define EIGEN_NO_DEBUG
28 #define EIGEN_NO_STATIC_ASSERT
29 
30 #include "robotis_linear_algebra.h"
31 #include "robotis_math_base.h"
32 
33 namespace robotis_framework
34 {
36 {
37 public:
40 
41  void setVelocityBaseTrajectory(double init_pos, double final_pos, double acceleration, double max_velocity);
42  void setVelocityBaseTrajectory(double init_pos, double final_pos, double acceleration, double deceleration, double max_velocity);
43  void setTimeBaseTrajectory(double init_pos, double final_pos, double accel_time, double total_time);
44  void setTimeBaseTrajectory(double init_pos, double final_pos, double accel_time, double decel_time, double total_time);
45 
46  double getPosition(double time);
47  double getVelocity(double time);
48  double getAcceleration(double time);
49 
50  void setTime(double time);
51  double getPosition();
52  double getVelocity();
53  double getAcceleration();
54 
55  double getTotalTime();
58 
59 private:
60  Eigen::MatrixXd pos_coeff_accel_section_;
61  Eigen::MatrixXd vel_coeff_accel_section_;
62 
63  Eigen::MatrixXd pos_coeff_const_section_;
64  Eigen::MatrixXd vel_coeff_const_section_;
65 
66  Eigen::MatrixXd pos_coeff_decel_section_;
67  Eigen::MatrixXd vel_coeff_decel_section_;
68 
69  Eigen::MatrixXd time_variables_;
70 
71  double acceleration_;
72  double deceleration_;
73  double max_velocity_;
74 
75  double initial_pos_;
76 
77  double current_time_;
78  double current_pos_;
79  double current_vel_;
80  double current_acc_;
81 
82  double final_pos_;
83 
84  double accel_time_;
85  double const_time_;
86  double decel_time_;
87 
90  double total_time_;
91 };
92 
93 }
94 
95 #endif /* ROBOTIS_MATH_TRAPEZOIDAL_VELOCITY_PROFILE_H_ */
void setTimeBaseTrajectory(double init_pos, double final_pos, double accel_time, double total_time)
void setVelocityBaseTrajectory(double init_pos, double final_pos, double acceleration, double max_velocity)


robotis_math
Author(s): SCH , Kayman , Jay Song
autogenerated on Fri Jul 17 2020 03:17:50