Ask Your Question

Revision history [back]

How to write a driver for Hokuyo Laser Scanner?

I want to write a driver for laser scanner and publish data on /scan topic. I write this code for initializing:

    sensor_msgs::LaserScan laser_data;
    laser_data.header.frame_id="laser";
    laser_data.angle_max=((210.234375)/180)*M_PI;
    laser_data.angle_min=((-29.53125)/180)*M_PI;
    laser_data.angle_increment=(0.3515625/180)*M_PI;
    laser_data.header.stamp=ros::Time::now();
    laser_data.scan_time=0.10000000149;
    laser_data.time_increment=9.76562732831e-05;
    laser_data.range_min=0.019999999553;
    laser_data.range_max=5.59999990463;
    laser_data.ranges.resize(682);

and put my data on ranges array.

I can see laser data in Rviz but when i used it for hector_slam , It's not worked and I saw this error:

[ INFO] [1395750671.645863427]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.

[ERROR] [1395750671.815635459]: Trajectory Server: Transform from /map to scanmatcher_frame failed: "map" passed to lookupTransform argument target_frame does not exist

.

When i try with urg_node , hector_slam worked correctly. I used a Hokuyo 04LX laser scanner.

Does anyone has any suggestion about this problem?

Thank you

How to write a driver for Hokuyo Laser Scanner?

I want to write a driver for laser scanner and publish data on /scan topic. I write this code for initializing:

    sensor_msgs::LaserScan laser_data;
    laser_data.header.frame_id="laser";
    laser_data.angle_max=((210.234375)/180)*M_PI;
    laser_data.angle_min=((-29.53125)/180)*M_PI;
    laser_data.angle_increment=(0.3515625/180)*M_PI;
    laser_data.header.stamp=ros::Time::now();
    laser_data.scan_time=0.10000000149;
    laser_data.time_increment=9.76562732831e-05;
    laser_data.range_min=0.019999999553;
    laser_data.range_max=5.59999990463;
    laser_data.ranges.resize(682);

and put my data on ranges array.

I can see laser data in Rviz but when i used it for hector_slam , It's not worked and I saw this error:

[ INFO] [1395750671.645863427]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.

[ERROR] [1395750671.815635459]: Trajectory Server: Transform from /map to scanmatcher_frame failed: "map" passed to lookupTransform argument target_frame does not exist

.another warning that i saw in Rviz in Global Status box is :

No tf data. Actual error: Fixed Frame [laser] does not exist

This is my tf_tree :

image description

When i try with urg_node , hector_slam worked correctly. I used a Hokuyo 04LX laser scanner.

Does anyone has any suggestion about this problem?

Thank you

How to write a driver for Hokuyo Laser Scanner?

I want to write a driver for laser scanner and publish data on /scan topic. I write this code for initializing:

    sensor_msgs::LaserScan laser_data;
    laser_data.header.frame_id="laser";
    laser_data.angle_max=((210.234375)/180)*M_PI;
    laser_data.angle_min=((-29.53125)/180)*M_PI;
    laser_data.angle_increment=(0.3515625/180)*M_PI;
    laser_data.header.stamp=ros::Time::now();
    laser_data.scan_time=0.10000000149;
    laser_data.time_increment=9.76562732831e-05;
    laser_data.range_min=0.019999999553;
    laser_data.range_max=5.59999990463;
    laser_data.ranges.resize(682);

and put my data on ranges array.

I can see laser data in Rviz but when i used it for hector_slam , It's not worked and I saw this error:

[ INFO] [1395750671.645863427]: lookupTransform base_link to laser timed out. Could not transform laser scan into base_frame.

[ERROR] [1395750671.815635459]: Trajectory Server: Transform from /map to scanmatcher_frame failed: "map" passed to lookupTransform argument target_frame does not exist

another warning that i saw in Rviz in Global Status box is :

No tf data. Actual error: Fixed Frame [laser] does not exist

This is my tf_tree :when run hector_slam:

image description

When i try with urg_node , hector_slam worked correctly. This is the tf tree with urg_node:

image description

I used a Hokuyo 04LX laser scanner.

Does anyone has any suggestion about this problem?

Thank you