Robotics StackExchange | Archived questions

Visualization on multiple machines

I'm trying to visualize my lidar data and hector_mapping on my main pc.

Everything works fine when using the following launch files of hectormapping: tutorial.launch and mappingdefault.launch, (see code below) on my raspberry Pi.

But when I try showing the same data with rviz on my main pc, I can not show the Map for example (While echo'ing the map data works fine) without checking the Unreliable option and within no time the following message appears:

a message of over a gigabyte was predicted in tcpros. that seems highly unlikely, so I'll assume protocol synchronization is lost.

Running everything on my main pc except the lidar node with the /scan publisher is also not working. It is not able to get the transform data:

No transform between frames /map and scanmatcher_frame available after 20.002555 seconds of waiting. This warning only prints once.

I feel like that in my first problem maybe to much data is send to correctly display my data? And in the second problem there is something going wrong with my TF data. When running 'rosrun tf tf_monitor' on my main pc no tf data is availble, while it shows my tf data on the raspberry pi. Can this be timing problems?

Can someone help me steer in the right direction to tackle this problem?

env | grep ROS # on my raspberry pi

ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_PACKAGE_PATH=/home/ubuntu/lidar_ws/src:/home/ubuntu/catkin_ws/src:/opt/ros/kinetic/share
ROS_MASTER_URI=http://IP_MAIN:11311
ROS_VERSION=1
ROS_PARALLEL_JOBS=-j2
ROS_HOSTNAME=IP_pi
ROSLISP_PACKAGE_DIRECTORIES=/home/ubuntu/lidar_ws/devel/share/common-    lisp:/home/ubuntu/catkin_ws/devel/share/common-lisp
ROS_DISTRO=kinetic
ROS_IP=IP_pi
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros

env | grep ROS # on my main pc

ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_PACKAGE_PATH=/home/ubuntu/lidar_ws/src:/home/ubuntu/catkin_ws/src:/opt/ros/kinetic/share
ROS_MASTER_URI=http://IP_MAIN:11311
ROS_VERSION=1
ROS_PARALLEL_JOBS=-j2
ROS_HOSTNAME=IP_MAIN
ROSLISP_PACKAGE_DIRECTORIES=/home/ubuntu/lidar_ws/devel/share/common-lisp:/home/ubuntu/catkin_ws/devel/share/common-lisp
ROS_DISTRO=kinetic
ROS_IP= IP_MAIN
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros

tutorial.launch

<?xml version="1.0"?>

<launch>
    <arg name="geotiff_map_file_path" default="$(find hector_geotiff)/maps"/>
    <param name="/use_sim_time" value="false"/>
    <node name="static_tf0" pkg="tf" type="static_transform_publisher" args="1 0 0 0 0 0 /world /map 100" />
    <node name="static_tf1" pkg="tf" type="static_transform_publisher" args="0 0 0 0 0 0 /odom /base_footprint 100" />

    <node pkg="rviz" type="rviz" name="rviz"
    args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>

    <include file="$(find hector_mapping)/launch/mapping_default.launch"/>
    <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
    <arg name="trajectory_source_frame_name" value="scanmatcher_frame"/>
    <arg name="map_file_path" value="$(arg geotiff_map_file_path)"/>
    </include>
</launch>

mapping_default.launch

<?xml version="1.0"?>

<launch>
  <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
  <arg name="base_frame" default="base_footprint"/>
  <arg name="odom_frame" default="odom"/>
  <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)"/>

    <param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
  </node>

  <node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 map odom 100"/>
</launch>

Asked by seth on 2019-05-07 04:54:52 UTC

Comments

Answers