师弟反应镭神32线激光雷达(32C)录制的数据包不能跑lego loam,这里就总结一下。
首先lego loam默认的接受的topic name是velodyne_points,点云的frame_id是velodyne,镭神驱动发布的topic name为point_raw,frame_id为world这里需要写一个程序转一下:
#include "ros/ros.h" #include "std_msgs/String.h" #include "sensor_msgs/PointCloud2.h" #include <string> #include <sstream> /** * This tutorial demonstrates simple sending of messages over the ROS system. */ static ros::Publisher g_scan_pub; static void main_topic_callback(const sensor_msgs::PointCloud2::ConstPtr& input) { sensor_msgs::PointCloud2 msg = *input; msg.header.frame_id = "velodyne"; g_scan_pub.publish(msg); } int main(int argc, char *argv[]) { /** * The ros::init() function needs to see argc and argv so that it can perform * any ROS arguments and name remapping that were provided at the command line. * For programmatic remappings you can use a different version of init() which takes * remappings directly, but for most command-line programs, passing ar