Rosanswers logo

I have a raspberry Pi 2 with ubuntu mate and ROS Kinetic. I have a hokuyo lidar connected to it. I launch hokuyo driver, then launch hector slam and I get the map on rviz. Pi is a wifi AP with the IP

Then I connect my laptop to PI AP and get IP I config my hosts with the hostname and IP (laptop hostname and IP on pi's hosts file and pi hostname and IP on laptop's hosts file). Then I run

export ROS_IP=

and launch hector slam in my laptop. I get several

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

and one

[ WARN] [1518225097.231782411]: No transform between frames /map and scanmatcher_frame available after 20.003299 seconds of waiting. This warning only prints once.

In rviz I get Global Status Error

Fixed Frame [map] does not exist

I run

rosrun rqt_tf_tree rqt_tf_tree 

and see that there is a base_link -> laser tf, but there is not a map -> base_link tf and there is not map ->scanmatcher_frame tf (if I run rqt_tf_tree on Raspberry PI I can see those 3 tf). So running hector slam from another PC seems to not work ok.

But, thas is not all. If I reconfigure my network and use an external router (my home router, connected to internet) letting my PI and my laptop connected to the router, then reconfigure hosts, and master_uri, I get hector slam working on my laptop.

But, yesterday I take my router, go to the place where I need to map (out of my hosue) and again, it did not work.

So it is killing my head. I need that rasp Pi could run lidar node, then connect with my laptop and run hector slam to see the map.



I test netcat in both directions and I can get send a receive msg.

I can run

rostopic echo /scan

and see laser scan msg

but I get

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

on my laptop.

I run roswtf and get

Loaded plugin tf.tfwtf
No package or stack in context
Static checks summary:

Found 1 error(s).

ERROR Not all paths in ROS_PACKAGE_PATH [/home/elgarbe/catkin_ws/src/camera_umd/camera_umd:/home/elgarbe/catkin_ws/src/gscam:/home/elgarbe/catkin_ws/src/hector_slam/hector_imu_attitude_to_tf:/home/elgarbe/catkin_ws/src/hector_slam/hector_imu_tools:/home/elgarbe/catkin_ws/src/hector_slam/hector_map_tools:/home/elgarbe/catkin_ws/src/hector_slam/hector_compressed_map_transport:/home/elgarbe/catkin_ws/src/hector_slam/hector_mapping:/home/elgarbe/catkin_ws/src/hector_slam/hector_marker_drawing:/home/elgarbe/catkin_ws/src/hector_slam/hector_nav_msgs:/home/elgarbe/catkin_ws/src/hector_slam/hector_geotiff:/home/elgarbe/catkin_ws/src/hector_slam/hector_geotiff_plugins:/home/elgarbe/catkin_ws/src/hector_slam/hector_map_server:/home/elgarbe/catkin_ws/src/hector_slam/hector_slam:/home/elgarbe/catkin_ws/src/hector_slam/hector_slam_launch:/home/elgarbe/catkin_ws/src/hector_slam/hector_trajectory_server:/home/elgarbe/catkin_ws/src/camera_umd/jpeg_streamer:/home/elgarbe/catkin_ws/src/laser_proc:/home/elgarbe/catkin_ws/src/ros_best_practices/ros_package_template:/home/elgarbe/catkin_ws/src/test_leo:/home/elgarbe/catkin_ws/src/urg_c:/home/elgarbe/catkin_ws/src/urg_node:/home/elgarbe/catkin_ws/src/usb_cam:/home/elgarbe/catkin_ws/src/camera_umd/uvc_camera:/opt/ros/kinetic/share] point to an existing directory: 
 * /home/elgarbe/catkin_ws/src/gscam

Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules
running tf checks, this will take a second...
... tf checks complete

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /hector_mapping:
   * /syscommand
   * /tf_static
 * /hector_trajectory_server:
   * /tf_static
 * /hector_geotiff_node:
   * /syscommand
 * /rviz:
   * /trajectory
   * /tf_static
   * /map_updates

so, there are some unconected subscriptions, but don't know why!!!!

My hector_mapping launch file is

  <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
  <arg name="base_frame" default="base_link"/>
  <arg name="odom_frame" default="base_link"/>
  <arg name="pub_map_odom_transform" default="true"/>
  <arg name="scan_subscriber_queue_size" default="5"/>
  <arg name="scan_topic" default="scan"/>
  <arg name="map_size" default="2048"/>
  <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">
    <!-- Frame names -->
    <param name="map_frame" value="map" />
    <param name="base_frame" value="$(arg base_frame)" />
    <param name="odom_frame" value="$(arg odom_frame)" />
    <!-- Tf use -->
    <param name="use_tf_scan_transformation" value="true"/>
    <param name="use_tf_pose_start_estimate" value="false"/>
    <param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>
    <!-- Map size / start point -->
    <param name="map_resolution" value="0.050"/>
    <param name="map_size" value="$(arg map_size)"/>
    <param name="map_start_x" value="0.5"/>
    <param name="map_start_y" value="0.5" />
    <param name="map_multi_res_levels" value="2" />
    <!-- Map update parameters -->
    <param name="update_factor_free" value="0.4"/>
    <param name="update_factor_occupied" value="0.9" />    
    <param name="map_update_distance_thresh" value="0.4"/>
    <param name="map_update_angle_thresh" value="0.06" />
    <param name="laser_z_min_value" value = "-1.0" />
    <param name="laser_z_max_value" value = "1.0" />
    <!-- Advertising config --> 
    <param name="advertise_map_service" value="true"/>
    <param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
    <param name="scan_topic" value="$(arg scan_topic)"/>
    <!-- Debug parameters -->
      <param name="output_timing" value="false"/>
      <param name="pub_drawings" value="true"/>
      <param name="pub_debug_output" value="true"/>
    <param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
  <node pkg="tf" type="static_transform_publisher" name="map_baselink_broadcaster" args="0 0 0 0 0 0 map scanmatcher_frame 100"/>

  <node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 base_link laser 50"/>

you can see that I'm using base_link to laser tf, and it is showed in rqt_view_frames

So, I'm really out of ideas here...

Originally posted by elgarbe on ROS Answers with karma: 106 on 2018-02-09

Post score: 0


1 Answer 1


Rosanswers logo

Ok, problem solved, it was a date/time problem between raspberry pi and my laptop. When I use my router, both sinchronize with internet and so it work. Then, when I setup raspberri pi as AP, reboot and connect my laptop to PI, raspberry has an old date/time, and so don't work.

The answer was right there all of the time: http://wiki.ros.org/ROS/NetworkSetup chapter 5

Originally posted by elgarbe with karma: 106 on 2018-02-10

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.