ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Why cannot launch node of type [laser_geometry/laser_geometry]

asked 2018-08-09 00:06:23 -0600

Pujie gravatar image

I need to transfer from sensor_msgs::LaserScan to sensor_msgs::PointCloud2 . I found laser_geometry package, ( ). Because there is no ROS API, I found a link which helps. The link is ( ). I compiled the .cpp file same to the link:

#include "laser_geometry/laser_geometry.h"
#include <algorithm>
#include <ros/assert.h>
#include <tf2/LinearMath/Transform.h>
#include <tf/transform_listener.h>
#include "ros/ros.h"
class My_Filter{
        void scanCallback(const sensor_msgs::LaserScan::ConstPtr& scan);
        ros::NodeHandle node_;
        laser_geometry::LaserProjection projector_;
        tf::TransformListener tfListener_;
        ros::Publisher point_cloud_publisher_;
        ros::Subscriber scan_sub_;
    scan_sub_ = node_.subscribe<sensor_msgs::LaserScan> ("/scan", 100, &My_Filter::scanCallback, this);

    point_cloud_publisher_ = node_.advertise<sensor_msgs::PointCloud2> ("filtered_cloud", 100, false);

void My_Filter::scanCallback(const sensor_msgs::LaserScan::ConstPtr& scan){
    sensor_msgs::PointCloud2 cloud;
    projector_.transformLaserScanToPointCloud("base_link", *scan, cloud, tfListener_);
int main(int argc, char** argv)
    ros::init(argc, argv, "my_filter");
    My_Filter filter;
    return 0;

from my cmakelist.txt and package.xml, I wrote a launch file

`target_link_libraries(laser_geometry ${Boost_LIBRARIES} ${tf_LIBRARIES})`, `<name>laser_geometry</name>` 

<launch><node pkg="laser_geometry" type="laser_geometry" name="my_filter"/></launch>

But I can't launch this node.

ERROR: cannot launch node of type [laser_geometry/laser_geometry]: can't locate node [laser_geometry] in package [laser_geometry]

Could you please give me some hints? How to use the laser_geometry package and launch the node? Thank you!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-09 12:54:22 -0600

Have you tried roscd laser_geometry and ensure you have it installed? If not grab from apt-get.

It doesn't appear that laser_geometry is a node, its just a library.

You cann't lauch node of type laser_geometry because that node does not exist, its a package / library.

edit flag offensive delete link more

answered 2018-08-09 01:37:56 -0600

gvdhoorn gravatar image

This is not really an answer, but if all you want is to aggregate a number of laserscans into a pointcloud I would not bother with writing my own node, but just use the laser_scan_assembler node.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-08-09 00:06:23 -0600

Seen: 417 times

Last updated: Aug 09 '18