-
大小: 5KB文件类型: .zip金币: 2下载: 0 次发布日期: 2021-05-20
- 语言: 其他
- 标签: Laserscan PointCloud ROS
资源简介
在使用ROS各个传感器消息之前,弄清楚各个传感器在ROS是如何表示的显得极为重要。特别是,Laserscan, PointCloud等用了很久之后,感觉已经很熟悉了,但是一些细节行的东西一直没有深究,并且对某些参数难以形成直觉上的认识,很大程度上影响了在与其他算法或者硬件衔接时的问题。这里,我单独的将Laserscan,PointCloud发布在rviz中,通过修改不同的ROS消息参数,直观的观察其在参数的作用。

代码片段和文件信息
#include
#include
int main(int argc char** argv){
ros::init(argc argv “laser_scan_publisher“);
ros::NodeHandle n;
ros::Publisher scan_pub = n.advertise(“scan“ 50);
unsigned int num_readings = 10000;
double laser_frequency = 40;
double ranges[num_readings];
double intensities[num_readings];
int count = 10;
ros::Rate r(1.0);
while(n.ok()){
//generate some fake data for our laser scan
for(unsigned int i = 0; i < num_readings; ++i){
ranges[i] = count;
intensities[i] = 10*i;
}
ros::Time scan_time = ros::Time::now();
//populate the LaserScan message
sensor_msgs::LaserScan scan;
scan.header.stamp = scan_time;
scan.header.frame_id = “sensor_frame“;
scan.angle_min = -1.57;
scan.angle_max = 1.57;
scan.angle_increment = 3.14 / num_readings;
scan.time_increment = (1 / laser_frequency) / (num_readings);
scan.range_min = 0.0;
scan.range_max = 100.0;
scan.ranges.resize(num_readings);
scan.intensities.resize(num_readings);
for(unsigned int i = 0; i < num_readings; ++i){
scan.ranges[i] = ranges[i];
scan.intensities[i] = intensities[i];
}
scan_pub.publish(scan);
// ++count;
ROS_WARN_STREAM(“count“< r.sleep();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-15 13:03 pubsensors\
文件 7179 2018-03-15 13:45 pubsensors\CMakeLists.txt
文件 1899 2018-03-15 13:03 pubsensors\package.xm
目录 0 2018-03-15 13:44 pubsensors\src\
文件 987 2018-03-16 01:32 pubsensors\src\pubPointCloud.cpp
文件 1327 2018-03-16 01:21 pubsensors\src\pubLaserscan.cpp
相关资源
- Rational Rose Common破解文件
- Microsoft基本类库 (MFC)(C 库)
- 软件工程课程设计【网上选课系统】
- MikroTik RouterOS密码破解 mtpass.exe
- 机器人操作系统ROS2
- wifi电路调试经验之谈
- Oxford Industries 采用 Microsoft.NET 平台实
- IBM CAW for Microsoft Cluster Server 简介
- IBM.Rational.Rose.Enterprise的license.upd
- Symantec AntiVirus for Microsoft SharePoint产品
- Microservice patterns
- Microsoft Visio 2013 Professional 64位简体中
- Microsoft Project 2016
- 含Microsoft.Office.Interop.Owc11
- The Existence and Stability of Nontrivial St
- DS4000存储系统上Microsoft Exchange 2003的存
- Microsoft Visual Studio 2017 Installer Project
- 通过 Microsoft Services for UNIX 将 UNIX 应用
- Microsoft Windows Services for UNIX 3.5 版中的
- Ross-Konno手术后左心室流出道梗阻
- Genome doubling and chromosome elimination wit
- Improvement of the coercivity and corrosion re
- Effects of cerium on the microstructure and me
- crossfilter tutorial
- RoboWare Studio中文版(2018).pdf
- 倍加福二维码识别模块使用手册
- Bioinformatics analysis of tyrosinase-related
- Effect of isovalent substitution on martensiti
- Facile hydrothermal synthesis of Tb2(MoO4)
- Spectroscopic Study on Cu2+-induced Abnormally
评论
共有 条评论