ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS1 Base to Laser Static Transform - dont think I have got it right?

asked 2023-06-30 10:41:41 -0600

KevWal gravatar image

updated 2023-06-30 16:53:41 -0600

ROS Noetic on Ubuntu 20.04 64 Bit on Pi 3 with Waveshare PCA9685 based Motor Driver and LD19 LIDAR.

I setup a basic ROS1 robot adapting the Tutorial here: https://snapcraft.io/blog/your-first-... and then added PID to the motor controller and added the LD19 LIDAR following the instructions here: https://github.com/ldrobotSensorTeam/... I want to get to the point where I can add SLAM etc to it.

I have adjusted the static transformation of the Lidar to move it forwards from the center of my robot and rotate it by 90 deg - and the front of the Lidar now seems to be the front of the robot.

<node name="base_to_laser_ld19" pkg="tf" type="static_transform_publisher" args="0.04 0.0 0.11 1.571 0.0 0.0 base_link base_laser 50" if="$(arg fix_to_base_link)"/>

Me holding a PCB up directly in front of the robot: image description

But, my Green lines are not pointing in the same direction? My base_link doesnt seem to be facing forward like my Lidar is?

Then even more confusing, when I hold the PCB off to the Left of the robot (from the point of view of sitting in the robot): https://i.ibb.co/JxBjwq5/20230630-123... it shows as off to the Right: https://i.ibb.co/hMRCqsM/20230630-123... and vice versa - holding to the right: https://i.ibb.co/TbXHZwQ/20230630-123... it shows to the left: https://i.ibb.co/XXGfWbC/20230630-123...

I have edited my ld19.launch file to tell it the Lidar is spinning in the clockwise direction (I swear it is spinning clockwise). But the ld19 manual https://www.elecrow.com/download/prod... does say something about this "Since the point cloud data of our lidar product follows the left-handed coordinate system (clockwise), and Rviz shows that the radar point cloud data follows the right-handed coordinate system counterclockwise), we performed the product point cloud data in the function package source code toLaserScan function. The coordinate system is transformed so that it can display the point cloud normally in Rviz."

All of my Workspace is here: https://github.com/KevWal/ROS-Bot-Wor...

Thanks very much in advance. Kevin

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-30 16:51:29 -0600

KevWal gravatar image

updated 2023-07-01 08:02:23 -0600

Ok, I think I get it now.

The Red line of base_link faces from the center of the robot forwards. The Red line of base_laser points in the forwards direction of the laser - which is at 90 deg to base_link, as my Lidar is mounted offset by 90 degrees.

Base_laser is raised above base link as the Lidar is higher than the base of the robot. Base_laser is slighly 'forwards' of base_link as the Lidar is mounted slightly forwards of center on the robot.

This helped me figure it out: http://wiki.ros.org/hector_slam/Tutor...

I re edited the ld19.launch file to reset the spin direction to counter clockwise - which whilst it feels wrong, it does work, as the manual maybe suggests why.

Thanks Kev

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-06-30 10:41:41 -0600

Seen: 100 times

Last updated: Jul 01 '23