39 double pelvis_x = pelvis_position.coeff(0,0);
40 double pelvis_y = pelvis_position.coeff(1,0);
41 double pelvis_z = pelvis_position.coeff(2,0);
43 double pelvis_Xx = pelvis_orientation.coeff(0,0);
44 double pelvis_Yx = pelvis_orientation.coeff(0,1);
45 double pelvis_Zx = pelvis_orientation.coeff(0,2);
47 double pelvis_Xy = pelvis_orientation.coeff(1,0);
48 double pelvis_Yy = pelvis_orientation.coeff(1,1);
49 double pelvis_Zy = pelvis_orientation.coeff(1,2);
51 double pelvis_Xz = pelvis_orientation.coeff(2,0);
52 double pelvis_Yz = pelvis_orientation.coeff(2,1);
53 double pelvis_Zz = pelvis_orientation.coeff(2,2);
61 pelvis_Xy, pelvis_Yy, pelvis_Zy,
62 pelvis_Xz, pelvis_Yz, pelvis_Zz),
148 pelvis_Xy, pelvis_Yy, pelvis_Zy,
149 pelvis_Xz, pelvis_Yz, pelvis_Zz),
232 std::vector<double> min_position_limit, max_position_limit;
233 min_position_limit.push_back(-180.0); max_position_limit.push_back(180.0);
234 min_position_limit.push_back(-180.0); max_position_limit.push_back(180.0);
235 min_position_limit.push_back(-180.0); max_position_limit.push_back(180.0);
236 min_position_limit.push_back(-180.0); max_position_limit.push_back(180.0);
237 min_position_limit.push_back(-180.0); max_position_limit.push_back(180.0);
238 min_position_limit.push_back(-180.0); max_position_limit.push_back(180.0);
243 min_joint_position_limit(index) = min_position_limit[index]*
D2R;
244 max_joint_position_limit(index) = max_position_limit[index]*
D2R;
255 min_joint_position_limit, max_joint_position_limit,
266 min_joint_position_limit, max_joint_position_limit,
284 std::vector<double_t> &lleg_position, std::vector<double_t> &lleg_orientation)
304 rleg_position.resize(3,0.0);
309 rleg_orientation.resize(4,0.0);
310 rleg_orientation[0] =
rleg_pose_.orientation.x;
311 rleg_orientation[1] =
rleg_pose_.orientation.y;
312 rleg_orientation[2] =
rleg_pose_.orientation.z;
313 rleg_orientation[3] =
rleg_pose_.orientation.w;
333 lleg_position.resize(3,0.0);
338 lleg_orientation.resize(4,0.0);
339 lleg_orientation[0] =
lleg_pose_.orientation.x;
340 lleg_orientation[1] =
lleg_pose_.orientation.y;
341 lleg_orientation[2] =
lleg_pose_.orientation.z;
342 lleg_orientation[3] =
lleg_pose_.orientation.w;
346 Eigen::MatrixXd rleg_target_position, Eigen::Quaterniond rleg_target_orientation,
347 std::vector<double_t> &lleg_output,
348 Eigen::MatrixXd lleg_target_position, Eigen::Quaterniond lleg_target_orientation)
358 rleg_desired_pose.
p.
x(rleg_target_position.coeff(0,0));
359 rleg_desired_pose.
p.
y(rleg_target_position.coeff(1,0));
360 rleg_desired_pose.
p.
z(rleg_target_position.coeff(2,0));
363 rleg_target_orientation.y(),
364 rleg_target_orientation.z(),
365 rleg_target_orientation.w());
374 ROS_WARN(
"RLEG IK ERR : %d", rleg_err);
383 lleg_desired_pose.
p.
x(lleg_target_position.coeff(0,0));
384 lleg_desired_pose.
p.
y(lleg_target_position.coeff(1,0));
385 lleg_desired_pose.
p.
z(lleg_target_position.coeff(2,0));
388 lleg_target_orientation.y(),
389 lleg_target_orientation.z(),
390 lleg_target_orientation.w());
399 ROS_WARN(
"LLEG IK ERR : %d", lleg_err);
409 rleg_output[i] = rleg_desired_joint_position(i);
410 lleg_output[i] = lleg_desired_joint_position(i);
void initialize(Eigen::MatrixXd pelvis_position, Eigen::MatrixXd pelvis_orientation)
KDL::ChainFkSolverPos_recursive * lleg_fk_solver_
virtual int JntToCart(const JntArray &q_in, Frame &p_out, int segmentNr=-1)
void addSegment(const Segment &segment)
static Rotation Quaternion(double x, double y, double z, double w)
Eigen::VectorXd rleg_joint_position_
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)
void GetQuaternion(double &x, double &y, double &z, double &w) const
KDL::ChainFkSolverPos_recursive * rleg_fk_solver_
void setJointPosition(Eigen::VectorXd rleg_joint_position, Eigen::VectorXd lleg_joint_position)
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)
Eigen::VectorXd lleg_joint_position_
void resize(unsigned int newSize)
KDL::ChainIkSolverVel_pinv * lleg_ik_vel_solver_
geometry_msgs::Pose lleg_pose_
geometry_msgs::Pose rleg_pose_
KDL::ChainIkSolverVel_pinv * rleg_ik_vel_solver_
KDL::ChainIkSolverPos_NR_JL * rleg_ik_pos_solver_
KDL::ChainIkSolverPos_NR_JL * lleg_ik_pos_solver_
virtual int CartToJnt(const JntArray &q_init, const Frame &p_in, JntArray &q_out)