wholebody_control.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_WHOLEBODY_CONTROL_
20 #define OP3_ONLINE_WALKING_MODULE_WHOLEBODY_CONTROL_
21 
22 #pragma once
23 
24 #include <math.h>
25 #include <stdint.h>
26 #include <string>
27 #include <vector>
28 #include <map>
29 #include <geometry_msgs/Pose.h>
30 #include <eigen3/Eigen/Eigen>
32 
34 {
35 public:
36  WholebodyControl(std::string control_group,
37  double init_time, double fin_time,
38  geometry_msgs::Pose goal_msg);
39  virtual ~WholebodyControl();
40 
41  void initialize(std::vector<double_t> init_body_pos, std::vector<double_t> init_body_rot,
42  std::vector<double_t> init_r_foot_pos, std::vector<double_t> init_r_foot_Q,
43  std::vector<double_t> init_l_foot_pos, std::vector<double_t> init_l_foot_Q);
44  void update();
45  void finalize();
46 
47  void set(double time);
48 
49  std::vector<double_t> getJointPosition(double time);
50  std::vector<double_t> getJointVelocity(double time);
51  std::vector<double_t> getJointAcceleration(double time);
52 
53  void getTaskPosition(std::vector<double_t> &l_foot_pos,
54  std::vector<double_t> &r_foot_pos,
55  std::vector<double_t> &body_pos);
56  std::vector<double_t> getTaskVelocity(double time);
57  std::vector<double_t> getTaskAcceleration(double time);
58  void getTaskOrientation(std::vector<double_t> &l_foot_Q,
59  std::vector<double_t> &r_foot_Q,
60  std::vector<double_t> &body_Q);
61 
62  void getGroupPose(std::string name, geometry_msgs::Pose *msg);
63 
64 private:
66 
67  std::string control_group_;
68  int end_link_;
70  geometry_msgs::Pose goal_msg_;
71 
73  std::vector<double_t> des_body_pos_, des_body_vel_, des_body_accel_;
75  Eigen::Quaterniond init_body_Q_, des_body_Q_, goal_body_Q_;
76 
81 
86 
88  Eigen::Quaterniond init_task_Q_, des_task_Q_, goal_task_Q_;
89 };
90 
91 #endif
std::vector< double_t > des_l_foot_pos_
std::vector< double_t > goal_body_pos_
std::vector< double_t > init_body_vel_
std::vector< double_t > goal_task_accel_
std::vector< double_t > init_l_foot_pos_
Eigen::Quaterniond des_body_Q_
Eigen::Quaterniond init_l_foot_Q_
std::vector< double_t > des_r_foot_vel_
std::vector< double_t > goal_task_pos_
std::vector< double_t > des_l_foot_vel_
std::vector< double_t > goal_body_vel_
std::vector< double_t > init_r_foot_vel_
Eigen::Quaterniond goal_body_Q_
Eigen::Quaterniond init_body_Q_
Eigen::Quaterniond init_r_foot_Q_
std::vector< double_t > des_body_pos_
std::vector< double_t > goal_task_vel_
std::vector< double_t > init_r_foot_pos_
std::string control_group_
void getTaskPosition(std::vector< double_t > &l_foot_pos, std::vector< double_t > &r_foot_pos, std::vector< double_t > &body_pos)
void initialize(std::vector< double_t > init_body_pos, std::vector< double_t > init_body_rot, std::vector< double_t > init_r_foot_pos, std::vector< double_t > init_r_foot_Q, std::vector< double_t > init_l_foot_pos, std::vector< double_t > init_l_foot_Q)
std::vector< double_t > getJointPosition(double time)
std::vector< double_t > getJointVelocity(double time)
std::vector< double_t > goal_r_foot_vel_
std::vector< double_t > des_r_foot_accel_
std::vector< double_t > goal_r_foot_accel_
Eigen::Quaterniond des_l_foot_Q_
std::vector< double_t > goal_l_foot_pos_
Eigen::Quaterniond des_task_Q_
Eigen::Quaterniond init_task_Q_
std::vector< double_t > init_r_foot_accel_
robotis_framework::MinimumJerk * task_trajectory_
std::vector< double_t > goal_r_foot_pos_
std::vector< double_t > init_l_foot_vel_
geometry_msgs::Pose goal_msg_
std::vector< double_t > getJointAcceleration(double time)
Eigen::Quaterniond goal_l_foot_Q_
std::vector< double_t > init_body_accel_
std::vector< double_t > init_l_foot_accel_
std::vector< double_t > des_l_foot_accel_
void getTaskOrientation(std::vector< double_t > &l_foot_Q, std::vector< double_t > &r_foot_Q, std::vector< double_t > &body_Q)
std::vector< double_t > goal_l_foot_vel_
std::vector< double_t > des_r_foot_pos_
std::vector< double_t > goal_body_accel_
std::vector< double_t > getTaskAcceleration(double time)
std::vector< double_t > init_body_pos_
std::vector< double_t > goal_l_foot_accel_
std::vector< double_t > getTaskVelocity(double time)
std::vector< double_t > des_body_vel_
void getGroupPose(std::string name, geometry_msgs::Pose *msg)
std::vector< double_t > des_body_accel_
Eigen::Quaterniond goal_task_Q_
Eigen::Quaterniond des_r_foot_Q_
Eigen::Quaterniond goal_r_foot_Q_
WholebodyControl(std::string control_group, double init_time, double fin_time, geometry_msgs::Pose goal_msg)


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