with cartographer-ros on ubuntu 18.04 ros-melodic using scandata

asked 2019-06-11 02:57:14 -0500

hansi gravatar image

updated 2019-06-11 08:27:51 -0500

I am trying to build a 2D map out of scan data which i have simulated in my own software. However, when running the cartographer id does not show anything in rviz. What can be the problem? In a first step I want to get a map using scandata only. However I have already prepared some odometry data (x,y,theta) as well. For now, I am just trying to get something out of pure scandata:

I have written a publisher node which reads-in a textfile with my scan data (811 rays each scan with an angular resolution of 0.3333 degree, spanning a scan-range of 270 degree) and publishes them which then I store with the command "rosbag record -a" I have tested the bagfile with cartographer_rosbag_validate and everything looks fine. I have also tried to provide odometrydata (x, y, theta) with another publisher but that did not change anything in the output. Then I have tried to provide simulated IMU data as well. Here I just provided data in a plausible range such that cartographer_rosbag_validate does not complain just to see any scan ata in rviz but that did not happen.

What can be the problem here? Any suggestion or recommendation is highly appreciated. Thanks! Here is the content of my files:

demo_kuve.launch:

<launch>
  <param name="/use_sim_time" value="true" />

  <include file="$(find cartographer_ros)/launch/kuve_test.launch" />

  <node name="rviz" pkg="rviz" type="rviz" required="true"
      args="-d $(find cartographer_ros)/configuration_files/demo_2d.rviz" />
  <node name="playbag" pkg="rosbag" type="play"
      args="--clock $(arg bag_filename)" />
</launch>

kuve_test.launch:

<launch>
  <param name="robot_description"
    textfile="$(find cartographer_ros)/urdf/kuve_test.urdf" />

  <node name="robot_state_publisher" pkg="robot_state_publisher"

        type="robot_state_publisher" />

  <node name="cartographer_node" pkg="cartographer_ros"
      type="cartographer_node" args="
          -configuration_directory $(find cartographer_ros)/configuration_files
          -configuration_basename kuve_test.lua"
      output="screen">
    <remap from="echoes" to="tim_scan" />
  </node>

  <node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"
      type="cartographer_occupancy_grid_node" args="-resolution 0.05" />
</launch>

kuve_test.urdf:

<robot name="cartographer_backpack_2d">
  <material name="orange">
    <color rgba="1.0 0.5 0.2 1" />
  </material>
  <material name="gray">

        <color rgba="0.2 0.2 0.2 1" />
  </material>

  <link name="horizontal_laser_link">
    <visual>
      <origin xyz="0 0 0" />
      <geometry>
            <cylinder length="0.05" radius="0.03" />
          </geometry>
          <material name="gray" />
        </visual>
  </link>

  <link name="base_link" />

  <link name="map" />
  <joint name="base_link_joint" type="fixed">

        <parent link="map" />
        <child link="base_link" />
    <origin xyz="0 0 0" />
  </joint>

  <joint name="horizontal_laser_link_joint" type="fixed">
    <parent link="base_link" />
    <child link="horizontal_laser_link" />
    <origin xyz="0.1007 0 0.0558" />
  </joint>

</robot>

kuve_test.lua:

include "map_builder.lua" include "trajectory_builder.lua"

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "base_link",
  published_frame = "base_link",
  odom_frame = "base_link",
  provide_odom_frame = false,
  publish_frame_projected_to_2d = false,
  use_odometry = false,
  use_nav_sat = false,
  use_landmarks = false,
  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  num_point_clouds = 0,
  lookup_transform_timeout_sec = 0.2,
  submap_publish_period_sec = 0.3,
  pose_publish_period_sec = 5e-3,
  trajectory_publish_period_sec = 30e-3,
  rangefinder_sampling_ratio = 1.,
  odometry_sampling_ratio = 1 ...
(more)
edit retag flag offensive close merge delete