当前位置: 首页 > news >正文

激光雷达工作原理

  • 数据格式
lihongli@lhl:~/catkin_ws$ rostopic echo /scan --noarr
---
header: seq: 4663stamp: secs: 594nsecs: 481000000frame_id: "laser"
angle_min: -3.141590118408203
angle_max: 3.141590118408203
angle_increment: 0.017501894384622574
time_increment: 0.0
scan_time: 0.0
range_min: 0.23999999463558197
range_max: 6.0
ranges: "<array type: float32, length: 360>"
intensities: "<array type: float32, length: 360>"---

在这里插入图片描述
**

  • 使用C++ 编写接受雷达数据。

**

#include <ros/ros.h>
#include <sensor_msgs/LaserScan.h>void LidarCallback(const sensor_msgs::LaserScan::ConstPtr& msg)
{// Process the Lidar data herefloat fMidDist = msg->ranges[180]; // Example: get the distance at 180 degreesROS_INFO("前方 180 degrees 距离: %f", fMidDist);ROS_INFO("Received Lidar scan with %zu ranges", msg->ranges.size());// You can access the ranges, intensities, etc. from the msg
}int main(int argc, char** argv) 
{setlocale(LC_ALL, "");ros::init(argc, argv, "lidar_node");ros::NodeHandle n;ros::Subscriber lidar_sub = n.subscribe("/scan", 10,&LidarCallback); ros::spin();return 0;
}

在这里插入图片描述

http://www.xdnf.cn/news/1354879.html

相关文章:

  • 算法训练营day59 图论⑨ dijkstra(堆优化版)精讲、Bellman_ford 算法精讲
  • C++初阶(2)C++入门基础1
  • 第1篇:走进日志框架的世界 - 从HelloWorld到企业级应用
  • 为什么在WHERE子句里使用函数,会让索引失效
  • 复杂工业场景误报率↓85%!陌讯多模态火焰识别算法实战解析
  • Codeforces Round 1043 (Div. 3)(A-E)
  • 历史数据分析——半导体
  • 【科研绘图系列】浮游植物的溶解性有机碳与初级生产力的关系
  • 【Game】Powerful——Punch and Kick(12.2)
  • ComfyUI Portrait Master肖像大师中文版
  • 【51单片机】【protues仿真】基于51单片机宠物投食器系统
  • Redis 持久化策略
  • 如何创建自己的 Minecraft 世界
  • MiMo-VL 技术报告
  • rust语言 (1.88) egui (0.32.1) 学习笔记(逐行注释)(九)数值拖拽控件、进度条、滑动条
  • 【51单片机】【protues仿真】 基于51单片机储物箱系统
  • 双指针:三数之和
  • Sentinel相关记录
  • OSI参考模型TCP/IP模型 二三事
  • docker的基础配置
  • redis----hash类型详解
  • Python的标准库之时间库(小白五分钟从入门到精通)
  • 终端复用工具 tmux 的使用方式与推荐配置
  • Autosar CAN开发06(CAN通讯开发需求-CAN矩阵)
  • AI+预测3D新模型百十个定位预测+胆码预测+去和尾2025年8月23日第168弹
  • 【机器学习深度学习】模态与多模态的概念
  • 使用 AD 帐户从 ASP.NET 8 容器登录 SQL Server 的 Kerberos Sidecar
  • uniapp对接一键登录
  • FL Studio Win版.exe安装教程(直接安装版/详细步骤/附安装包下载)
  • 全面解析主流AI模型:功能对比与应用推荐