Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 171

frame issue with PointCloud2 and rviz

$
0
0
After reviewing the source for Velodyne I see that: 1. the velodyne_packets topic is published with "velodyne" frame id in the ROS header 2. the velodyne_points topic is published with "odom" frame id in the ROS header 3. when I run with a PCAP file and visualize in rviz, I launch rviz by passing the fixed frame ID as in "rosrun rviz rviz -f velodyne" 4. rviz display the fixed frame options as only velodyne and properly displays the PointCloud2 data I have a similar LiDAR with a driver that has been using the PCL Point XYZI. I'm using pcl::toROSMsg to convert the PCL point cloud (Point XYZI) to sensor_msgs::PointCloud2. I format the header with a frame_id that I made up with a simple text string. I didn't broadcast a tf transform since I didn't see that the velodyne code did either. When I run my ROS node and then rviz (e.g. "rosrun rviz rviz -f myframe" where "myframe" is the same string used in my header for the PointCloud2 message.), I get an error: Transform [sender=unknown_publisher] For frame []: Fixed Frame [myframe] does not exist In the case of both the velodyne (using PCAP file) and my node, I checked the tf by running "rosrun tf tf_echo" but see no frames listed. I'm a little confused why the velodyne driver works and mine doesn't since the velodyne code doesn't seem to broadcast the transforms. I've been alerted to that the text "For frame []:" in the error above is really stating that the translation is from from "" (empty string) to "myframe". Without a broadcast transform, how can having two frames (in the case of velodyne) for two different topics make any difference? The PointCloud2 status for Velodyne shows "OK" and the subitem under status, Transform also simply says OK for velodyne but gives the error above for my sensor. I "rostopic echo ..." my topic and the PointCloud2 data looks well formed when compared to the velodyne PointCloud2 message so I think the error is simply a matter of tf frames and frame IDs. In my code I'm not doing a tf::MessageFilter or pcl_ros::transformPointCloud like the velodyne code does in transform.cc. I don't have a second node for my data like velodyne so I don't suppose I really need the MessageFilter because I can't subscribe to anything getting the raw data. I'm curious if the ros::transformPointCloud would actually be of much use since I don't have two transform IDs like velodyne does (odom and velodyne). Any help is greatly appreciated.

Viewing all articles
Browse latest Browse all 171

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>