How to convert the 2D laser data in the laser coordinate system to the data under the base?

asked 2020-05-02 04:32:29 -0500

dxp397@foxmail.com gravatar image

updated 2020-05-02 04:45:50 -0500

I am a newcomer. I am using moveit and gazebo for simulation.I used the DH parameter method to establish the coordinate system. I want to convert the two-dimensional laser data acquired in real time in the laser coordinate system into the data marked by the robot base. How should I obtain the conversion matrix of the laser coordinate system to the robot base standard system in real time? Is there any source code for reference?I tried the following procedure.

robot_state::RobotStatePtr kinematic_state(new robot_state::RobotState(kinematic_model));
kinematic_state->setToDefaultValues();
ROS_INFO_STREAM("translation : \n" << kinematic_state->getGlobalLinkTransform("laser_frame").matrix()<<"\n");

The output transformation matrix is the transformation matrix when the robot is at position 0, not the transformation matrix in real time. This matrix will not change with the change of the robot arm. I hope I can get help.

edit retag flag offensive close merge delete