Hello everyone, I would like to start by apologizing for any grammatic error that I will surely commit but English is not my native language.
I'm working with a Universal Robot 10, using ROS Kinetic, and I'm currently trying to get the robot jacobian. I'm using gazebo and I have set the joints to this values:
J1=3.14 J2=1.57 J3=-1.57 J4=0 J5=1.57 J6=-1.57
I have managed to get the jacobian first in Moveit!, using the code below:
// Get the current status of the robot
robot_state::RobotStatePtr state = mgi_ptr_->getCurrentState();
// Get the jacobian (referenced to the world frame) for the current position
Eigen::MatrixXd jacobian;
Eigen::Vector3d reference_position(0, 0, 0);
bool success = state->getJacobian(jmg_ptr_, state->getLinkModel(jmg_ptr_->getLinkModelNames().back()), reference_position, jacobian);
The jacobian that I get using this code matches the one that I'm getting in matlab, so I guess this is the right one. This is the jacobian I'm getting using this code:
[ -0.1642, 0.4963, -0.1157, -0.1157, 9.36e-05, -1.605e-20]
[ 0.665, 0.0001086, -2.531e-05, -2.531e-05, -0.0922, 1.581e-17]
[ 0, -0.665, -0.6645, -0.0922, -5.695e-11, 6.654e-18]
[ 0, -0.0002188, -0.0002188, -0.0002188, -7.755e-07, 1]
[ 0, 1, 1, 1, -1.697e-10, 0.001015]
[ 1, -6.776e-17, 6.349e-23, 3.322e-21, -1, -7.755e-07]
I think that everything here is correct, the problem comes when I try to get this same Jacobian using KDL instead of Moveit !, this is the code I am using to do so:
// Get the jacobian
KDL::Jacobian jacobian(6);
jac_solver_ptr_ = new KDL::TreeJntToJacSolver(robot_tree_);
jac_solver_ptr_->JntToJac(*joint_state_ptr_, jacobian, "wrist_3_link");
robot_tree_ is generated using the robot URDF, same as the MoveGroupInterface from moveit is generated, even so, the the signs of the generated Jacobian does not match the ones in the Jacobian generated by moveit!:
[ 0.163, 0.7277, 0.1157, 0.1157, 7.39e-05, 0]
[ -0.6652, -0.001162, -0.0001848, -0.0001848, 0.0922, 0]
[-1.084e-19, -0.665, -0.6645, -0.0922, -1.198e-12, 0]
[ 1.817e-19, -0.001597, -0.001597, -0.001597, 1.633e-08, -1]
[ 1.084e-19, -1, -1, -1, -2.608e-11, 0.0008015]
[ 1, -1.084e-19, -1.084e-19, -1.084e-19, -1, -1.633e-08]
I'm new to ROS, and to robotics in general and I don't know why KDL and moveit! are giving me different Jacobians, could anybody help me through this?
Thanks in advance!
↧