op3_kdl.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 /* Author: SCH */
18 
19 #ifndef OP3_ONLINE_WALKING_MODULE_OP3_KDL_
20 #define OP3_ONLINE_WALKING_MODULE_OP3_KDL_
21 
22 #pragma once
23 
24 #include <math.h>
25 #include <stdint.h>
26 #include <string>
27 #include <vector>
28 #include <map>
29 #include <ros/ros.h>
30 #include <ros/callback_queue.h>
31 #include <ros/package.h>
32 #include <geometry_msgs/Pose.h>
33 #include <eigen3/Eigen/Eigen>
34 #include <kdl/joint.hpp>
35 #include <kdl/chain.hpp>
36 #include <kdl/chaindynparam.hpp>
37 #include <kdl/jacobian.hpp>
38 #include <kdl/chainjnttojacsolver.hpp>
39 #include <kdl/chainfksolver.hpp>
40 #include <kdl/chainfksolverpos_recursive.hpp>
41 #include <kdl/chainiksolvervel_pinv.hpp>
42 #include <kdl/chainiksolverpos_nr_jl.hpp>
43 
44 #define LEG_JOINT_NUM (6)
45 #define D2R (M_PI/180.0)
46 
48 {
49 public:
50  OP3Kinematics();
51  virtual ~OP3Kinematics();
52 
53 // void initialize(std::vector<double_t> pelvis_position, std::vector<double_t> pelvis_orientation);
54  void initialize(Eigen::MatrixXd pelvis_position, Eigen::MatrixXd pelvis_orientation);
55  void setJointPosition(Eigen::VectorXd rleg_joint_position, Eigen::VectorXd lleg_joint_position);
56  void solveForwardKinematics(std::vector<double_t> &rleg_position, std::vector<double_t> &rleg_orientation,
57  std::vector<double_t> &lleg_position, std::vector<double_t> &lleg_orientation);
58  bool solveInverseKinematics(std::vector<double_t> &rleg_output,
59  Eigen::MatrixXd rleg_target_position, Eigen::Quaterniond rleg_target_orientation,
60  std::vector<double_t> &lleg_output,
61  Eigen::MatrixXd lleg_target_position, Eigen::Quaterniond lleg_target_orientation);
62  void finalize();
63 
64 protected:
65 // KDL::Chain rleg_chain_;
71 
72 // KDL::Chain lleg_chain_;
78 
81 
83  geometry_msgs::Pose rleg_pose_, lleg_pose_;
84  geometry_msgs::Pose rleg_ft_pose_, lleg_ft_pose_;
85 
86 
87 
88 
89 };
90 
91 #endif
void initialize(Eigen::MatrixXd pelvis_position, Eigen::MatrixXd pelvis_orientation)
Definition: op3_kdl.cpp:35
KDL::ChainFkSolverPos_recursive * lleg_fk_solver_
Definition: op3_kdl.h:75
KDL::ChainJntToJacSolver * lleg_jacobian_solver_
Definition: op3_kdl.h:74
void finalize()
Definition: op3_kdl.cpp:416
KDL::ChainDynParam * lleg_dyn_param_
Definition: op3_kdl.h:73
Eigen::VectorXd rleg_joint_position_
Definition: op3_kdl.h:82
void solveForwardKinematics(std::vector< double_t > &rleg_position, std::vector< double_t > &rleg_orientation, std::vector< double_t > &lleg_position, std::vector< double_t > &lleg_orientation)
Definition: op3_kdl.cpp:283
KDL::ChainFkSolverPos_recursive * rleg_ft_fk_solver_
Definition: op3_kdl.h:79
KDL::ChainFkSolverPos_recursive * rleg_fk_solver_
Definition: op3_kdl.h:68
void setJointPosition(Eigen::VectorXd rleg_joint_position, Eigen::VectorXd lleg_joint_position)
Definition: op3_kdl.cpp:271
KDL::ChainJntToJacSolver * rleg_jacobian_solver_
Definition: op3_kdl.h:67
bool solveInverseKinematics(std::vector< double_t > &rleg_output, Eigen::MatrixXd rleg_target_position, Eigen::Quaterniond rleg_target_orientation, std::vector< double_t > &lleg_output, Eigen::MatrixXd lleg_target_position, Eigen::Quaterniond lleg_target_orientation)
Definition: op3_kdl.cpp:345
geometry_msgs::Pose rleg_ft_pose_
Definition: op3_kdl.h:84
Eigen::VectorXd lleg_joint_position_
Definition: op3_kdl.h:82
KDL::ChainIkSolverVel_pinv * lleg_ik_vel_solver_
Definition: op3_kdl.h:76
geometry_msgs::Pose lleg_pose_
Definition: op3_kdl.h:83
geometry_msgs::Pose lleg_ft_pose_
Definition: op3_kdl.h:84
geometry_msgs::Pose rleg_pose_
Definition: op3_kdl.h:83
KDL::ChainIkSolverVel_pinv * rleg_ik_vel_solver_
Definition: op3_kdl.h:69
KDL::ChainDynParam * rleg_dyn_param_
Definition: op3_kdl.h:66
KDL::ChainFkSolverPos_recursive * lleg_ft_fk_solver_
Definition: op3_kdl.h:80
KDL::ChainIkSolverPos_NR_JL * rleg_ik_pos_solver_
Definition: op3_kdl.h:70
KDL::ChainIkSolverPos_NR_JL * lleg_ik_pos_solver_
Definition: op3_kdl.h:77
virtual ~OP3Kinematics()
Definition: op3_kdl.cpp:30


op3_online_walking_module
Author(s): SCH
autogenerated on Mon Jun 10 2019 14:41:22