1、Lidar basics1.1、Overview1.2、4ROS Lidar1.2.1、Overview1.2.2、Product Features1.2.3、Application scenarios1.2.4、Polar coordinatesystem definition1.3、Single-line lidar principle1.3.1、Trigonometric ranging1、Direct shot2、Oblique shot1.3.2、TOF (Time-of-flight) ranging1.4、Using 4ROS lidar1.7、launch parsing
Single-line LiDAR refers to the single-line radar that the beam emitted by the laser source is divided into triangular ranging and TOF LiDAR, and is mainly used in the field of robotics. It has fast scanning speed, strong resolution and high reliability. Compared with multi-line lidar, single-line lidar has faster response in angular frequency and sensitivity, so it is more accurate in ranging distance and accuracy of obstacles.
YDLIDAR 4ROS lidar is a 360° 2D lidar (hereinafter referred to as: 4ROS). This product is based on the principle of pulsed ToF ranging, and is equipped with related optical, electrical, and algorithm designs to achieve high-frequency and high-precision distance measurement. At the same time, the mechanical structure rotates 360 degrees to continuously obtain angle information, thus realizing 360-degree scanning ranging , which outputs the point cloud data of the scanned environment.
In order to facilitate secondary development, 4ROS internally defines a polar coordinate system. The system polar coordinates take the center of the 4ROS rotating core as the pole, the specified angle is clockwise as positive (top view), and the zero angle is located in the direction of the outlet of the 4ROS interface line, as shown below.
Working principle of the single-line lidar, as shown below.
According to the angle relationship between the incident beam and the surface normal of the measured object, the laser triangulation method can be divided into two types: oblique type and direct type.
As shown below, when the laser beam is perpendicular to the surface of the object to be measured, that is, when the incident light beam is collinear with the normal to the surface of the object to be measured, it is a direct laser triangulation method.
When the angle between the incident laser beam and the normal to the surface of the object to be measured in the optical path system is less than 90°, the incident method is oblique. The optical path diagram shown in FIG. 2 is an oblique light path diagram of the laser triangulation method.
TOF lidar is based on measuring the time of flight of light to obtain the distance of the target. Its working principle is mainly as follows: a beam of modulated laser signal is sent out through the laser transmitter, the modulated light is reflected by the measured object and received by the laser detector, and the distance to the target can be calculated by measuring the phase difference between the emitted laser and the received laser. .
Run following command in terminal.
roslaunch ydlidar_ros_driver TG.launch
Run following command in terminal. (We can print the topic data through the terminal to check whether the radar starts normally)
xxxxxxxxxx
rostopic echo /scan
If you want to view the scan results in RVIZ, type in the terminal.
xxxxxxxxxx
roslaunch ydlidar_ros_driver lidar_view.launch
Code path:~/software/library_ws/src/ydlidar_ros_driver-master/launch
TG.launch file
x<launch>
<arg name="frame_id" default="laser"/>
<node name="ydlidar_lidar_publisher" pkg="ydlidar_ros_driver" type="ydlidar_ros_driver_node" output="screen" respawn="false" >
<!-- string property -->
<param name="port" type="string" value="/dev/ydlidar"/>
<param name="frame_id" type="string" value="$(arg frame_id)"/>
<!--param name="ignore_array" type="string" value="-90,90"/-->
<param name="ignore_array" type="string" value=""/>
<!--remap from="scan" to="scan_raw"/-->
<!-- int property -->
<param name="baudrate" type="int" value="512000"/>
<!-- 0:TYPE_TOF, 1:TYPE_TRIANGLE, 2:TYPE_TOF_NET -->
<param name="lidar_type" type="int" value="0"/>
<!-- 0:YDLIDAR_TYPE_SERIAL, 1:YDLIDAR_TYPE_TCP -->
<param name="device_type" type="int" value="0"/>
<param name="sample_rate" type="int" value="20"/>
<param name="abnormal_check_count" type="int" value="4"/>
<!-- bool property -->
<param name="resolution_fixed" type="bool" value="true"/>
<param name="auto_reconnect" type="bool" value="true"/>
<param name="reversion" type="bool" value="true"/>
<param name="inverted" type="bool" value="true"/>
<param name="isSingleChannel" type="bool" value="false"/>
<param name="intensity" type="bool" value="false"/>
<param name="support_motor_dtr" type="bool" value="false"/>
<param name="invalid_range_is_inf" type="bool" value="true"/>
<param name="point_cloud_preservative" type="bool" value="false"/>
<!-- float property -->
<param name="angle_min" type="double" value="-90" />
<param name="angle_max" type="double" value="90" />
<param name="range_min" type="double" value="0.01" />
<param name="range_max" type="double" value="50.0" />
<param name="frequency" type="double" value="10.0"/>
</node>
<!--node pkg="tf" type="static_transform_publisher" name="base_link_to_laser4"
args="0.0 0.0 0.2 3.14 0.0 0.0 /base_footprint /laser 40" /-->
</launch>
Main debugging parameters:
For other parameters, please refer to the official documentation,
ydlidar_ros_driver/README.md at master · YDLIDAR/ydlidar_ros_driver · GitHub