yujinrobot / yujin_lidar

all sources for the Yujin lidar
13 stars 12 forks source link

2D map for 3D lidar #3

Open vanquang741987 opened 3 years ago

vanquang741987 commented 3 years ago

Hello~ May I make 2D map from 3d yujin lidar? Do you have manual to make 2d or 3d map in ROS for AMR? Thank you so much

engineeve commented 3 years ago

I am also looking to do this. I have started by attempting to use the pointcloud_to_laserscan ROS package to convert the 3D point cloud to 2D LaserScan. This requires the PointCloud data to be converted into the PointCloud2 datatype, which I have done in the yrl_pub.cpp node. I use the following parameters for the pointcloud_to_laserscan package: `

<node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan">
  <remap from="cloud_in" to="/yrl_pub/yrl_cloud"/>
  <remap from="scan" to="/scan" />
  <rosparam>
    target_frame: yrl_cloud_id
    transform_tolerance: 0.01
    min_height: .3
    max_height: .4
    angle_increment: 0.0087
    scan_time: .333
    range_min: 0.45
    range_max: 10.0
    use_inf: false
    #concurrency_level affects number of pc queued for processing and the number of threadsused
    # 0: Detect number of cores
    # 1: Single threaded
    # 2: inf : Parallelism level
    concurrency_level: 1
  </rosparam>
</node>

`

I also changed line 232 of the yrl_pub.cpp file from: br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "map", "yrl_cloud_id")); to: br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_laser_link", "yrl_cloud_id"));

This results in the scan topic having mostly inf or range_max+1 values, so the package is rejecting most of the pointcloud values. if I increase the max_height, there are less inf values but still quite a lot. It seems similar to the issue this user has https://answers.ros.org/question/205552/pointcloud_to_laserscan-rotation-of-scan-line/ - Can you please advise on how to convert the pointcloud to 2D LaserScans ?

jykim3 commented 3 years ago

@vanquang741987 @engineeve Hello. My name is Ju Young Kim, and I am the author of this YRL Library(Linux, Windows, ROS), working as a project manager for LiDAR Team in Yujin Robot. (Sorry for my late reply.)

We do not have a manual about how to make a 2d or 3d map using ROS Driver.

I am just wondering, if pointcloud2 is supported, does conversion from 3D PointCloud to 2D LaserScan become easier? (We have a plan for pointcloud 2 updates, and before that, this link might be helpful)

engineeve commented 3 years ago

Hi @jykim3,

Thank you for your reply. I am currently converting the PointCloud to PointCloud2 and successfully using pointcloud_to_laser scan to convert the 3D point cloud to a 2D laserscan. However, as the full scan takes over a second and the time between scans is too long to localize in 2D and when trying to map I get matching errors with the scans and odom. The plan originally was to use ROS 2D amcl navigation with 3D obstacle avoidance. We are open to changing our navigation system to a 3D one or one that better fits the capabilities of the Yujin Lidar - can you advise an opensource nav stack that works well with the 3D lidar ?

jykim3 commented 3 years ago

@engineeve Hello,

sorry for the late reply.

why don't you try this package : https://github.com/RobustFieldAutonomyLab/LeGO-LOAM