How to get a conversion matrix?
I want to get a conversion matrix from a link to base coordinate system. I used the following statement:
robot_state::RobotStatePtr kinematic_state(new robot_state::RobotState(kinematic_model));
kinematic_state->update();
ROS_INFO_STREAM("telescopic_arm_link transfrom : \n" << kinematic_state-》getFrameTransform("telescopic_arm_link").matrix()<<"\n");
The conversion matrix I get is fixed and not real-time. But when I use the following code to get the coordinate position, it is right.
moveit::planning_interface::MoveGroupInterface group("manipulator");
std::vector<geometry_msgs::Pose> wayPoints;
geometry_msgs::PoseStamped currentPoseValues = group.getCurrentPose("telescopic_arm_link");
ROS_INFO_STREAM("telescopic_arm_link:\n"<<currentPoseValues.pose.orientation);
ROS_INFO_STREAM("telescopic_arm_link:\n"<<currentPoseValues.pose.position);
ROS_INFO("frame_id:%s",currentPoseValues.header.frame_id.c_str());
Therefore, I think it may not be because my coordinate system is not established correctly. But I can't think of the reason for the error. Why does the transformation matrix not change with the change of the robot's position and posture?