ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Can you please help with my hector mapping launch file?

asked 2016-12-22 09:14:24 -0500

ateator gravatar image

I have a LaserScan node "keyencelaser" that is publishing on the topic "scan" with frame "laser_frame"

  ros::init(argc, argv, "keyencelaser_publisher");
  ros::NodeHandle n;
  ros::Publisher scan_pub = n.advertise<sensor_msgs::LaserScan>("scan", 50);
  scan.header.frame_id = "laser_frame";

My launch file currently looks like:


<node pkg="keyencelaser" type="keyencelaser_rosnode" name="keyencelaser" />
<node pkg="tf" type="static_transform_publisher" name="odom_to_base_link" args="0.0 0.0 0.0 0 0 0.0 /odom /base_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_to_laser_link" args="0.0 0.0 0.0 0 0 0.0 /base_link /laser_frame 100"/>
<param name="pub_map_odom_transform" value="false"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="base_link" />
<param name="odom_frame" value="base_link" />
<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
  <param name="use_tf_scan_transformation" value="true" />
  <param name="use_tf_pose_start_estimate" value="false" />
  <param name="map_resolution" value="0.050" />
  <param name="map_size" value="2048" />
  <param name="scan_subscriber_queue_size" value="5" />
  <param name="scan_topic" value="scan" />
  <param name="tf_map_scanmatch_transform_frame_name" value="scanmatcher_frame" />

But I throw this error once I use my launch file:

[ INFO] [1482419456.331809455]: lookupTransform base_link to laser_frame timed out. Could not transform laser scan into base_frame.
Check failed in file /usr/include/boost/numeric/ublas/matrix_expression.hpp at line 2007:
size1 == size2
terminate called after throwing an instance of 'boost::numeric::ublas::bad_argument'
  what():  bad argument

Can someone please help me figure this out? I have tried multiple combinations but can't quite get it.

edit retag flag offensive close merge delete


BTW I can successfully view my LaserScan on rviz. If you'd like me to post any information, please just ask.

ateator gravatar image ateator  ( 2016-12-22 09:31:36 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-01-10 03:49:41 -0500

jinn gravatar image

If pub_map_odom_transform = false , you must close 'statci_transform_publiser' to publish odom->base_link

If pub_map_odom_transform = true , set odom_frame = odom and publish odom->base_link tf

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-12-22 09:14:24 -0500

Seen: 1,040 times

Last updated: Jan 10 '17