33 ROS_ERROR(
"Failed to construct kdl tree");
37 KDL::Chain chain_main;
39 if (chain_main.getNrOfJoints() == 0)
41 ROS_ERROR(
"Failed to initialize kinematic chain");
45 KDL::Joint::JointType lookat_lin_joint_type = KDL::Joint::None;
49 lookat_lin_joint_type = KDL::Joint::TransX;
52 lookat_lin_joint_type = KDL::Joint::TransY;
55 lookat_lin_joint_type = KDL::Joint::TransZ;
58 lookat_lin_joint_type = KDL::Joint::TransX;
59 ROS_ERROR(
"X_NEGATIVE axis_type not supported");
62 lookat_lin_joint_type = KDL::Joint::TransY;
63 ROS_ERROR(
"Y_NEGATIVE axis_type not supported");
66 lookat_lin_joint_type = KDL::Joint::TransZ;
67 ROS_ERROR(
"Z_NEGATIVE axis_type not supported");
71 lookat_lin_joint_type = KDL::Joint::TransX;
91 KDL::Joint offset_joint(
"offset_joint", KDL::Joint::None);
92 KDL::Segment offset_link(
"offset_link", offset_joint, offset);
96 KDL::Joint lookat_lin_joint(
"lookat_lin_joint", lookat_lin_joint_type);
97 KDL::Segment lookat_rotx_link(
"lookat_rotx_link", lookat_lin_joint);
104 KDL::Joint lookat_rotx_joint(
"lookat_rotx_joint", KDL::Joint::RotX);
105 KDL::Segment lookat_roty_link(
"lookat_roty_link", lookat_rotx_joint);
115 KDL::Joint lookat_roty_joint(
"lookat_roty_joint", KDL::Joint::RotY);
116 KDL::Segment lookat_rotz_link(
"lookat_rotz_link", lookat_roty_joint);
126 KDL::Joint lookat_rotz_joint(
"lookat_rotz_joint", KDL::Joint::RotZ);
127 KDL::Segment lookat_focus_frame(
"lookat_focus_frame", lookat_rotz_joint);
164 boost::mutex::scoped_lock lock(
mutex_);
165 KDL::Jacobian jac_full(
chain_full_.getNrOfJoints());
174 boost::mutex::scoped_lock lock(
mutex_);
175 unsigned int chain_dof = joint_states.
current_q_.rows();
181 for (
unsigned int i = 0; i< chain_dof; i++)
188 for (
unsigned int i = 0; i <
ext_dof_; i++)
202 for (
unsigned int i = 0; i <
ext_dof_; i++)
215 boost::mutex::scoped_lock lock(
mutex_);
216 std::vector<double> pos;
217 std::vector<double> vel;
219 for (
unsigned int i = 0; i <
ext_dof_; i++)
226 for (
unsigned int i = 0; i <
ext_dof_; i++)
238 boost::mutex::scoped_lock lock(
mutex_);
239 KDL::Frame focus_frame;