op3_kinematics_dynamics.h
Go to the documentation of this file.
1 /*******************************************************************************
2 * Copyright 2017 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 /* Authors: SCH, Jay Song, Kayman */
18 
19 #ifndef OP3_KINEMATICS_DYNAMICS_H_
20 #define OP3_KINEMATICS_DYNAMICS_H_
21 
22 #include <vector>
23 #include <eigen3/Eigen/Eigen>
24 
26 #include "link_data.h"
27 
28 namespace robotis_op
29 {
30 
32 {
36 };
37 
39 {
40 
41  public:
45 
46  std::vector<int> findRoute(int to);
47  std::vector<int> findRoute(int from, int to);
48 
49  double calcTotalMass(int joint_id);
50  Eigen::MatrixXd calcMC(int joint_id);
51  Eigen::MatrixXd calcCOM(Eigen::MatrixXd mc);
52 
53  void calcForwardKinematics(int joint_ID);
54 
55  Eigen::MatrixXd calcJacobian(std::vector<int> idx);
56  Eigen::MatrixXd calcJacobianCOM(std::vector<int> idx);
57  Eigen::MatrixXd calcVWerr(Eigen::MatrixXd tar_position, Eigen::MatrixXd curr_position,
58  Eigen::MatrixXd tar_orientation, Eigen::MatrixXd curr_orientation);
59 
60  bool calcInverseKinematics(int to, Eigen::MatrixXd tar_position, Eigen::MatrixXd tar_orientation, int max_iter,
61  double ik_err);
62  bool calcInverseKinematics(int from, int to, Eigen::MatrixXd tar_position, Eigen::MatrixXd tar_orientation,
63  int max_iter, double ik_err);
64 
65  // with weight
66  bool calcInverseKinematics(int to, Eigen::MatrixXd tar_position, Eigen::MatrixXd tar_orientation, int max_iter,
67  double ik_err, Eigen::MatrixXd weight);
68  bool calcInverseKinematics(int from, int to, Eigen::MatrixXd tar_position, Eigen::MatrixXd tar_orientation,
69  int max_iter, double ik_err, Eigen::MatrixXd weight);
70 
71  bool calcInverseKinematicsForLeg(double *out, double x, double y, double z, double roll, double pitch, double yaw);
72  bool calcInverseKinematicsForRightLeg(double *out, double x, double y, double z, double roll, double pitch,
73  double yaw);
74  bool calcInverseKinematicsForLeftLeg(double *out, double x, double y, double z, double roll, double pitch,
75  double yaw);
76 
78 
79  LinkData *getLinkData(const std::string link_name);
80  LinkData *getLinkData(const int link_id);
81  Eigen::MatrixXd getJointAxis(const std::string link_name);
82  double getJointDirection(const std::string link_name);
83  double getJointDirection(const int link_id);
84 
85  Eigen::MatrixXd calcPreviewParam(double preview_time, double control_cycle,
86  double lipm_height,
87  Eigen::MatrixXd K, Eigen::MatrixXd P);
88 
93 };
94 
95 }
96 
97 #endif /* OP3_KINEMATICS_DYNAMICS_H_ */
Eigen::MatrixXd calcJacobianCOM(std::vector< int > idx)
LinkData * op3_link_data_[ALL_JOINT_ID+1]
Eigen::MatrixXd calcJacobian(std::vector< int > idx)
bool calcInverseKinematicsForLeg(double *out, double x, double y, double z, double roll, double pitch, double yaw)
double getJointDirection(const std::string link_name)
Eigen::MatrixXd getJointAxis(const std::string link_name)
Eigen::MatrixXd calcPreviewParam(double preview_time, double control_cycle, double lipm_height, Eigen::MatrixXd K, Eigen::MatrixXd P)
Eigen::MatrixXd calcMC(int joint_id)
bool calcInverseKinematics(int to, Eigen::MatrixXd tar_position, Eigen::MatrixXd tar_orientation, int max_iter, double ik_err)
Eigen::MatrixXd calcCOM(Eigen::MatrixXd mc)
LinkData * getLinkData(const std::string link_name)
bool calcInverseKinematicsForRightLeg(double *out, double x, double y, double z, double roll, double pitch, double yaw)
bool calcInverseKinematicsForLeftLeg(double *out, double x, double y, double z, double roll, double pitch, double yaw)
Eigen::MatrixXd calcVWerr(Eigen::MatrixXd tar_position, Eigen::MatrixXd curr_position, Eigen::MatrixXd tar_orientation, Eigen::MatrixXd curr_orientation)
#define ALL_JOINT_ID


op3_kinematics_dynamics
Author(s): SCH , Kayman , Jay Song
autogenerated on Mon Jun 10 2019 14:41:13