How to convert the 2D laser data in the laser coordinate system to the data under the base?
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.