{"id":15142488,"url":"https://github.com/ldrobotsensorteam/ldlidar_ros2","last_synced_at":"2025-10-29T01:36:35.257Z","repository":{"id":150589541,"uuid":"603371974","full_name":"ldrobotSensorTeam/ldlidar_ros2","owner":"ldrobotSensorTeam","description":"LDROBOT LiDAR ROS2 Package(NEW)","archived":false,"fork":false,"pushed_at":"2023-03-12T15:10:31.000Z","size":68,"stargazers_count":17,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T10:00:43.934Z","etag":null,"topics":["ld06","ld14","ld14p","ld19","ldrobot","ros2"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ldrobotSensorTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-18T10:03:17.000Z","updated_at":"2025-10-12T14:38:08.000Z","dependencies_parsed_at":"2023-06-11T13:30:37.838Z","dependency_job_id":null,"html_url":"https://github.com/ldrobotSensorTeam/ldlidar_ros2","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.3529411764705882,"last_synced_commit":"0f6101c93db0b4448cbe7a654826adcdee50622f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ldrobotSensorTeam/ldlidar_ros2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrobotSensorTeam%2Fldlidar_ros2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrobotSensorTeam%2Fldlidar_ros2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrobotSensorTeam%2Fldlidar_ros2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrobotSensorTeam%2Fldlidar_ros2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldrobotSensorTeam","download_url":"https://codeload.github.com/ldrobotSensorTeam/ldlidar_ros2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldrobotSensorTeam%2Fldlidar_ros2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281544212,"owners_count":26519552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ld06","ld14","ld14p","ld19","ldrobot","ros2"],"created_at":"2024-09-26T09:41:48.163Z","updated_at":"2025-10-29T01:36:35.252Z","avatar_url":"https://github.com/ldrobotSensorTeam.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instructions\n\n## step 0: get LiDAR ROS2 Package\n```bash\ncd ~\n\nmkdir -p ldlidar_ros2_ws/src\n\ncd ldlidar_ros2_ws/src\n\ngit clone  https://github.com/ldrobotSensorTeam/ldlidar_ros2.git\n\ngit submodule update --init --recursive\n```\n## step 1: system setup\n- Connect the LiDAR to your system motherboard via an onboard serial port or usB-to-serial module (for example, CP2102 module).\n\n- Set the -x permission for the serial port device mounted by the radar in the system (for example, /dev/ttyUSB0)\n\n  - In actual use, the LiDAR can be set according to the actual mounted status of your system, you can use 'ls -l /dev' command to view.\n\n``` bash\ncd ~/ldlidar_ros2_ws\n\nsudo chmod 777 /dev/ttyUSB0\n```\n- Modify the `port_name` value in the Lanuch file corresponding to the radar product model under `launch/`, using `ld14.launch.py` as an example, as shown below.\n\n```py\n#!/usr/bin/env python3\nfrom launch import LaunchDescription\nfrom launch_ros.actions import Node\n\n'''\nParameter Description:\n---\n- Set laser scan directon: \n  1. Set counterclockwise, example: {'laser_scan_dir': True}\n  2. Set clockwise,        example: {'laser_scan_dir': False}\n- Angle crop setting, Mask data within the set angle range:\n  1. Enable angle crop fuction:\n    1.1. enable angle crop,  example: {'enable_angle_crop_func': True}\n    1.2. disable angle crop, example: {'enable_angle_crop_func': False}\n  2. Angle cropping interval setting:\n  - The distance and intensity data within the set angle range will be set to 0.\n  - angle \u003e= 'angle_crop_min' and angle \u003c= 'angle_crop_max' which is [angle_crop_min, angle_crop_max], unit is degress.\n    example:\n      {'angle_crop_min': 135.0}\n      {'angle_crop_max': 225.0}\n      which is [135.0, 225.0], angle unit is degress.\n'''\n\ndef generate_launch_description():\n  # LDROBOT LiDAR publisher node\n  ldlidar_node = Node(\n      package='ldlidar_ros2',\n      executable='ldlidar_ros2_node',\n      name='ldlidar_publisher_ld14',\n      output='screen',\n      parameters=[\n        {'product_name': 'LDLiDAR_LD14'},\n        {'laser_scan_topic_name': 'scan'},\n        {'point_cloud_2d_topic_name': 'pointcloud2d'},\n        {'frame_id': 'base_laser'},\n        {'port_name': '/dev/ttyUSB0'},\n        {'serial_baudrate' : 115200},\n        {'laser_scan_dir': True},\n        {'enable_angle_crop_func': False},\n        {'angle_crop_min': 135.0},\n        {'angle_crop_max': 225.0}\n      ]\n  )\n\n  # base_link to base_laser tf node\n  base_link_to_laser_tf_node = Node(\n    package='tf2_ros',\n    executable='static_transform_publisher',\n    name='base_link_to_base_laser_ld14',\n    arguments=['0','0','0.18','0','0','0','base_link','base_laser']\n  )\n\n\n  # Define LaunchDescription variable\n  ld = LaunchDescription()\n\n  ld.add_action(ldlidar_node)\n  ld.add_action(base_link_to_laser_tf_node)\n\n  return ld\n```\n\n## step 2: build\n\nRun the following command.\n\n```bash\ncd ~/ldlidar_ros2_ws\n\ncolcon build\n```\n## step 3: run\n\n### step3.1: package environment variable settings\n\n- After the compilation is completed, you need to add the relevant files generated by the compilation to the environment variables, so that the ROS environment can recognize them. The execution command is as follows. This command is to temporarily add environment variables to the terminal, which means that if you reopen a new terminal, you also need to re-execute it. The following command.\n  \n  ```bash\n  cd ~/ldlidar_ros2_ws\n  \n  source install/local_setup.bash\n  ```\n  \n- In order to never need to execute the above command to add environment variables after reopening the terminal, you can do the following.\n\n  ```bash\n  echo \"source ~/ldlidar_ros2_ws/install/local_setup.bash\" \u003e\u003e ~/.bashrc\n  \n  source ~/.bashrc\n  ```\n### step3.2: start LiDAR node\n\n- The product is LDROBOT LiDAR LD14\n  - start ld14 lidar node:\n  ``` bash\n  ros2 launch ldlidar_ros2 ld14.launch.py\n  ```\n  - start ld14 lidar node and show on the Rviz2:\n  ``` bash\n  ros2 launch ldlidar_ros2 viewer_ld14.launch.py\n  ```\n\n- The product is LDROBOT LiDAR LD14P\n  - start ld14p lidar node:\n  ``` bash\n  ros2 launch ldlidar_ros2 ld14p.launch.py\n  ```\n  - start ld14p lidar node and show on the Rviz2:\n  ``` bash\n  ros2 launch ldlidar_ros2 viewer_ld14p.launch.py\n  ```\n\n- The product is LDROBOT LiDAR LD06\n  - start ld06 lidar node:\n  ``` bash\n  ros2 launch ldlidar_ros2 ld06.launch.py\n  ```\n  - start ld06 lidar node and show on the Rviz2:\n  ``` bash\n  ros2 launch ldlidar_ros2 viewer_ld06.launch.py\n  ```\n\n- The product is LDROBOT LiDAR LD19\n  - start ld19 lidar node:\n  ``` bash\n  ros2 launch ldlidar_ros2 ld19.launch.py\n  ```\n  - start ld19 lidar node and show on the Rviz2:\n  ``` bash\n  ros2 launch ldlidar_ros2 viewer_ld19.launch.py\n  ```\n\n## step 4: Data visualization\n\n\u003e The code supports ubuntu 20.04 ros2 foxy version and above, using rviz2 visualization.\n\n- new a terminal (Ctrl + Alt + T) and use Rviz2 tool(run command: `rviz2`) ,open the `ldlidar.rviz` file below the rviz2 folder of the readme file directory\n```bash\nrviz2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldrobotsensorteam%2Fldlidar_ros2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldrobotsensorteam%2Fldlidar_ros2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldrobotsensorteam%2Fldlidar_ros2/lists"}