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

which frame I should use ?

$
0
0
I used laser_geometry tutorial and I have this code: LaserScanToPointCloud(ros::NodeHandle n): n_(n), // laser_sub_(n_, "base_scan", 10), laser_sub_(n_, "/laserscan", 1), laser_notifier_(laser_sub_,listener_, "laser0_frame", 1) { std::cout << "Object created" << std::endl ; laser_notifier_.registerCallback( boost::bind(&LaserScanToPointCloud::scanCallback, this, _1)); laser_notifier_.setTolerance(ros::Duration(0.01));// 0.01 std::cout << "before pub " << std::endl ; scan_pub_ = n_.advertise("cloud",1); std::cout << "after pub " << std::endl ; } ========================================== sensor_msgs::PointCloud cloud; try { std::cout << "try " << std::endl ; projector_.transformLaserScanToPointCloud( "laser0_frame",*scan_in, cloud,listener_); } catch (tf::TransformException& e) { std::cout << "catch 1 " << std::endl ; std::cout << e.what(); std::cout << "catch " << std::endl ; return; } I changed base_scan to laser_scan --> this is because the topic name that publishes laser data is called laser_scan is that right ?? should I do that or shouldn't I ? Also, I did rostopic echo /scan and I found that the frame id is laser0_frame.. So I used it instead of the base_link. The base_link was used in the geometry tutorial. now in the previous code should I use base_link or laser0_frame

Viewing all articles
Browse latest Browse all 74

Trending Articles



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