walking_module.cpp
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  * online_wakling_module.cpp
19  *
20  * Created on: 2016. 12. 14.
21  * Author: Jay Song
22  */
23 
24 #include <stdio.h>
27 
28 using namespace thormang3;
29 
31 {
32 public:
33  static const std::string FAILED_TO_ADD_STEP_DATA_MSG;
34  static const std::string BALANCE_PARAM_SETTING_STARTED_MSG;
35  static const std::string BALANCE_PARAM_SETTING_FINISHED_MSG;
36  static const std::string JOINT_FEEDBACK_GAIN_UPDATE_STARTED_MSG;
37  static const std::string JOINT_FEEDBACK_GAIN_UPDATE_FINISHED_MSG;
38  static const std::string WALKING_MODULE_IS_ENABLED_MSG;
39  static const std::string WALKING_MODULE_IS_DISABLED_MSG;
40  static const std::string BALANCE_HAS_BEEN_TURNED_OFF;
41  static const std::string WALKING_START_MSG;
42  static const std::string WALKING_FINISH_MSG;
43 };
44 
45 const std::string WalkingStatusMSG::FAILED_TO_ADD_STEP_DATA_MSG = "Failed_to_add_Step_Data";
46 const std::string WalkingStatusMSG::BALANCE_PARAM_SETTING_STARTED_MSG = "Balance_Param_Setting_Started";
47 const std::string WalkingStatusMSG::BALANCE_PARAM_SETTING_FINISHED_MSG = "Balance_Param_Setting_Finished";
48 const std::string WalkingStatusMSG::JOINT_FEEDBACK_GAIN_UPDATE_STARTED_MSG = "Joint_FeedBack_Gain_Update_Started";
49 const std::string WalkingStatusMSG::JOINT_FEEDBACK_GAIN_UPDATE_FINISHED_MSG = "Joint_FeedBack_Gain_Update_Finished";
50 const std::string WalkingStatusMSG::WALKING_MODULE_IS_ENABLED_MSG = "Walking_Module_is_enabled";
51 const std::string WalkingStatusMSG::WALKING_MODULE_IS_DISABLED_MSG = "Walking_Module_is_disabled";
52 const std::string WalkingStatusMSG::BALANCE_HAS_BEEN_TURNED_OFF = "Balance_has_been_turned_off";
53 const std::string WalkingStatusMSG::WALKING_START_MSG = "Walking_Started";
54 const std::string WalkingStatusMSG::WALKING_FINISH_MSG = "Walking_Finished";
55 
56 
58 : control_cycle_msec_(8)
59 {
60  gazebo_ = false;
61  enable_ = false;
62  module_name_ = "walking_module";
64  result_["r_leg_hip_y"] = new robotis_framework::DynamixelState();
65  result_["r_leg_hip_r"] = new robotis_framework::DynamixelState();
66  result_["r_leg_hip_p"] = new robotis_framework::DynamixelState();
67  result_["r_leg_kn_p" ] = new robotis_framework::DynamixelState();
68  result_["r_leg_an_p" ] = new robotis_framework::DynamixelState();
69  result_["r_leg_an_r" ] = new robotis_framework::DynamixelState();
70 
71  result_["l_leg_hip_y"] = new robotis_framework::DynamixelState();
72  result_["l_leg_hip_r"] = new robotis_framework::DynamixelState();
73  result_["l_leg_hip_p"] = new robotis_framework::DynamixelState();
74  result_["l_leg_kn_p" ] = new robotis_framework::DynamixelState();
75  result_["l_leg_an_p" ] = new robotis_framework::DynamixelState();
76  result_["l_leg_an_r" ] = new robotis_framework::DynamixelState();
77 
78  joint_name_to_index_["r_leg_hip_y"] = 0;
79  joint_name_to_index_["r_leg_hip_r"] = 1;
80  joint_name_to_index_["r_leg_hip_p"] = 2;
81  joint_name_to_index_["r_leg_kn_p" ] = 3;
82  joint_name_to_index_["r_leg_an_p" ] = 4;
83  joint_name_to_index_["r_leg_an_r" ] = 5;
84 
85  joint_name_to_index_["l_leg_hip_y"] = 6;
86  joint_name_to_index_["l_leg_hip_r"] = 7;
87  joint_name_to_index_["l_leg_hip_p"] = 8;
88  joint_name_to_index_["l_leg_kn_p" ] = 9;
89  joint_name_to_index_["l_leg_an_p" ] = 10;
90  joint_name_to_index_["l_leg_an_r" ] = 11;
91 
93 
94  gyro_roll_ = gyro_pitch_ = 0;
100 
101 
104 
105  desired_matrix_g_to_cob_ = Eigen::MatrixXd::Identity(4,4);
106  desired_matrix_g_to_rfoot_ = Eigen::MatrixXd::Identity(4,4);
107  desired_matrix_g_to_lfoot_ = Eigen::MatrixXd::Identity(4,4);
108 
109 
114 
115  double tf = balance_update_duration_;
116  Eigen::MatrixXd A(6,6), B(6, 1);
117  A << 0.0, 0.0, 0.0, 0.0, 0.0, 1.0,
118  0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
119  0.0, 0.0, 0.0, 2.0, 0.0, 0.0,
120  tf*tf*tf*tf*tf, tf*tf*tf*tf, tf*tf*tf, tf*tf, tf, 1.0,
121  5.0*tf*tf*tf*tf, 4.0*tf*tf*tf, 3.0*tf*tf, 2.0*tf, 1.0, 0.0,
122  20.0*tf*tf*tf, 12.0*tf*tf, 6.0*tf, 2.0, 0.0, 0.0;
123 
124  B << 0, 0, 0, 2.0, 0, 0;
125 
126  balance_update_polynomial_coeff_ = A.inverse() * B;
127 
132 
133  rot_x_pi_3d_.resize(3,3);
134  rot_x_pi_3d_ << 1, 0, 0,
135  0, -1, 0,
136  0, 0, -1;
137  rot_z_pi_3d_.resize(3,3);
138  rot_z_pi_3d_ << -1, 0, 0,
139  0, -1, 0,
140  0, 0, 1;
141 }
142 
144 {
145  queue_thread_.join();
146 }
147 
148 void OnlineWalkingModule::initialize(const int control_cycle_msec, robotis_framework::Robot *robot)
149 {
150  queue_thread_ = boost::thread(boost::bind(&OnlineWalkingModule::queueThread, this));
151  control_cycle_msec_ = control_cycle_msec;
152 
154  online_walking->setInitialPose(0, -0.093, -0.63, 0, 0, 0,
155  0, 0.093, -0.63, 0, 0, 0,
156  0, 0, 0, 0, 0, 0);
157 
158 
159  online_walking->hip_roll_feedforward_angle_rad_ = 0.0*M_PI/180.0;
160  online_walking->balance_ctrl_.setCOBManualAdjustment(-10.0*0.001, 0, 0);
161 
162  online_walking->initialize();
163 
164  process_mutex_.lock();
165  desired_matrix_g_to_cob_ = online_walking->mat_g_to_cob_;
168  process_mutex_.unlock();
169 
170  result_["r_leg_hip_y"]->goal_position_ = online_walking->out_angle_rad_[0];
171  result_["r_leg_hip_r"]->goal_position_ = online_walking->out_angle_rad_[1];
172  result_["r_leg_hip_p"]->goal_position_ = online_walking->out_angle_rad_[2];
173  result_["r_leg_kn_p"]->goal_position_ = online_walking->out_angle_rad_[3];
174  result_["r_leg_an_p"]->goal_position_ = online_walking->out_angle_rad_[4];
175  result_["r_leg_an_r"]->goal_position_ = online_walking->out_angle_rad_[5];
176 
177  result_["l_leg_hip_y"]->goal_position_ = online_walking->out_angle_rad_[6];
178  result_["l_leg_hip_r"]->goal_position_ = online_walking->out_angle_rad_[7];
179  result_["l_leg_hip_p"]->goal_position_ = online_walking->out_angle_rad_[8];
180  result_["l_leg_kn_p" ]->goal_position_ = online_walking->out_angle_rad_[9];
181  result_["l_leg_an_p" ]->goal_position_ = online_walking->out_angle_rad_[10];
182  result_["l_leg_an_r" ]->goal_position_ = online_walking->out_angle_rad_[11];
183 
184  online_walking->start();
185  online_walking->process();
186 
188 
189  online_walking->hip_roll_feedforward_angle_rad_ = 0.0;
190 
191  online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.p_gain_ = 0;
192  online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.d_gain_ = 0;
193  online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.p_gain_ = 0;
194  online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.d_gain_ = 0;
195 
196  online_walking->balance_ctrl_.foot_roll_angle_ctrl_.p_gain_ = 0;
197  online_walking->balance_ctrl_.foot_roll_angle_ctrl_.d_gain_ = 0;
198  online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.p_gain_ = 0;
199  online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.d_gain_ = 0;
200 
201  online_walking->balance_ctrl_.right_foot_force_x_ctrl_.p_gain_ = 0;
202  online_walking->balance_ctrl_.right_foot_force_x_ctrl_.d_gain_ = 0;
203  online_walking->balance_ctrl_.right_foot_force_y_ctrl_.p_gain_ = 0;
204  online_walking->balance_ctrl_.right_foot_force_y_ctrl_.d_gain_ = 0;
205  online_walking->balance_ctrl_.right_foot_force_z_ctrl_.p_gain_ = 0;
206  online_walking->balance_ctrl_.right_foot_force_z_ctrl_.d_gain_ = 0;
211 }
212 
214 {
215  ros::NodeHandle ros_node;
216  ros::CallbackQueue callback_queue;
217 
218  ros_node.setCallbackQueue(&callback_queue);
219 
220  /* publish topics */
221  robot_pose_pub_ = ros_node.advertise<thormang3_walking_module_msgs::RobotPose>("/robotis/walking/robot_pose", 1);
222  status_msg_pub_ = ros_node.advertise<robotis_controller_msgs::StatusMsg>("robotis/status", 1);
223  pelvis_base_msg_pub_ = ros_node.advertise<geometry_msgs::PoseStamped>("/robotis/pelvis_pose_base_walking", 1);
224  done_msg_pub_ = ros_node.advertise<std_msgs::String>("/robotis/movement_done", 1);
225 #ifdef WALKING_TUNE
226  walking_joint_states_pub_ = ros_node.advertise<thormang3_walking_module_msgs::WalkingJointStatesStamped>("/robotis/walking/walking_joint_states", 1);
227 #endif
228 
229  /* ROS Service Callback Functions */
230  ros::ServiceServer get_ref_step_data_server = ros_node.advertiseService("/robotis/walking/get_reference_step_data", &OnlineWalkingModule::getReferenceStepDataServiceCallback, this);
231  ros::ServiceServer add_step_data_array_sever = ros_node.advertiseService("/robotis/walking/add_step_data", &OnlineWalkingModule::addStepDataServiceCallback, this);
232  ros::ServiceServer walking_start_server = ros_node.advertiseService("/robotis/walking/walking_start", &OnlineWalkingModule::startWalkingServiceCallback, this);
233  ros::ServiceServer is_running_server = ros_node.advertiseService("/robotis/walking/is_running", &OnlineWalkingModule::IsRunningServiceCallback, this);
234  ros::ServiceServer set_balance_param_server = ros_node.advertiseService("/robotis/walking/set_balance_param", &OnlineWalkingModule::setBalanceParamServiceCallback, this);
235  ros::ServiceServer set_joint_feedback_gain = ros_node.advertiseService("/robotis/walking/joint_feedback_gain", &OnlineWalkingModule::setJointFeedBackGainServiceCallback, this);
236  ros::ServiceServer remove_existing_step_data = ros_node.advertiseService("/robotis/walking/remove_existing_step_data", &OnlineWalkingModule::removeExistingStepDataServiceCallback, this);
237 
238  /* sensor topic subscribe */
239  ros::Subscriber imu_data_sub = ros_node.subscribe("/robotis/sensor/imu/imu", 3, &OnlineWalkingModule::imuDataOutputCallback, this);
240 
241  ros::WallDuration duration(control_cycle_msec_ / 1000.0);
242  if(ros::param::get("gazebo", gazebo_) == false)
243  gazebo_ = false;
244 
245  while(ros_node.ok())
246  callback_queue.callAvailable(duration);
247 
248 // while (ros_node.ok())
249 // {
250 // callback_queue.callAvailable();
251 // usleep(1000);
252 // }
253 }
254 
256 {
257  //process_mutex_.lock();
258  robot_pose_msg_.global_to_center_of_body.position.x = desired_matrix_g_to_cob_.coeff(0, 3);
259  robot_pose_msg_.global_to_center_of_body.position.y = desired_matrix_g_to_cob_.coeff(1, 3);
260  robot_pose_msg_.global_to_center_of_body.position.z = desired_matrix_g_to_cob_.coeff(2, 3);
261  Eigen::Quaterniond quaterniond_g_to_cob(desired_matrix_g_to_cob_.block<3, 3>(0, 0));
262 
263 
264  robot_pose_msg_.global_to_right_foot.position.x = desired_matrix_g_to_rfoot_.coeff(0, 3);
265  robot_pose_msg_.global_to_right_foot.position.y = desired_matrix_g_to_rfoot_.coeff(1, 3);
266  robot_pose_msg_.global_to_right_foot.position.z = desired_matrix_g_to_rfoot_.coeff(2, 3);
267  Eigen::Quaterniond quaterniond_g_to_rf(desired_matrix_g_to_rfoot_.block<3, 3>(0, 0));
268 
269  robot_pose_msg_.global_to_left_foot.position.x = desired_matrix_g_to_lfoot_.coeff(0, 3);
270  robot_pose_msg_.global_to_left_foot.position.y = desired_matrix_g_to_lfoot_.coeff(1, 3);
271  robot_pose_msg_.global_to_left_foot.position.z = desired_matrix_g_to_lfoot_.coeff(2, 3);
272  Eigen::Quaterniond quaterniond_g_to_lf(desired_matrix_g_to_lfoot_.block<3, 3>(0, 0));
273  //process_mutex_.unlock();
274 
275  tf::quaternionEigenToMsg(quaterniond_g_to_cob, robot_pose_msg_.global_to_center_of_body.orientation);
276  tf::quaternionEigenToMsg(quaterniond_g_to_rf, robot_pose_msg_.global_to_right_foot.orientation);
277  tf::quaternionEigenToMsg(quaterniond_g_to_lf, robot_pose_msg_.global_to_left_foot.orientation);
278 
280 
281 // geometry_msgs::PoseStamped pose_msg;
282 // pose_msg.header.stamp = ros::Time::now();
283 //
284 // process_mutex_.lock();
285 //
286 // Eigen::MatrixXd g_to_pelvis = desired_matrix_g_to_cob_ * robotis_framework::getTransformationXYZRPY(0, 0, 0.093, 0, 0, 0);
287 // Eigen::Quaterniond pelvis_rotation = robotis_framework::convertRotationToQuaternion(desired_matrix_g_to_cob_);
288 //
289 // pose_msg.pose.position.x = g_to_pelvis.coeff(0, 3);
290 // pose_msg.pose.position.y = g_to_pelvis.coeff(1, 3);
291 // pose_msg.pose.position.z = g_to_pelvis.coeff(2, 3) - 0.093;
292 // tf::quaternionEigenToMsg(pelvis_rotation, pose_msg.pose.orientation);
293 //
294 // process_mutex_.unlock();
295 //
296 // pelvis_base_msg_pub_.publish(pose_msg);
297 }
298 
299 void OnlineWalkingModule::publishStatusMsg(unsigned int type, std::string msg)
300 {
301  robotis_controller_msgs::StatusMsg status_msg;
302  status_msg.header.stamp = ros::Time::now();
303  status_msg.type = type;
304  status_msg.module_name = "Walking";
305  status_msg.status_msg = msg;
306 
307  status_msg_pub_.publish(status_msg);
308 }
309 
311 {
312  std_msgs::String done_msg;
313  done_msg.data = msg;
314 
315  done_msg_pub_.publish(done_msg);
316 }
317 
318 int OnlineWalkingModule::convertStepDataMsgToStepData(thormang3_walking_module_msgs::StepData& src, robotis_framework::StepData& des)
319 {
320  int copy_result = thormang3_walking_module_msgs::AddStepDataArray::Response::NO_ERROR;
321  des.time_data. walking_state = src.time_data.walking_state;
322  des.time_data.abs_step_time = src.time_data.abs_step_time;
323  des.time_data.dsp_ratio = src.time_data.dsp_ratio;
324 
325  des.position_data.moving_foot = src.position_data.moving_foot;
328  des.position_data.foot_z_swap = src.position_data.foot_z_swap;
330  des.position_data.waist_yaw_angle = src.position_data.torso_yaw_angle_rad;
331  des.position_data.body_z_swap = src.position_data.body_z_swap;
332 
333  des.position_data.body_pose.z = src.position_data.body_pose.z;
334  des.position_data.body_pose.roll = src.position_data.body_pose.roll;
335  des.position_data.body_pose.pitch = src.position_data.body_pose.pitch;
336  des.position_data.body_pose.yaw = src.position_data.body_pose.yaw;
337  des.position_data.right_foot_pose.x = src.position_data.right_foot_pose.x;
338  des.position_data.right_foot_pose.y = src.position_data.right_foot_pose.y;
339  des.position_data.right_foot_pose.z = src.position_data.right_foot_pose.z;
340  des.position_data.right_foot_pose.roll = src.position_data.right_foot_pose.roll;
341  des.position_data.right_foot_pose.pitch = src.position_data.right_foot_pose.pitch;
342  des.position_data.right_foot_pose.yaw = src.position_data.right_foot_pose.yaw;
343  des.position_data.left_foot_pose.x = src.position_data.left_foot_pose.x;
344  des.position_data.left_foot_pose.y = src.position_data.left_foot_pose.y;
345  des.position_data.left_foot_pose.z = src.position_data.left_foot_pose.z;
346  des.position_data.left_foot_pose.roll = src.position_data.left_foot_pose.roll;
347  des.position_data.left_foot_pose.pitch = src.position_data.left_foot_pose.pitch;
348  des.position_data.left_foot_pose.yaw = src.position_data.left_foot_pose.yaw;
349 
350  des.time_data.start_time_delay_ratio_x = src.time_data.start_time_delay_ratio_x;
351  des.time_data.start_time_delay_ratio_y = src.time_data.start_time_delay_ratio_y;
352  des.time_data.start_time_delay_ratio_z = src.time_data.start_time_delay_ratio_z;
353  des.time_data.start_time_delay_ratio_roll = src.time_data.start_time_delay_ratio_roll;
354  des.time_data.start_time_delay_ratio_pitch = src.time_data.start_time_delay_ratio_pitch;
355  des.time_data.start_time_delay_ratio_yaw = src.time_data.start_time_delay_ratio_yaw;
356 
357  des.time_data.finish_time_advance_ratio_x = src.time_data.finish_time_advance_ratio_x;
358  des.time_data.finish_time_advance_ratio_y = src.time_data.finish_time_advance_ratio_y;
359  des.time_data.finish_time_advance_ratio_z = src.time_data.finish_time_advance_ratio_z;
360  des.time_data.finish_time_advance_ratio_roll = src.time_data.finish_time_advance_ratio_roll;
361  des.time_data.finish_time_advance_ratio_pitch = src.time_data.finish_time_advance_ratio_pitch;
362  des.time_data.finish_time_advance_ratio_yaw = src.time_data.finish_time_advance_ratio_yaw;
363 
364  if((src.time_data.walking_state != thormang3_walking_module_msgs::StepTimeData::IN_WALKING_STARTING)
365  && (src.time_data.walking_state != thormang3_walking_module_msgs::StepTimeData::IN_WALKING)
366  && (src.time_data.walking_state != thormang3_walking_module_msgs::StepTimeData::IN_WALKING_ENDING) )
367  copy_result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_TIME_DATA;
368 
369  if((src.time_data.start_time_delay_ratio_x < 0)
370  || (src.time_data.start_time_delay_ratio_y < 0)
371  || (src.time_data.start_time_delay_ratio_z < 0)
372  || (src.time_data.start_time_delay_ratio_roll < 0)
373  || (src.time_data.start_time_delay_ratio_pitch < 0)
374  || (src.time_data.start_time_delay_ratio_yaw < 0) )
375  copy_result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_TIME_DATA;
376 
377  if((src.time_data.finish_time_advance_ratio_x < 0)
378  || (src.time_data.finish_time_advance_ratio_y < 0)
379  || (src.time_data.finish_time_advance_ratio_z < 0)
380  || (src.time_data.finish_time_advance_ratio_roll < 0)
381  || (src.time_data.finish_time_advance_ratio_pitch < 0)
382  || (src.time_data.finish_time_advance_ratio_yaw < 0) )
383  copy_result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_TIME_DATA;
384 
385  if(((src.time_data.start_time_delay_ratio_x + src.time_data.finish_time_advance_ratio_x) > 1.0)
386  || ((src.time_data.start_time_delay_ratio_y + src.time_data.finish_time_advance_ratio_y ) > 1.0)
387  || ((src.time_data.start_time_delay_ratio_z + src.time_data.finish_time_advance_ratio_z ) > 1.0)
388  || ((src.time_data.start_time_delay_ratio_roll + src.time_data.finish_time_advance_ratio_roll ) > 1.0)
389  || ((src.time_data.start_time_delay_ratio_pitch + src.time_data.finish_time_advance_ratio_pitch ) > 1.0)
390  || ((src.time_data.start_time_delay_ratio_yaw + src.time_data.finish_time_advance_ratio_yaw ) > 1.0) )
391  copy_result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_TIME_DATA;
392 
393  if((src.position_data.moving_foot != thormang3_walking_module_msgs::StepPositionData::STANDING)
394  && (src.position_data.moving_foot != thormang3_walking_module_msgs::StepPositionData::RIGHT_FOOT_SWING)
395  && (src.position_data.moving_foot != thormang3_walking_module_msgs::StepPositionData::LEFT_FOOT_SWING))
396  copy_result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_POSITION_DATA;
397 
398  if(src.position_data.foot_z_swap < 0)
399  copy_result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_POSITION_DATA;
400 
401  return copy_result;
402 }
403 
404 int OnlineWalkingModule::convertStepDataToStepDataMsg(robotis_framework::StepData& src, thormang3_walking_module_msgs::StepData& des)
405 {
406  des.time_data.walking_state = src.time_data.walking_state;
407  des.time_data.abs_step_time = src.time_data.abs_step_time;
408  des.time_data.dsp_ratio = src.time_data.dsp_ratio;
409 
410  des.time_data.start_time_delay_ratio_x = des.time_data.finish_time_advance_ratio_x = 0;
411  des.time_data.start_time_delay_ratio_y = des.time_data.finish_time_advance_ratio_y = 0;
412  des.time_data.start_time_delay_ratio_z = des.time_data.finish_time_advance_ratio_z = 0;
413  des.time_data.start_time_delay_ratio_roll = des.time_data.finish_time_advance_ratio_roll = 0;
414  des.time_data.start_time_delay_ratio_pitch = des.time_data.finish_time_advance_ratio_pitch = 0;
415  des.time_data.start_time_delay_ratio_yaw = des.time_data.finish_time_advance_ratio_yaw = 0;
416 
417  des.position_data.moving_foot = src.position_data.moving_foot;
418  des.position_data.foot_z_swap = src.position_data.foot_z_swap;
419  des.position_data.torso_yaw_angle_rad = src.position_data.waist_yaw_angle;
420  des.position_data.body_z_swap = src.position_data.body_z_swap;
421 
422  des.position_data.body_pose.z = src.position_data.body_pose.z;
423  des.position_data.body_pose.roll = src.position_data.body_pose.roll;
424  des.position_data.body_pose.pitch = src.position_data.body_pose.pitch;
425  des.position_data.body_pose.yaw = src.position_data.body_pose.yaw;
426  des.position_data.right_foot_pose.x = src.position_data.right_foot_pose.x;
427  des.position_data.right_foot_pose.y = src.position_data.right_foot_pose.y;
428  des.position_data.right_foot_pose.z = src.position_data.right_foot_pose.z;
429  des.position_data.right_foot_pose.roll = src.position_data.right_foot_pose.roll;
430  des.position_data.right_foot_pose.pitch = src.position_data.right_foot_pose.pitch;
431  des.position_data.right_foot_pose.yaw = src.position_data.right_foot_pose.yaw;
432  des.position_data.left_foot_pose.x = src.position_data.left_foot_pose.x;
433  des.position_data.left_foot_pose.y = src.position_data.left_foot_pose.y;
434  des.position_data.left_foot_pose.z = src.position_data.left_foot_pose.z;
435  des.position_data.left_foot_pose.roll = src.position_data.left_foot_pose.roll;
436  des.position_data.left_foot_pose.pitch = src.position_data.left_foot_pose.pitch;
437  des.position_data.left_foot_pose.yaw = src.position_data.left_foot_pose.yaw;
438 
439  return 0;
440 }
441 
442 bool OnlineWalkingModule::getReferenceStepDataServiceCallback(thormang3_walking_module_msgs::GetReferenceStepData::Request &req,
443  thormang3_walking_module_msgs::GetReferenceStepData::Response &res)
444 {
446 
447  robotis_framework::StepData refStepData;
448 
449  online_walking->getReferenceStepDatafotAddition(&refStepData);
450 
451  convertStepDataToStepDataMsg(refStepData, res.reference_step_data);
452 
453  return true;
454 }
455 
456 bool OnlineWalkingModule::addStepDataServiceCallback(thormang3_walking_module_msgs::AddStepDataArray::Request &req,
457  thormang3_walking_module_msgs::AddStepDataArray::Response &res)
458 {
460  res.result = thormang3_walking_module_msgs::AddStepDataArray::Response::NO_ERROR;
461 
462  if(enable_ == false)
463  {
464  res.result |= thormang3_walking_module_msgs::AddStepDataArray::Response::NOT_ENABLED_WALKING_MODULE;
465  std::string status_msg = WalkingStatusMSG::FAILED_TO_ADD_STEP_DATA_MSG;
466  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_ERROR, status_msg);
467  return true;
468  }
469 
470  if((req.step_data_array.size() > 100)
471  && (req.remove_existing_step_data == true)
472  && ((online_walking->isRunning() == true)))
473  {
474  res.result |= thormang3_walking_module_msgs::AddStepDataArray::Response::TOO_MANY_STEP_DATA;
475  std::string status_msg = WalkingStatusMSG::FAILED_TO_ADD_STEP_DATA_MSG;
476  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_ERROR, status_msg);
477  return true;
478  }
479 
480  robotis_framework::StepData step_data, ref_step_data;
481  std::vector<robotis_framework::StepData> req_step_data_array;
482 
483  online_walking->getReferenceStepDatafotAddition(&ref_step_data);
484 
485  for(int i = 0; i < req.step_data_array.size(); i++)
486  {
487  res.result |= convertStepDataMsgToStepData(req.step_data_array[i], step_data);
488 
489  if(step_data.time_data.abs_step_time <= 0)
490  {
491  res.result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_TIME_DATA;
492  }
493 
494  if(i != 0)
495  {
496  if(step_data.time_data.abs_step_time <= req_step_data_array[req_step_data_array.size() - 1].time_data.abs_step_time)
497  {
498  res.result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_TIME_DATA;
499  }
500  }
501  else
502  {
503  if(step_data.time_data.abs_step_time <= ref_step_data.time_data.abs_step_time)
504  {
505  res.result |= thormang3_walking_module_msgs::AddStepDataArray::Response::PROBLEM_IN_TIME_DATA;
506  }
507  }
508 
509  if(res.result != thormang3_walking_module_msgs::AddStepDataArray::Response::NO_ERROR)
510  {
511  std::string status_msg = WalkingStatusMSG::FAILED_TO_ADD_STEP_DATA_MSG;
512  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_ERROR, status_msg);
513  return true;
514  }
515 
516  req_step_data_array.push_back(step_data);
517  }
518 
519  if(req.remove_existing_step_data == true)
520  {
521  int exist_num_of_step_data = online_walking->getNumofRemainingUnreservedStepData();
522  if(exist_num_of_step_data != 0)
523  for(int remove_count = 0; remove_count < exist_num_of_step_data; remove_count++)
524  online_walking->eraseLastStepData();
525  }
526  else
527  {
528  if(online_walking->isRunning() == true)
529  {
530  res.result |= thormang3_walking_module_msgs::AddStepDataArray::Response::ROBOT_IS_WALKING_NOW;
531  std::string status_msg = WalkingStatusMSG::FAILED_TO_ADD_STEP_DATA_MSG;
532  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_ERROR, status_msg);
533  return true;
534  }
535  }
536 
537  if(checkBalanceOnOff() == false)
538  {
539  std::string status_msg = WalkingStatusMSG::BALANCE_HAS_BEEN_TURNED_OFF;
540  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_ERROR, status_msg);
541  return true;
542  }
543 
544  for(unsigned int i = 0; i < req_step_data_array.size() ; i++)
545  online_walking->addStepData(req_step_data_array[i]);
546 
547  if( req.auto_start == true)
548  {
549  online_walking->start();
550  }
551 
552  return true;
553 }
554 
555 bool OnlineWalkingModule::startWalkingServiceCallback(thormang3_walking_module_msgs::StartWalking::Request &req,
556  thormang3_walking_module_msgs::StartWalking::Response &res)
557 {
559  res.result = thormang3_walking_module_msgs::StartWalking::Response::NO_ERROR;
560 
561  if(enable_ == false)
562  {
563  res.result |= thormang3_walking_module_msgs::StartWalking::Response::NOT_ENABLED_WALKING_MODULE;
564  return true;
565  }
566 
567  if(prev_walking->isRunning() == true)
568  {
569  res.result |= thormang3_walking_module_msgs::StartWalking::Response::ROBOT_IS_WALKING_NOW;
570  return true;
571  }
572 
573  if(checkBalanceOnOff() == false)
574  {
575  std::string status_msg = WalkingStatusMSG::BALANCE_HAS_BEEN_TURNED_OFF;
576  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_ERROR, status_msg);
577  return true;
578  }
579 
580  if(prev_walking->getNumofRemainingUnreservedStepData() == 0)
581  {
582  res.result |= thormang3_walking_module_msgs::StartWalking::Response::NO_STEP_DATA;
583  return true;
584  }
585 
586  if(res.result == thormang3_walking_module_msgs::StartWalking::Response::NO_ERROR)
587  {
588  prev_walking->start();
589  }
590 
591  return true;
592 }
593 
594 bool OnlineWalkingModule::IsRunningServiceCallback(thormang3_walking_module_msgs::IsRunning::Request &req,
595  thormang3_walking_module_msgs::IsRunning::Response &res)
596 {
597  bool is_running = isRunning();
598  res.is_running = is_running;
599 
600  return true;
601 }
602 
604 {
605  return THORMANG3OnlineWalking::getInstance()->isRunning();
606 }
607 
608 bool OnlineWalkingModule::setJointFeedBackGainServiceCallback(thormang3_walking_module_msgs::SetJointFeedBackGain::Request &req,
609  thormang3_walking_module_msgs::SetJointFeedBackGain::Response &res)
610 {
612 
613  res.result = thormang3_walking_module_msgs::SetJointFeedBackGain::Response::NO_ERROR;
614 
615  if( enable_ == false)
616  res.result |= thormang3_walking_module_msgs::SetJointFeedBackGain::Response::NOT_ENABLED_WALKING_MODULE;
617 
619  res.result |= thormang3_walking_module_msgs::SetJointFeedBackGain::Response::PREV_REQUEST_IS_NOT_FINISHED;
620 
621  if( res.result != thormang3_walking_module_msgs::SetJointFeedBackGain::Response::NO_ERROR)
622  {
623  publishDoneMsg("walking_joint_feedback_failed");
624  return true;
625  }
626 
627  if( req.updating_duration <= 0.0 )
628  {
629  // under 8ms apply immediately
630  setJointFeedBackGain(req.feedback_gain);
632  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
633  publishDoneMsg("walking_joint_feedback");
634  return true;
635  }
636  else
637  {
638  joint_feedback_update_duration_ = req.updating_duration;
639  }
640 
643 
645  Eigen::MatrixXd A(6,6), B(6, 1);
646  A << 0.0, 0.0, 0.0, 0.0, 0.0, 1.0,
647  0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
648  0.0, 0.0, 0.0, 2.0, 0.0, 0.0,
649  tf*tf*tf*tf*tf, tf*tf*tf*tf, tf*tf*tf, tf*tf, tf, 1.0,
650  5.0*tf*tf*tf*tf, 4.0*tf*tf*tf, 3.0*tf*tf, 2.0*tf, 1.0, 0.0,
651  20.0*tf*tf*tf, 12.0*tf*tf, 6.0*tf, 2.0, 0.0, 0.0;
652 
653  B << 0, 0, 0, 1.0, 0, 0;
654  joint_feedback_update_polynomial_coeff_ = A.inverse() * B;
655 
656  desired_joint_feedback_gain_ = req.feedback_gain;
657 
658  previous_joint_feedback_gain_.r_leg_hip_y_p_gain = online_walking->leg_angle_feed_back_[0].p_gain_;
659  previous_joint_feedback_gain_.r_leg_hip_y_d_gain = online_walking->leg_angle_feed_back_[0].d_gain_;
660  previous_joint_feedback_gain_.r_leg_hip_r_p_gain = online_walking->leg_angle_feed_back_[1].p_gain_;
661  previous_joint_feedback_gain_.r_leg_hip_r_d_gain = online_walking->leg_angle_feed_back_[1].d_gain_;
662  previous_joint_feedback_gain_.r_leg_hip_p_p_gain = online_walking->leg_angle_feed_back_[2].p_gain_;
663  previous_joint_feedback_gain_.r_leg_hip_p_d_gain = online_walking->leg_angle_feed_back_[2].d_gain_;
664  previous_joint_feedback_gain_.r_leg_kn_p_p_gain = online_walking->leg_angle_feed_back_[3].p_gain_;
665  previous_joint_feedback_gain_.r_leg_kn_p_d_gain = online_walking->leg_angle_feed_back_[3].d_gain_;
666  previous_joint_feedback_gain_.r_leg_an_p_p_gain = online_walking->leg_angle_feed_back_[4].p_gain_;
667  previous_joint_feedback_gain_.r_leg_an_p_d_gain = online_walking->leg_angle_feed_back_[4].d_gain_;
668  previous_joint_feedback_gain_.r_leg_an_r_p_gain = online_walking->leg_angle_feed_back_[5].p_gain_;
669  previous_joint_feedback_gain_.r_leg_an_r_d_gain = online_walking->leg_angle_feed_back_[5].d_gain_;
670 
671  previous_joint_feedback_gain_.l_leg_hip_y_p_gain = online_walking->leg_angle_feed_back_[6].p_gain_;
672  previous_joint_feedback_gain_.l_leg_hip_y_d_gain = online_walking->leg_angle_feed_back_[6].d_gain_;
673  previous_joint_feedback_gain_.l_leg_hip_r_p_gain = online_walking->leg_angle_feed_back_[7].p_gain_;
674  previous_joint_feedback_gain_.l_leg_hip_r_d_gain = online_walking->leg_angle_feed_back_[7].d_gain_;
675  previous_joint_feedback_gain_.l_leg_hip_p_p_gain = online_walking->leg_angle_feed_back_[8].p_gain_;
676  previous_joint_feedback_gain_.l_leg_hip_p_d_gain = online_walking->leg_angle_feed_back_[8].d_gain_;
677  previous_joint_feedback_gain_.l_leg_kn_p_p_gain = online_walking->leg_angle_feed_back_[9].p_gain_;
678  previous_joint_feedback_gain_.l_leg_kn_p_d_gain = online_walking->leg_angle_feed_back_[9].d_gain_;
679  previous_joint_feedback_gain_.l_leg_an_p_p_gain = online_walking->leg_angle_feed_back_[10].p_gain_;
680  previous_joint_feedback_gain_.l_leg_an_p_d_gain = online_walking->leg_angle_feed_back_[10].d_gain_;
681  previous_joint_feedback_gain_.l_leg_an_r_p_gain = online_walking->leg_angle_feed_back_[11].p_gain_;
682  previous_joint_feedback_gain_.l_leg_an_r_d_gain = online_walking->leg_angle_feed_back_[11].d_gain_;
683 
686 
687  return true;
688 }
689 
690 bool OnlineWalkingModule::setBalanceParamServiceCallback(thormang3_walking_module_msgs::SetBalanceParam::Request &req,
691  thormang3_walking_module_msgs::SetBalanceParam::Response &res)
692 {
694  res.result = thormang3_walking_module_msgs::SetBalanceParam::Response::NO_ERROR;
695 
696  if( enable_ == false)
697  res.result |= thormang3_walking_module_msgs::SetBalanceParam::Response::NOT_ENABLED_WALKING_MODULE;
698 
699  if( balance_update_with_loop_ == true)
700  {
701  res.result |= thormang3_walking_module_msgs::SetBalanceParam::Response::PREV_REQUEST_IS_NOT_FINISHED;
702  }
703 
704  if( (req.balance_param.roll_gyro_cut_off_frequency <= 0) ||
705  (req.balance_param.pitch_gyro_cut_off_frequency <= 0) ||
706  (req.balance_param.roll_angle_cut_off_frequency <= 0) ||
707  (req.balance_param.pitch_angle_cut_off_frequency <= 0) ||
708  (req.balance_param.foot_x_force_cut_off_frequency <= 0) ||
709  (req.balance_param.foot_y_force_cut_off_frequency <= 0) ||
710  (req.balance_param.foot_z_force_cut_off_frequency <= 0) ||
711  (req.balance_param.foot_roll_torque_cut_off_frequency <= 0) ||
712  (req.balance_param.foot_pitch_torque_cut_off_frequency <= 0) )
713  {
714  //res.result |= thormang3_walking_module_msgs::SetBalanceParam::Response::CUT_OFF_FREQUENCY_IS_ZERO_OR_NEGATIVE;
715  previous_balance_param_.roll_gyro_cut_off_frequency = req.balance_param.roll_gyro_cut_off_frequency;
716  previous_balance_param_.pitch_gyro_cut_off_frequency = req.balance_param.pitch_gyro_cut_off_frequency;
717  previous_balance_param_.roll_angle_cut_off_frequency = req.balance_param.roll_angle_cut_off_frequency;
718  previous_balance_param_.pitch_angle_cut_off_frequency = req.balance_param.pitch_angle_cut_off_frequency;
719  previous_balance_param_.foot_x_force_cut_off_frequency = req.balance_param.foot_x_force_cut_off_frequency;
720  previous_balance_param_.foot_y_force_cut_off_frequency = req.balance_param.foot_y_force_cut_off_frequency;
721  previous_balance_param_.foot_z_force_cut_off_frequency = req.balance_param.foot_z_force_cut_off_frequency;
722  previous_balance_param_.foot_roll_torque_cut_off_frequency = req.balance_param.foot_roll_torque_cut_off_frequency;
723  previous_balance_param_.foot_pitch_torque_cut_off_frequency = req.balance_param.foot_pitch_torque_cut_off_frequency;
724  }
725 
726  if(res.result != thormang3_walking_module_msgs::SetBalanceParam::Response::NO_ERROR)
727  {
728  publishDoneMsg("walking_balance_failed");
729  return true;
730  }
731 
732  if( req.updating_duration <= 0.0 )
733  {
734  // under 8ms apply immediately
735  setBalanceParam(req.balance_param);
737  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
738  publishDoneMsg("walking_balance");
739  return true;
740  }
741  else
742  {
743  balance_update_duration_ = req.updating_duration;
744  }
745 
748 
749  double tf = balance_update_duration_;
750  Eigen::MatrixXd A(6,6), B(6, 1);
751  A << 0.0, 0.0, 0.0, 0.0, 0.0, 1.0,
752  0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
753  0.0, 0.0, 0.0, 2.0, 0.0, 0.0,
754  tf*tf*tf*tf*tf, tf*tf*tf*tf, tf*tf*tf, tf*tf, tf, 1.0,
755  5.0*tf*tf*tf*tf, 4.0*tf*tf*tf, 3.0*tf*tf, 2.0*tf, 1.0, 0.0,
756  20.0*tf*tf*tf, 12.0*tf*tf, 6.0*tf, 2.0, 0.0, 0.0;
757 
758  B << 0, 0, 0, 1.0, 0, 0;
759  balance_update_polynomial_coeff_ = A.inverse() * B;
760 
761  desired_balance_param_ = req.balance_param;
762 
763  previous_balance_param_.cob_x_offset_m = online_walking->balance_ctrl_.getCOBManualAdjustmentX();
764  previous_balance_param_.cob_y_offset_m = online_walking->balance_ctrl_.getCOBManualAdjustmentY();
765 
766  previous_balance_param_.hip_roll_swap_angle_rad = online_walking->hip_roll_feedforward_angle_rad_;
767 
769  //gyro
770  previous_balance_param_.foot_roll_gyro_p_gain = online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.p_gain_;
771  previous_balance_param_.foot_roll_gyro_d_gain = online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.d_gain_;
772  previous_balance_param_.foot_pitch_gyro_p_gain = online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.p_gain_;
773  previous_balance_param_.foot_pitch_gyro_d_gain = online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.d_gain_;
774 
775  //orientation
776  previous_balance_param_.foot_roll_angle_p_gain = online_walking->balance_ctrl_.foot_roll_angle_ctrl_.p_gain_;
777  previous_balance_param_.foot_roll_angle_d_gain = online_walking->balance_ctrl_.foot_roll_angle_ctrl_.d_gain_;
778  previous_balance_param_.foot_pitch_angle_p_gain = online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.p_gain_;
779  previous_balance_param_.foot_pitch_angle_d_gain = online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.d_gain_;
780 
781  //force torque
782  previous_balance_param_.foot_x_force_p_gain = online_walking->balance_ctrl_.right_foot_force_x_ctrl_.p_gain_;
783  previous_balance_param_.foot_y_force_p_gain = online_walking->balance_ctrl_.right_foot_force_y_ctrl_.p_gain_;
784  previous_balance_param_.foot_z_force_p_gain = online_walking->balance_ctrl_.right_foot_force_z_ctrl_.p_gain_;
785  previous_balance_param_.foot_roll_torque_p_gain = online_walking->balance_ctrl_.right_foot_torque_roll_ctrl_.p_gain_;
786  previous_balance_param_.foot_pitch_torque_p_gain = online_walking->balance_ctrl_.right_foot_torque_pitch_ctrl_.p_gain_;
787 
788  previous_balance_param_.foot_x_force_d_gain = online_walking->balance_ctrl_.right_foot_force_x_ctrl_.d_gain_;
789  previous_balance_param_.foot_y_force_d_gain = online_walking->balance_ctrl_.right_foot_force_y_ctrl_.d_gain_;
790  previous_balance_param_.foot_z_force_d_gain = online_walking->balance_ctrl_.right_foot_force_z_ctrl_.d_gain_;
791  previous_balance_param_.foot_roll_torque_d_gain = online_walking->balance_ctrl_.right_foot_torque_roll_ctrl_.d_gain_;
792  previous_balance_param_.foot_pitch_torque_d_gain = online_walking->balance_ctrl_.right_foot_torque_pitch_ctrl_.d_gain_;
793 
795  //gyro
796  previous_balance_param_.roll_gyro_cut_off_frequency = online_walking->balance_ctrl_.roll_gyro_lpf_.getCutOffFrequency();
797  previous_balance_param_.pitch_gyro_cut_off_frequency = online_walking->balance_ctrl_.pitch_gyro_lpf_.getCutOffFrequency();
798 
799  //orientation
800  previous_balance_param_.roll_angle_cut_off_frequency = online_walking->balance_ctrl_.roll_angle_lpf_.getCutOffFrequency();
801  previous_balance_param_.pitch_angle_cut_off_frequency = online_walking->balance_ctrl_.pitch_angle_lpf_.getCutOffFrequency();
802 
803  //force torque
804  previous_balance_param_.foot_x_force_cut_off_frequency = online_walking->balance_ctrl_.right_foot_force_x_lpf_.getCutOffFrequency();
805  previous_balance_param_.foot_y_force_cut_off_frequency = online_walking->balance_ctrl_.right_foot_force_y_lpf_.getCutOffFrequency();
806  previous_balance_param_.foot_z_force_cut_off_frequency = online_walking->balance_ctrl_.right_foot_force_z_lpf_.getCutOffFrequency();
807  previous_balance_param_.foot_roll_torque_cut_off_frequency = online_walking->balance_ctrl_.right_foot_torque_roll_lpf_.getCutOffFrequency();
808  previous_balance_param_.foot_pitch_torque_cut_off_frequency = online_walking->balance_ctrl_.right_foot_torque_pitch_lpf_.getCutOffFrequency();
809 
811 
813  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
814 
815  return true;
816 }
817 
818 
819 void OnlineWalkingModule::setBalanceParam(thormang3_walking_module_msgs::BalanceParam& balance_param_msg)
820 {
822 
823  online_walking->hip_roll_feedforward_angle_rad_ = balance_param_msg.hip_roll_swap_angle_rad;
824 
825  online_walking->balance_ctrl_.setCOBManualAdjustment(balance_param_msg.cob_x_offset_m, balance_param_msg.cob_y_offset_m, 0);
826 
828  //gyro
829  online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.p_gain_ = balance_param_msg.foot_roll_gyro_p_gain;
830  online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.d_gain_ = balance_param_msg.foot_roll_gyro_d_gain;
831  online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.p_gain_ = balance_param_msg.foot_pitch_gyro_p_gain;
832  online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.d_gain_ = balance_param_msg.foot_pitch_gyro_d_gain;
833 
834  //orientation
835  online_walking->balance_ctrl_.foot_roll_angle_ctrl_.p_gain_ = balance_param_msg.foot_roll_angle_p_gain;
836  online_walking->balance_ctrl_.foot_roll_angle_ctrl_.d_gain_ = balance_param_msg.foot_roll_angle_d_gain;
837  online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.p_gain_ = balance_param_msg.foot_pitch_angle_p_gain;
838  online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.d_gain_ = balance_param_msg.foot_pitch_angle_d_gain;
839 
840  //force torque
841  online_walking->balance_ctrl_.right_foot_force_x_ctrl_.p_gain_ = balance_param_msg.foot_x_force_p_gain;
842  online_walking->balance_ctrl_.right_foot_force_y_ctrl_.p_gain_ = balance_param_msg.foot_y_force_p_gain;
843  online_walking->balance_ctrl_.right_foot_force_z_ctrl_.p_gain_ = balance_param_msg.foot_z_force_p_gain;
844  online_walking->balance_ctrl_.right_foot_torque_roll_ctrl_.p_gain_ = balance_param_msg.foot_roll_torque_p_gain;
845  online_walking->balance_ctrl_.right_foot_torque_pitch_ctrl_.p_gain_ = balance_param_msg.foot_roll_torque_p_gain;
846  online_walking->balance_ctrl_.right_foot_force_x_ctrl_.d_gain_ = balance_param_msg.foot_x_force_d_gain;
847  online_walking->balance_ctrl_.right_foot_force_y_ctrl_.d_gain_ = balance_param_msg.foot_y_force_d_gain;
848  online_walking->balance_ctrl_.right_foot_force_z_ctrl_.d_gain_ = balance_param_msg.foot_z_force_d_gain;
849  online_walking->balance_ctrl_.right_foot_torque_roll_ctrl_.d_gain_ = balance_param_msg.foot_roll_torque_d_gain;
850  online_walking->balance_ctrl_.right_foot_torque_pitch_ctrl_.d_gain_ = balance_param_msg.foot_roll_torque_d_gain;
851 
852  online_walking->balance_ctrl_.left_foot_force_x_ctrl_.p_gain_ = balance_param_msg.foot_x_force_p_gain;
853  online_walking->balance_ctrl_.left_foot_force_y_ctrl_.p_gain_ = balance_param_msg.foot_y_force_p_gain;
854  online_walking->balance_ctrl_.left_foot_force_z_ctrl_.p_gain_ = balance_param_msg.foot_z_force_p_gain;
855  online_walking->balance_ctrl_.left_foot_torque_roll_ctrl_.p_gain_ = balance_param_msg.foot_roll_torque_p_gain;
856  online_walking->balance_ctrl_.left_foot_torque_pitch_ctrl_.p_gain_ = balance_param_msg.foot_roll_torque_p_gain;
857  online_walking->balance_ctrl_.left_foot_force_x_ctrl_.d_gain_ = balance_param_msg.foot_x_force_d_gain;
858  online_walking->balance_ctrl_.left_foot_force_y_ctrl_.d_gain_ = balance_param_msg.foot_y_force_d_gain;
859  online_walking->balance_ctrl_.left_foot_force_z_ctrl_.d_gain_ = balance_param_msg.foot_z_force_d_gain;
860  online_walking->balance_ctrl_.left_foot_torque_roll_ctrl_.d_gain_ = balance_param_msg.foot_roll_torque_d_gain;
861  online_walking->balance_ctrl_.left_foot_torque_pitch_ctrl_.d_gain_ = balance_param_msg.foot_roll_torque_d_gain;
862 
864  online_walking->balance_ctrl_.roll_gyro_lpf_.setCutOffFrequency(balance_param_msg.roll_gyro_cut_off_frequency);
865  online_walking->balance_ctrl_.pitch_gyro_lpf_.setCutOffFrequency(balance_param_msg.pitch_gyro_cut_off_frequency);
866  online_walking->balance_ctrl_.roll_angle_lpf_.setCutOffFrequency(balance_param_msg.roll_angle_cut_off_frequency);
867  online_walking->balance_ctrl_.pitch_angle_lpf_.setCutOffFrequency(balance_param_msg.pitch_angle_cut_off_frequency);
868 
869  online_walking->balance_ctrl_.right_foot_force_x_lpf_.setCutOffFrequency(balance_param_msg.foot_x_force_cut_off_frequency);
870  online_walking->balance_ctrl_.right_foot_force_y_lpf_.setCutOffFrequency(balance_param_msg.foot_y_force_cut_off_frequency);
871  online_walking->balance_ctrl_.right_foot_force_z_lpf_.setCutOffFrequency(balance_param_msg.foot_z_force_cut_off_frequency);
872  online_walking->balance_ctrl_.right_foot_torque_roll_lpf_.setCutOffFrequency(balance_param_msg.foot_roll_torque_cut_off_frequency);
873  online_walking->balance_ctrl_.right_foot_torque_pitch_lpf_.setCutOffFrequency(balance_param_msg.foot_pitch_torque_cut_off_frequency);
874 
875  online_walking->balance_ctrl_.left_foot_force_x_lpf_.setCutOffFrequency(balance_param_msg.foot_x_force_cut_off_frequency);
876  online_walking->balance_ctrl_.left_foot_force_y_lpf_.setCutOffFrequency(balance_param_msg.foot_y_force_cut_off_frequency);
877  online_walking->balance_ctrl_.left_foot_force_z_lpf_.setCutOffFrequency(balance_param_msg.foot_z_force_cut_off_frequency);
878  online_walking->balance_ctrl_.left_foot_torque_roll_lpf_.setCutOffFrequency(balance_param_msg.foot_roll_torque_cut_off_frequency);
879  online_walking->balance_ctrl_.left_foot_torque_pitch_lpf_.setCutOffFrequency(balance_param_msg.foot_pitch_torque_cut_off_frequency);
880 }
881 
882 
884 {
885  double current_update_gain = balance_update_polynomial_coeff_.coeff(0,0) * robotis_framework::powDI(balance_update_sys_time_ , 5)
890  + balance_update_polynomial_coeff_.coeff(5,0) ;
891 
892  current_balance_param_.cob_x_offset_m = current_update_gain*(desired_balance_param_.cob_x_offset_m - previous_balance_param_.cob_x_offset_m ) + previous_balance_param_.cob_x_offset_m;
893  current_balance_param_.cob_y_offset_m = current_update_gain*(desired_balance_param_.cob_y_offset_m - previous_balance_param_.cob_y_offset_m ) + previous_balance_param_.cob_y_offset_m;
894 
895  current_balance_param_.hip_roll_swap_angle_rad = current_update_gain*(desired_balance_param_.hip_roll_swap_angle_rad - previous_balance_param_.hip_roll_swap_angle_rad ) + previous_balance_param_.hip_roll_swap_angle_rad;
896 
897  current_balance_param_.foot_roll_gyro_p_gain = current_update_gain*(desired_balance_param_.foot_roll_gyro_p_gain - previous_balance_param_.foot_roll_gyro_p_gain ) + previous_balance_param_.foot_roll_gyro_p_gain;
898  current_balance_param_.foot_roll_gyro_d_gain = current_update_gain*(desired_balance_param_.foot_roll_gyro_d_gain - previous_balance_param_.foot_roll_gyro_d_gain ) + previous_balance_param_.foot_roll_gyro_d_gain;
899  current_balance_param_.foot_pitch_gyro_p_gain = current_update_gain*(desired_balance_param_.foot_pitch_gyro_p_gain - previous_balance_param_.foot_pitch_gyro_p_gain ) + previous_balance_param_.foot_pitch_gyro_p_gain;
900  current_balance_param_.foot_pitch_gyro_d_gain = current_update_gain*(desired_balance_param_.foot_pitch_gyro_d_gain - previous_balance_param_.foot_pitch_gyro_d_gain ) + previous_balance_param_.foot_pitch_gyro_d_gain;
901  current_balance_param_.foot_roll_angle_p_gain = current_update_gain*(desired_balance_param_.foot_roll_angle_p_gain - previous_balance_param_.foot_roll_angle_p_gain ) + previous_balance_param_.foot_roll_angle_p_gain;
902  current_balance_param_.foot_roll_angle_d_gain = current_update_gain*(desired_balance_param_.foot_roll_angle_d_gain - previous_balance_param_.foot_roll_angle_d_gain ) + previous_balance_param_.foot_roll_angle_d_gain;
903  current_balance_param_.foot_pitch_angle_p_gain = current_update_gain*(desired_balance_param_.foot_pitch_angle_p_gain - previous_balance_param_.foot_pitch_angle_p_gain ) + previous_balance_param_.foot_pitch_angle_p_gain;
904  current_balance_param_.foot_pitch_angle_d_gain = current_update_gain*(desired_balance_param_.foot_pitch_angle_d_gain - previous_balance_param_.foot_pitch_angle_d_gain ) + previous_balance_param_.foot_pitch_angle_d_gain;
905  current_balance_param_.foot_x_force_p_gain = current_update_gain*(desired_balance_param_.foot_x_force_p_gain - previous_balance_param_.foot_x_force_p_gain ) + previous_balance_param_.foot_x_force_p_gain;
906  current_balance_param_.foot_y_force_p_gain = current_update_gain*(desired_balance_param_.foot_y_force_p_gain - previous_balance_param_.foot_y_force_p_gain ) + previous_balance_param_.foot_y_force_p_gain;
907  current_balance_param_.foot_z_force_p_gain = current_update_gain*(desired_balance_param_.foot_z_force_p_gain - previous_balance_param_.foot_z_force_p_gain ) + previous_balance_param_.foot_z_force_p_gain;
908  current_balance_param_.foot_roll_torque_p_gain = current_update_gain*(desired_balance_param_.foot_roll_torque_p_gain - previous_balance_param_.foot_roll_torque_p_gain ) + previous_balance_param_.foot_roll_torque_p_gain;
909  current_balance_param_.foot_pitch_torque_p_gain = current_update_gain*(desired_balance_param_.foot_pitch_torque_p_gain - previous_balance_param_.foot_pitch_torque_p_gain ) + previous_balance_param_.foot_pitch_torque_p_gain;
910  current_balance_param_.foot_x_force_d_gain = current_update_gain*(desired_balance_param_.foot_x_force_d_gain - previous_balance_param_.foot_x_force_d_gain ) + previous_balance_param_.foot_x_force_d_gain;
911  current_balance_param_.foot_y_force_d_gain = current_update_gain*(desired_balance_param_.foot_y_force_d_gain - previous_balance_param_.foot_y_force_d_gain ) + previous_balance_param_.foot_y_force_d_gain;
912  current_balance_param_.foot_z_force_d_gain = current_update_gain*(desired_balance_param_.foot_z_force_d_gain - previous_balance_param_.foot_z_force_d_gain ) + previous_balance_param_.foot_z_force_d_gain;
913  current_balance_param_.foot_roll_torque_d_gain = current_update_gain*(desired_balance_param_.foot_roll_torque_d_gain - previous_balance_param_.foot_roll_torque_d_gain ) + previous_balance_param_.foot_roll_torque_d_gain;
914  current_balance_param_.foot_pitch_torque_d_gain = current_update_gain*(desired_balance_param_.foot_pitch_torque_d_gain - previous_balance_param_.foot_pitch_torque_d_gain ) + previous_balance_param_.foot_pitch_torque_d_gain;
915 
916  current_balance_param_.roll_gyro_cut_off_frequency = current_update_gain*(desired_balance_param_.roll_gyro_cut_off_frequency - previous_balance_param_.roll_gyro_cut_off_frequency ) + previous_balance_param_.roll_gyro_cut_off_frequency;
917  current_balance_param_.pitch_gyro_cut_off_frequency = current_update_gain*(desired_balance_param_.pitch_gyro_cut_off_frequency - previous_balance_param_.pitch_gyro_cut_off_frequency ) + previous_balance_param_.pitch_gyro_cut_off_frequency;
918  current_balance_param_.roll_angle_cut_off_frequency = current_update_gain*(desired_balance_param_.roll_angle_cut_off_frequency - previous_balance_param_.roll_angle_cut_off_frequency ) + previous_balance_param_.roll_angle_cut_off_frequency;
919  current_balance_param_.pitch_angle_cut_off_frequency = current_update_gain*(desired_balance_param_.pitch_angle_cut_off_frequency - previous_balance_param_.pitch_angle_cut_off_frequency ) + previous_balance_param_.pitch_angle_cut_off_frequency;
920  current_balance_param_.foot_x_force_cut_off_frequency = current_update_gain*(desired_balance_param_.foot_x_force_cut_off_frequency - previous_balance_param_.foot_x_force_cut_off_frequency ) + previous_balance_param_.foot_x_force_cut_off_frequency;
921  current_balance_param_.foot_y_force_cut_off_frequency = current_update_gain*(desired_balance_param_.foot_y_force_cut_off_frequency - previous_balance_param_.foot_y_force_cut_off_frequency ) + previous_balance_param_.foot_y_force_cut_off_frequency;
922  current_balance_param_.foot_z_force_cut_off_frequency = current_update_gain*(desired_balance_param_.foot_z_force_cut_off_frequency - previous_balance_param_.foot_z_force_cut_off_frequency ) + previous_balance_param_.foot_z_force_cut_off_frequency;
923  current_balance_param_.foot_roll_torque_cut_off_frequency = current_update_gain*(desired_balance_param_.foot_roll_torque_cut_off_frequency - previous_balance_param_.foot_roll_torque_cut_off_frequency ) + previous_balance_param_.foot_roll_torque_cut_off_frequency;
924  current_balance_param_.foot_pitch_torque_cut_off_frequency = current_update_gain*(desired_balance_param_.foot_pitch_torque_cut_off_frequency - previous_balance_param_.foot_pitch_torque_cut_off_frequency) + previous_balance_param_.foot_pitch_torque_cut_off_frequency;
925 
927 }
928 
929 
930 void OnlineWalkingModule::setJointFeedBackGain(thormang3_walking_module_msgs::JointFeedBackGain& msg)
931 {
933  online_walking->leg_angle_feed_back_[0].p_gain_ = msg.r_leg_hip_y_p_gain ;
934  online_walking->leg_angle_feed_back_[0].d_gain_ = msg.r_leg_hip_y_d_gain ;
935  online_walking->leg_angle_feed_back_[1].p_gain_ = msg.r_leg_hip_r_p_gain ;
936  online_walking->leg_angle_feed_back_[1].d_gain_ = msg.r_leg_hip_r_d_gain ;
937  online_walking->leg_angle_feed_back_[2].p_gain_ = msg.r_leg_hip_p_p_gain ;
938  online_walking->leg_angle_feed_back_[2].d_gain_ = msg.r_leg_hip_p_d_gain ;
939  online_walking->leg_angle_feed_back_[3].p_gain_ = msg.r_leg_kn_p_p_gain ;
940  online_walking->leg_angle_feed_back_[3].d_gain_ = msg.r_leg_kn_p_d_gain ;
941  online_walking->leg_angle_feed_back_[4].p_gain_ = msg.r_leg_an_p_p_gain ;
942  online_walking->leg_angle_feed_back_[4].d_gain_ = msg.r_leg_an_p_d_gain ;
943  online_walking->leg_angle_feed_back_[5].p_gain_ = msg.r_leg_an_r_p_gain ;
944  online_walking->leg_angle_feed_back_[5].d_gain_ = msg.r_leg_an_r_d_gain ;
945 
946  online_walking->leg_angle_feed_back_[6].p_gain_ = msg.l_leg_hip_y_p_gain ;
947  online_walking->leg_angle_feed_back_[6].d_gain_ = msg.l_leg_hip_y_d_gain ;
948  online_walking->leg_angle_feed_back_[7].p_gain_ = msg.l_leg_hip_r_p_gain ;
949  online_walking->leg_angle_feed_back_[7].d_gain_ = msg.l_leg_hip_r_d_gain ;
950  online_walking->leg_angle_feed_back_[8].p_gain_ = msg.l_leg_hip_p_p_gain ;
951  online_walking->leg_angle_feed_back_[8].d_gain_ = msg.l_leg_hip_p_d_gain ;
952  online_walking->leg_angle_feed_back_[9].p_gain_ = msg.l_leg_kn_p_p_gain ;
953  online_walking->leg_angle_feed_back_[9].d_gain_ = msg.l_leg_kn_p_d_gain ;
954  online_walking->leg_angle_feed_back_[10].p_gain_ = msg.l_leg_an_p_p_gain ;
955  online_walking->leg_angle_feed_back_[10].d_gain_ = msg.l_leg_an_p_d_gain ;
956  online_walking->leg_angle_feed_back_[11].p_gain_ = msg.l_leg_an_r_p_gain ;
957  online_walking->leg_angle_feed_back_[11].d_gain_ = msg.l_leg_an_r_d_gain ;
958 }
959 
960 
962 {
969 
970 
971  current_joint_feedback_gain_.r_leg_hip_y_p_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_hip_y_p_gain - previous_joint_feedback_gain_.r_leg_hip_y_p_gain ) + previous_joint_feedback_gain_.r_leg_hip_y_p_gain ;
972  current_joint_feedback_gain_.r_leg_hip_y_d_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_hip_y_d_gain - previous_joint_feedback_gain_.r_leg_hip_y_d_gain ) + previous_joint_feedback_gain_.r_leg_hip_y_d_gain ;
973  current_joint_feedback_gain_.r_leg_hip_r_p_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_hip_r_p_gain - previous_joint_feedback_gain_.r_leg_hip_r_p_gain ) + previous_joint_feedback_gain_.r_leg_hip_r_p_gain ;
974  current_joint_feedback_gain_.r_leg_hip_r_d_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_hip_r_d_gain - previous_joint_feedback_gain_.r_leg_hip_r_d_gain ) + previous_joint_feedback_gain_.r_leg_hip_r_d_gain ;
975  current_joint_feedback_gain_.r_leg_hip_p_p_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_hip_p_p_gain - previous_joint_feedback_gain_.r_leg_hip_p_p_gain ) + previous_joint_feedback_gain_.r_leg_hip_p_p_gain ;
976  current_joint_feedback_gain_.r_leg_hip_p_d_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_hip_p_d_gain - previous_joint_feedback_gain_.r_leg_hip_p_d_gain ) + previous_joint_feedback_gain_.r_leg_hip_p_d_gain ;
977  current_joint_feedback_gain_.r_leg_kn_p_p_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_kn_p_p_gain - previous_joint_feedback_gain_.r_leg_kn_p_p_gain ) + previous_joint_feedback_gain_.r_leg_kn_p_p_gain ;
978  current_joint_feedback_gain_.r_leg_kn_p_d_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_kn_p_d_gain - previous_joint_feedback_gain_.r_leg_kn_p_d_gain ) + previous_joint_feedback_gain_.r_leg_kn_p_d_gain ;
979  current_joint_feedback_gain_.r_leg_an_p_p_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_an_p_p_gain - previous_joint_feedback_gain_.r_leg_an_p_p_gain ) + previous_joint_feedback_gain_.r_leg_an_p_p_gain ;
980  current_joint_feedback_gain_.r_leg_an_p_d_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_an_p_d_gain - previous_joint_feedback_gain_.r_leg_an_p_d_gain ) + previous_joint_feedback_gain_.r_leg_an_p_d_gain ;
981  current_joint_feedback_gain_.r_leg_an_r_p_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_an_r_p_gain - previous_joint_feedback_gain_.r_leg_an_r_p_gain ) + previous_joint_feedback_gain_.r_leg_an_r_p_gain ;
982  current_joint_feedback_gain_.r_leg_an_r_d_gain = current_update_gain*(desired_joint_feedback_gain_.r_leg_an_r_d_gain - previous_joint_feedback_gain_.r_leg_an_r_d_gain ) + previous_joint_feedback_gain_.r_leg_an_r_d_gain ;
983 
984  current_joint_feedback_gain_.l_leg_hip_y_p_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_hip_y_p_gain - previous_joint_feedback_gain_.l_leg_hip_y_p_gain ) + previous_joint_feedback_gain_.l_leg_hip_y_p_gain ;
985  current_joint_feedback_gain_.l_leg_hip_y_d_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_hip_y_d_gain - previous_joint_feedback_gain_.l_leg_hip_y_d_gain ) + previous_joint_feedback_gain_.l_leg_hip_y_d_gain ;
986  current_joint_feedback_gain_.l_leg_hip_r_p_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_hip_r_p_gain - previous_joint_feedback_gain_.l_leg_hip_r_p_gain ) + previous_joint_feedback_gain_.l_leg_hip_r_p_gain ;
987  current_joint_feedback_gain_.l_leg_hip_r_d_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_hip_r_d_gain - previous_joint_feedback_gain_.l_leg_hip_r_d_gain ) + previous_joint_feedback_gain_.l_leg_hip_r_d_gain ;
988  current_joint_feedback_gain_.l_leg_hip_p_p_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_hip_p_p_gain - previous_joint_feedback_gain_.l_leg_hip_p_p_gain ) + previous_joint_feedback_gain_.l_leg_hip_p_p_gain ;
989  current_joint_feedback_gain_.l_leg_hip_p_d_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_hip_p_d_gain - previous_joint_feedback_gain_.l_leg_hip_p_d_gain ) + previous_joint_feedback_gain_.l_leg_hip_p_d_gain ;
990  current_joint_feedback_gain_.l_leg_kn_p_p_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_kn_p_p_gain - previous_joint_feedback_gain_.l_leg_kn_p_p_gain ) + previous_joint_feedback_gain_.l_leg_kn_p_p_gain ;
991  current_joint_feedback_gain_.l_leg_kn_p_d_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_kn_p_d_gain - previous_joint_feedback_gain_.l_leg_kn_p_d_gain ) + previous_joint_feedback_gain_.l_leg_kn_p_d_gain ;
992  current_joint_feedback_gain_.l_leg_an_p_p_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_an_p_p_gain - previous_joint_feedback_gain_.l_leg_an_p_p_gain ) + previous_joint_feedback_gain_.l_leg_an_p_p_gain ;
993  current_joint_feedback_gain_.l_leg_an_p_d_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_an_p_d_gain - previous_joint_feedback_gain_.l_leg_an_p_d_gain ) + previous_joint_feedback_gain_.l_leg_an_p_d_gain ;
994  current_joint_feedback_gain_.l_leg_an_r_p_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_an_r_p_gain - previous_joint_feedback_gain_.l_leg_an_r_p_gain ) + previous_joint_feedback_gain_.l_leg_an_r_p_gain ;
995  current_joint_feedback_gain_.l_leg_an_r_d_gain = current_update_gain*(desired_joint_feedback_gain_.l_leg_an_r_d_gain - previous_joint_feedback_gain_.l_leg_an_r_d_gain ) + previous_joint_feedback_gain_.l_leg_an_r_d_gain ;
996 
997 
999 }
1000 
1001 
1003 {
1004  if(gazebo_)
1005  return true;
1006 
1008 
1009  if ((fabs(online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.p_gain_ ) < 1e-7) &&
1010  (fabs(online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.d_gain_ ) < 1e-7) &&
1011  (fabs(online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.p_gain_ ) < 1e-7) &&
1012  (fabs(online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.d_gain_ ) < 1e-7) &&
1013  (fabs(online_walking->balance_ctrl_.foot_roll_angle_ctrl_.p_gain_ ) < 1e-7) &&
1014  (fabs(online_walking->balance_ctrl_.foot_roll_angle_ctrl_.d_gain_ ) < 1e-7) &&
1015  (fabs(online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.p_gain_ ) < 1e-7) &&
1016  (fabs(online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.d_gain_ ) < 1e-7) &&
1017  (fabs(online_walking->balance_ctrl_.right_foot_force_x_ctrl_.p_gain_ ) < 1e-7) &&
1018  (fabs(online_walking->balance_ctrl_.right_foot_force_y_ctrl_.p_gain_ ) < 1e-7) &&
1019  (fabs(online_walking->balance_ctrl_.right_foot_force_z_ctrl_.p_gain_ ) < 1e-7) &&
1020  (fabs(online_walking->balance_ctrl_.right_foot_torque_roll_ctrl_.p_gain_ ) < 1e-7) &&
1021  (fabs(online_walking->balance_ctrl_.right_foot_torque_pitch_ctrl_.p_gain_ ) < 1e-7) &&
1022  (fabs(online_walking->balance_ctrl_.right_foot_force_x_ctrl_.d_gain_ ) < 1e-7) &&
1023  (fabs(online_walking->balance_ctrl_.right_foot_force_y_ctrl_.d_gain_ ) < 1e-7) &&
1024  (fabs(online_walking->balance_ctrl_.right_foot_force_z_ctrl_.d_gain_ ) < 1e-7) &&
1025  (fabs(online_walking->balance_ctrl_.right_foot_torque_roll_ctrl_.d_gain_ ) < 1e-7) &&
1026  (fabs(online_walking->balance_ctrl_.right_foot_torque_pitch_ctrl_.d_gain_ ) < 1e-7) &&
1027  (fabs(online_walking->balance_ctrl_.left_foot_force_x_ctrl_.p_gain_ ) < 1e-7) &&
1028  (fabs(online_walking->balance_ctrl_.left_foot_force_y_ctrl_.p_gain_ ) < 1e-7) &&
1029  (fabs(online_walking->balance_ctrl_.left_foot_force_z_ctrl_.p_gain_ ) < 1e-7) &&
1030  (fabs(online_walking->balance_ctrl_.left_foot_torque_roll_ctrl_.p_gain_ ) < 1e-7) &&
1031  (fabs(online_walking->balance_ctrl_.left_foot_torque_pitch_ctrl_.p_gain_ ) < 1e-7) &&
1032  (fabs(online_walking->balance_ctrl_.left_foot_force_x_ctrl_.d_gain_ ) < 1e-7) &&
1033  (fabs(online_walking->balance_ctrl_.left_foot_force_y_ctrl_.d_gain_ ) < 1e-7) &&
1034  (fabs(online_walking->balance_ctrl_.left_foot_force_z_ctrl_.d_gain_ ) < 1e-7) &&
1035  (fabs(online_walking->balance_ctrl_.left_foot_torque_roll_ctrl_.d_gain_ ) < 1e-7) &&
1036  (fabs(online_walking->balance_ctrl_.left_foot_torque_pitch_ctrl_.d_gain_ ) < 1e-7))
1037  {
1038  return false;
1039  }
1040  else
1041  return true;
1042 }
1043 
1044 
1045 bool OnlineWalkingModule::removeExistingStepDataServiceCallback(thormang3_walking_module_msgs::RemoveExistingStepData::Request &req,
1046  thormang3_walking_module_msgs::RemoveExistingStepData::Response &res)
1047 {
1049 
1050  res.result = thormang3_walking_module_msgs::RemoveExistingStepData::Response::NO_ERROR;
1051 
1052  if(isRunning())
1053  {
1054  res.result |= thormang3_walking_module_msgs::RemoveExistingStepData::Response::ROBOT_IS_WALKING_NOW;
1055  }
1056  else
1057  {
1058  int exist_num_of_step_data = online_walking->getNumofRemainingUnreservedStepData();
1059  if(exist_num_of_step_data != 0)
1060  for(int remove_count = 0; remove_count < exist_num_of_step_data; remove_count++)
1061  online_walking->eraseLastStepData();
1062  }
1063  return true;
1064 }
1065 
1066 
1067 void OnlineWalkingModule::imuDataOutputCallback(const sensor_msgs::Imu::ConstPtr &msg)
1068 {
1070 
1071  online_walking->setCurrentIMUSensorOutput(-1.0*(msg->angular_velocity.x), -1.0*(msg->angular_velocity.y),
1072  msg->orientation.x, msg->orientation.y, msg->orientation.z,
1073  msg->orientation.w);
1074 }
1075 
1076 
1078 {
1079  std::string status_msg = WalkingStatusMSG::WALKING_MODULE_IS_ENABLED_MSG;
1080  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
1081 }
1082 
1083 
1085 {
1087 
1089  std::string status_msg = WalkingStatusMSG::WALKING_MODULE_IS_DISABLED_MSG;
1090  balance_update_with_loop_ = false;
1091 
1092 
1093  online_walking->leg_angle_feed_back_[0].p_gain_ = 0;
1094  online_walking->leg_angle_feed_back_[0].d_gain_ = 0;
1095  online_walking->leg_angle_feed_back_[1].p_gain_ = 0;
1096  online_walking->leg_angle_feed_back_[1].d_gain_ = 0;
1097  online_walking->leg_angle_feed_back_[2].p_gain_ = 0;
1098  online_walking->leg_angle_feed_back_[2].d_gain_ = 0;
1099  online_walking->leg_angle_feed_back_[3].p_gain_ = 0;
1100  online_walking->leg_angle_feed_back_[3].d_gain_ = 0;
1101  online_walking->leg_angle_feed_back_[4].p_gain_ = 0;
1102  online_walking->leg_angle_feed_back_[4].d_gain_ = 0;
1103  online_walking->leg_angle_feed_back_[5].p_gain_ = 0;
1104  online_walking->leg_angle_feed_back_[5].d_gain_ = 0;
1105 
1106  online_walking->leg_angle_feed_back_[6].p_gain_ = 0;
1107  online_walking->leg_angle_feed_back_[6].d_gain_ = 0;
1108  online_walking->leg_angle_feed_back_[7].p_gain_ = 0;
1109  online_walking->leg_angle_feed_back_[7].d_gain_ = 0;
1110  online_walking->leg_angle_feed_back_[8].p_gain_ = 0;
1111  online_walking->leg_angle_feed_back_[8].d_gain_ = 0;
1112  online_walking->leg_angle_feed_back_[9].p_gain_ = 0;
1113  online_walking->leg_angle_feed_back_[9].d_gain_ = 0;
1114  online_walking->leg_angle_feed_back_[10].p_gain_ = 0;
1115  online_walking->leg_angle_feed_back_[10].d_gain_ = 0;
1116  online_walking->leg_angle_feed_back_[11].p_gain_ = 0;
1117  online_walking->leg_angle_feed_back_[11].d_gain_ = 0;
1118 
1119  online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.p_gain_ = 0;
1120  online_walking->balance_ctrl_.foot_roll_gyro_ctrl_.d_gain_ = 0;
1121  online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.p_gain_ = 0;
1122  online_walking->balance_ctrl_.foot_pitch_gyro_ctrl_.d_gain_ = 0;
1123  online_walking->balance_ctrl_.foot_roll_angle_ctrl_.p_gain_ = 0;
1124  online_walking->balance_ctrl_.foot_roll_angle_ctrl_.d_gain_ = 0;
1125  online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.p_gain_ = 0;
1126  online_walking->balance_ctrl_.foot_pitch_angle_ctrl_.d_gain_ = 0;
1127  online_walking->balance_ctrl_.right_foot_force_x_ctrl_.p_gain_ = 0;
1128  online_walking->balance_ctrl_.right_foot_force_y_ctrl_.p_gain_ = 0;
1129  online_walking->balance_ctrl_.right_foot_force_z_ctrl_.p_gain_ = 0;
1132  online_walking->balance_ctrl_.right_foot_force_x_ctrl_.d_gain_ = 0;
1133  online_walking->balance_ctrl_.right_foot_force_y_ctrl_.d_gain_ = 0;
1134  online_walking->balance_ctrl_.right_foot_force_z_ctrl_.d_gain_ = 0;
1137  online_walking->balance_ctrl_.left_foot_force_x_ctrl_.p_gain_ = 0;
1138  online_walking->balance_ctrl_.left_foot_force_y_ctrl_.p_gain_ = 0;
1139  online_walking->balance_ctrl_.left_foot_force_z_ctrl_.p_gain_ = 0;
1142  online_walking->balance_ctrl_.left_foot_force_x_ctrl_.d_gain_ = 0;
1143  online_walking->balance_ctrl_.left_foot_force_y_ctrl_.d_gain_ = 0;
1144  online_walking->balance_ctrl_.left_foot_force_z_ctrl_.d_gain_ = 0;
1147 
1148  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
1149 }
1150 
1151 void OnlineWalkingModule::process(std::map<std::string, robotis_framework::Dynamixel *> dxls, std::map<std::string, double> sensors)
1152 {
1153  if(enable_ == false)
1154  return;
1155 
1157 
1158  r_foot_fx_N_ = sensors["r_foot_fx_scaled_N"];
1159  r_foot_fy_N_ = sensors["r_foot_fy_scaled_N"];
1160  r_foot_fz_N_ = sensors["r_foot_fz_scaled_N"];
1161  r_foot_Tx_Nm_ = sensors["r_foot_tx_scaled_Nm"];
1162  r_foot_Ty_Nm_ = sensors["r_foot_ty_scaled_Nm"];
1163  r_foot_Tz_Nm_ = sensors["r_foot_tz_scaled_Nm"];
1164 
1165  l_foot_fx_N_ = sensors["l_foot_fx_scaled_N"];
1166  l_foot_fy_N_ = sensors["l_foot_fy_scaled_N"];
1167  l_foot_fz_N_ = sensors["l_foot_fz_scaled_N"];
1168  l_foot_Tx_Nm_ = sensors["l_foot_tx_scaled_Nm"];
1169  l_foot_Ty_Nm_ = sensors["l_foot_ty_scaled_Nm"];
1170  l_foot_Tz_Nm_ = sensors["l_foot_tz_scaled_Nm"];
1171 
1172 
1179 
1186 
1187 
1188  if(balance_update_with_loop_ == true)
1189  {
1192  {
1194  balance_update_with_loop_ = false;
1197  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
1198  publishDoneMsg("walking_balance");
1199  }
1200  else
1201  {
1203  }
1204  }
1205 
1207  {
1210  {
1214  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, WalkingStatusMSG::JOINT_FEEDBACK_GAIN_UPDATE_FINISHED_MSG);
1215  publishDoneMsg("walking_joint_feedback");
1216  }
1217  else
1218  {
1220  }
1221  }
1222 
1223  online_walking->current_right_fx_N_ = r_foot_fx_N_;
1224  online_walking->current_right_fy_N_ = r_foot_fy_N_;
1225  online_walking->current_right_fz_N_ = r_foot_fz_N_;
1226  online_walking->current_right_tx_Nm_ = r_foot_Tx_Nm_;
1227  online_walking->current_right_ty_Nm_ = r_foot_Ty_Nm_;
1228  online_walking->current_right_tz_Nm_ = r_foot_Tz_Nm_;
1229 
1230  online_walking->current_left_fx_N_ = l_foot_fx_N_;
1231  online_walking->current_left_fy_N_ = l_foot_fy_N_;
1232  online_walking->current_left_fz_N_ = l_foot_fz_N_;
1233  online_walking->current_left_tx_Nm_ = l_foot_Tx_Nm_;
1234  online_walking->current_left_ty_Nm_ = l_foot_Ty_Nm_;
1235  online_walking->current_left_tz_Nm_ = l_foot_Tz_Nm_;
1236 
1237  online_walking->curr_angle_rad_[0] = result_["r_leg_hip_y"]->goal_position_;
1238  online_walking->curr_angle_rad_[1] = result_["r_leg_hip_r"]->goal_position_;
1239  online_walking->curr_angle_rad_[2] = result_["r_leg_hip_p"]->goal_position_;
1240  online_walking->curr_angle_rad_[3] = result_["r_leg_kn_p" ]->goal_position_;
1241  online_walking->curr_angle_rad_[4] = result_["r_leg_an_p" ]->goal_position_;
1242  online_walking->curr_angle_rad_[5] = result_["r_leg_an_r" ]->goal_position_;
1243 
1244  online_walking->curr_angle_rad_[6] = result_["l_leg_hip_y"]->goal_position_;
1245  online_walking->curr_angle_rad_[7] = result_["l_leg_hip_r"]->goal_position_;
1246  online_walking->curr_angle_rad_[8] = result_["l_leg_hip_p"]->goal_position_;
1247  online_walking->curr_angle_rad_[9] = result_["l_leg_kn_p" ]->goal_position_;
1248  online_walking->curr_angle_rad_[10] = result_["l_leg_an_p" ]->goal_position_;
1249  online_walking->curr_angle_rad_[11] = result_["l_leg_an_r" ]->goal_position_;
1250 
1251  for(std::map<std::string, robotis_framework::DynamixelState*>::iterator result_it = result_.begin();
1252  result_it != result_.end();
1253  result_it++)
1254  {
1255  std::map<std::string, robotis_framework::Dynamixel*>::iterator dxls_it = dxls.find(result_it->first);
1256  if(dxls_it != dxls.end())
1257  online_walking->curr_angle_rad_[joint_name_to_index_[result_it->first]] = dxls_it->second->dxl_state_->present_position_;
1258  }
1259 
1260  process_mutex_.lock();
1261  online_walking->process();
1262 
1263  desired_matrix_g_to_cob_ = online_walking->mat_g_to_cob_;
1264  desired_matrix_g_to_rfoot_ = online_walking->mat_g_to_rfoot_;
1265  desired_matrix_g_to_lfoot_ = online_walking->mat_g_to_lfoot_;
1266  process_mutex_.unlock();
1267 
1268  publishRobotPose();
1269 
1270  result_["r_leg_hip_y"]->goal_position_ = online_walking->out_angle_rad_[0];
1271  result_["r_leg_hip_r"]->goal_position_ = online_walking->out_angle_rad_[1];
1272  result_["r_leg_hip_p"]->goal_position_ = online_walking->out_angle_rad_[2];
1273  result_["r_leg_kn_p" ]->goal_position_ = online_walking->out_angle_rad_[3];
1274  result_["r_leg_an_p" ]->goal_position_ = online_walking->out_angle_rad_[4];
1275  result_["r_leg_an_r" ]->goal_position_ = online_walking->out_angle_rad_[5];
1276 
1277  result_["l_leg_hip_y"]->goal_position_ = online_walking->out_angle_rad_[6];
1278  result_["l_leg_hip_r"]->goal_position_ = online_walking->out_angle_rad_[7];
1279  result_["l_leg_hip_p"]->goal_position_ = online_walking->out_angle_rad_[8];
1280  result_["l_leg_kn_p" ]->goal_position_ = online_walking->out_angle_rad_[9];
1281  result_["l_leg_an_p" ]->goal_position_ = online_walking->out_angle_rad_[10];
1282  result_["l_leg_an_r" ]->goal_position_ = online_walking->out_angle_rad_[11];
1283 
1284 #ifdef WALKING_TUNE
1285  walking_joint_states_msg_.header.stamp = ros::Time::now();
1286  walking_joint_states_msg_.r_goal_hip_y = online_walking->r_leg_out_angle_rad_[0];
1287  walking_joint_states_msg_.r_goal_hip_r = online_walking->r_leg_out_angle_rad_[1];
1288  walking_joint_states_msg_.r_goal_hip_p = online_walking->r_leg_out_angle_rad_[2];
1289  walking_joint_states_msg_.r_goal_kn_p = online_walking->r_leg_out_angle_rad_[3];
1290  walking_joint_states_msg_.r_goal_an_p = online_walking->r_leg_out_angle_rad_[4];
1291  walking_joint_states_msg_.r_goal_an_r = online_walking->r_leg_out_angle_rad_[5];
1292  walking_joint_states_msg_.l_goal_hip_y = online_walking->l_leg_out_angle_rad_[0];
1293  walking_joint_states_msg_.l_goal_hip_r = online_walking->l_leg_out_angle_rad_[1];
1294  walking_joint_states_msg_.l_goal_hip_p = online_walking->l_leg_out_angle_rad_[2];
1295  walking_joint_states_msg_.l_goal_kn_p = online_walking->l_leg_out_angle_rad_[3];
1296  walking_joint_states_msg_.l_goal_an_p = online_walking->l_leg_out_angle_rad_[4];
1297  walking_joint_states_msg_.l_goal_an_r = online_walking->l_leg_out_angle_rad_[5];
1298 
1299  walking_joint_states_msg_.r_present_hip_y = online_walking->curr_angle_rad_[0];
1300  walking_joint_states_msg_.r_present_hip_r = online_walking->curr_angle_rad_[1];
1301  walking_joint_states_msg_.r_present_hip_p = online_walking->curr_angle_rad_[2];
1302  walking_joint_states_msg_.r_present_kn_p = online_walking->curr_angle_rad_[3];
1303  walking_joint_states_msg_.r_present_an_p = online_walking->curr_angle_rad_[4];
1304  walking_joint_states_msg_.r_present_an_r = online_walking->curr_angle_rad_[5];
1305  walking_joint_states_msg_.l_present_hip_y = online_walking->curr_angle_rad_[6];
1306  walking_joint_states_msg_.l_present_hip_r = online_walking->curr_angle_rad_[7];
1307  walking_joint_states_msg_.l_present_hip_p = online_walking->curr_angle_rad_[8];
1308  walking_joint_states_msg_.l_present_kn_p = online_walking->curr_angle_rad_[9];
1309  walking_joint_states_msg_.l_present_an_p = online_walking->curr_angle_rad_[10];
1310  walking_joint_states_msg_.l_present_an_r = online_walking->curr_angle_rad_[11];
1312 #endif
1313 
1316  {
1317  if(present_running == true)
1318  {
1319  std::string status_msg = WalkingStatusMSG::WALKING_START_MSG;
1320  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
1321  }
1322  else
1323  {
1324  std::string status_msg = WalkingStatusMSG::WALKING_FINISH_MSG;
1325  publishStatusMsg(robotis_controller_msgs::StatusMsg::STATUS_INFO, status_msg);
1326  publishDoneMsg("walking_completed");
1327  }
1328  }
1330 }
1331 
1333 {
1334  return;
1335 }
static const std::string WALKING_MODULE_IS_DISABLED_MSG
static const int STANDING
ros::Publisher walking_joint_states_pub_
BalanceLowPassFilter right_foot_torque_pitch_lpf_
std::map< std::string, DynamixelState * > result_
void getReferenceStepDatafotAddition(robotis_framework::StepData *ref_step_data_for_addition)
static const int IN_WALKING_STARTING
void setBalanceParam(thormang3_walking_module_msgs::BalanceParam &balance_param_msg)
void process(std::map< std::string, robotis_framework::Dynamixel * > dxls, std::map< std::string, double > sensors)
void publish(const boost::shared_ptr< M > &message) const
BalanceLowPassFilter left_foot_torque_roll_lpf_
static const int RIGHT_FOOT_SWING
bool addStepDataServiceCallback(thormang3_walking_module_msgs::AddStepDataArray::Request &req, thormang3_walking_module_msgs::AddStepDataArray::Response &res)
thormang3_walking_module_msgs::BalanceParam current_balance_param_
BalanceLowPassFilter left_foot_torque_pitch_lpf_
void quaternionEigenToMsg(const Eigen::Quaterniond &e, geometry_msgs::Quaternion &m)
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
double sign(double x)
thormang3_walking_module_msgs::BalanceParam desired_balance_param_
void initialize(const int control_cycle_msec, robotis_framework::Robot *robot)
static const int IN_WALKING
thormang3_walking_module_msgs::JointFeedBackGain desired_joint_feedback_gain_
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
thormang3::BalanceControlUsingPDController balance_ctrl_
StepPositionData position_data
thormang3_walking_module_msgs::BalanceParam previous_balance_param_
static const std::string JOINT_FEEDBACK_GAIN_UPDATE_FINISHED_MSG
void setJointFeedBackGain(thormang3_walking_module_msgs::JointFeedBackGain &msg)
bool setInitialPose(double r_foot_x, double r_foot_y, double r_foot_z, double r_foot_roll, double r_foot_pitch, double r_foot_yaw, double l_foot_x, double l_foot_y, double l_foot_z, double l_foot_roll, double l_foot_pitch, double l_foot_yaw, double center_of_body_x, double center_of_body_y, double center_of_body_z, double center_of_body_roll, double center_of_body_pitch, double center_of_body_yaw)
int convertStepDataToStepDataMsg(robotis_framework::StepData &src, thormang3_walking_module_msgs::StepData &des)
thormang3_walking_module_msgs::JointFeedBackGain current_joint_feedback_gain_
thormang3_walking_module_msgs::WalkingJointStatesStamped walking_joint_states_msg_
void setCurrentIMUSensorOutput(double gyro_x, double gyro_y, double quat_x, double quat_y, double quat_z, double quat_w)
void publishStatusMsg(unsigned int type, std::string msg)
static const std::string BALANCE_HAS_BEEN_TURNED_OFF
ROSCPP_DECL bool get(const std::string &key, std::string &s)
void setCallbackQueue(CallbackQueueInterface *queue)
static const int IN_WALKING_ENDING
void setCutOffFrequency(double cut_off_frequency)
bool startWalkingServiceCallback(thormang3_walking_module_msgs::StartWalking::Request &req, thormang3_walking_module_msgs::StartWalking::Response &res)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
bool removeExistingStepDataServiceCallback(thormang3_walking_module_msgs::RemoveExistingStepData::Request &req, thormang3_walking_module_msgs::RemoveExistingStepData::Response &res)
static const std::string WALKING_MODULE_IS_ENABLED_MSG
static const std::string BALANCE_PARAM_SETTING_STARTED_MSG
static const std::string JOINT_FEEDBACK_GAIN_UPDATE_STARTED_MSG
static const std::string BALANCE_PARAM_SETTING_FINISHED_MSG
bool addStepData(robotis_framework::StepData step_data)
std::map< std::string, int > joint_name_to_index_
bool getReferenceStepDataServiceCallback(thormang3_walking_module_msgs::GetReferenceStepData::Request &req, thormang3_walking_module_msgs::GetReferenceStepData::Response &res)
static const std::string WALKING_START_MSG
Eigen::MatrixXd balance_update_polynomial_coeff_
thormang3_walking_module_msgs::JointFeedBackGain previous_joint_feedback_gain_
static const std::string WALKING_FINISH_MSG
double powDI(double a, int b)
static const int LEFT_FOOT_SWING
Eigen::MatrixXd desired_matrix_g_to_rfoot_
BalancePDController right_foot_torque_pitch_ctrl_
BalanceLowPassFilter right_foot_torque_roll_lpf_
thormang3::BalancePDController leg_angle_feed_back_[12]
bool setBalanceParamServiceCallback(thormang3_walking_module_msgs::SetBalanceParam::Request &req, thormang3_walking_module_msgs::SetBalanceParam::Response &res)
static const std::string FAILED_TO_ADD_STEP_DATA_MSG
int convertStepDataMsgToStepData(thormang3_walking_module_msgs::StepData &src, robotis_framework::StepData &des)
void publishDoneMsg(std::string msg)
static Time now()
bool IsRunningServiceCallback(thormang3_walking_module_msgs::IsRunning::Request &req, thormang3_walking_module_msgs::IsRunning::Response &res)
bool ok() const
BalancePDController left_foot_torque_pitch_ctrl_
BalancePDController right_foot_torque_roll_ctrl_
Eigen::MatrixXd desired_matrix_g_to_cob_
thormang3_walking_module_msgs::RobotPose robot_pose_msg_
void imuDataOutputCallback(const sensor_msgs::Imu::ConstPtr &msg)
Eigen::MatrixXd joint_feedback_update_polynomial_coeff_
bool setJointFeedBackGainServiceCallback(thormang3_walking_module_msgs::SetJointFeedBackGain::Request &req, thormang3_walking_module_msgs::SetJointFeedBackGain::Response &res)
void setCOBManualAdjustment(double cob_x_adjustment_m, double cob_y_adjustment_m, double cob_z_adjustment_m)
Eigen::MatrixXd desired_matrix_g_to_lfoot_


thormang3_walking_module
Author(s): Zerom , SCH , Kayman , Jay Song
autogenerated on Mon Jun 10 2019 15:37:56