How do I write this transform
I have a Hokuyo LIDAR mounted on a 3d printed part attached to a stepper motor. This is a video of the setup
I need to write a tf from laser_link to base_link. I wrote this:
t.header.frame_id = base_link;
t.child_frame_id = laser_link;
t.transform.translation.z = 0.055;
t.transform.translation.x = 0.035;
t.transform.rotation.x = 0.0;
t.transform.rotation.y = sin(mot_curr_pos * 2.0 * 3.141592/360.0);
t.transform.rotation.z = 0.0;
t.transform.rotation.w = cos(mot_curr_pos * 2.0 * 3.141592/360.0);;
but I get this on rviz
the problem is that the center of the LIDAR is rotating around the motor axis. It seems like I need to redefine the origin point of the LIDAR, but I don't know how to do that....
Thank