cartographer_ros doesn't work with simulated turtlebot3 in gazebo8

712 views
Skip to first unread message

LEI TAI

unread,
Oct 27, 2017, 3:17:50 PM10/27/17
to google-cartographer
Hi,

I'm trying to build map through carto in with turtlebot3 in gazebo8 and ros kinetic ubuntu 16.04.

I install turtlebot3 from https://github.com/ROBOTIS-GIT/turtlebot3.
I start turtlebot3_gazebo/launch/turtlebot3_world.launch and turtlebot3_bringup/launch/turtlebot3_remote.launch to start a very simple gazebo environment.

With cartographer_flat_world_imu_node, I add gravity accelerator in the raw imu data.

Then I change the tracking_frame to base_footprint, cause the imu msg shows that the frame_id is base_footprint. 
If I track other frames, there is always this sensor_to_tracking->translation().norm() < 1e-5 error, like base_link or imu_link.

Then I start cartographer, there is no error. However, the map is not built.  and when I move the robot through the keyboard, the links in the rviz relative to map do not move. And the odom initial position seems to be wrong either. Should it be at the same position as the map right? You can see it from the figures. The scan are loaded, but there is no map building. The robot is initialized in the origin point as the map, but odom is initialized in somewhere else.  And nothing happened when the robot is moving in the gazebo environment.





The launch file for the turtlebot3
<launch>
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle]"/>
  <arg name="x_pos" default="-2.0"/>
  <arg name="y_pos" default="-0.5"/>
  <arg name="z_pos" default="0.0"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find turtlebot3_gazebo)/worlds/temp.world"/>
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="false"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
  </include>

  <param name="robot_description" command="$(find xacro)/xacro.py $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />

  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model turtlebot3_burger -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />


  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch" />
</launch>


The launch file for the cartographer

<!--
  Copyright 2016 The Cartographer Authors

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at


  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

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

  <node name="cartographer_node" pkg="cartographer_ros"
      type="cartographer_node" args="
          -configuration_directory
              $(find cartographer_turtlebot)/configuration_files
          -configuration_basename turtlebot_urg_lidar_2d.lua"
      output="screen">
    <remap from="scan" to="/scan" />
    <!--<remap from="imu" to="/imu_wolrd" />-->
  </node>

  <node name="flat_world_imu_node" pkg="cartographer_turtlebot"
      type="cartographer_flat_world_imu_node" output="screen">
    <remap from="imu_in" to="/imu_data" />
    <remap from="imu_out" to="/imu" />
  </node>

  <node name="rviz" pkg="rviz" type="rviz" required="true"
      args="-d $(find cartographer_turtlebot
          )/configuration_files/demo_turtlebot.rviz" />

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


lua configuration file
-- Copyright 2016 The Cartographer Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

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

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "base_footprint",
  published_frame = "odom",
  odom_frame = "odom",
  provide_odom_frame = false,
  use_odometry = true,
  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.,
  imu_sampling_ratio = 1.,
}

MAP_BUILDER.use_trajectory_builder_2d = true

TRAJECTORY_BUILDER_2D.min_range = 0.1
TRAJECTORY_BUILDER_2D.max_range = 8.
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 5.
TRAJECTORY_BUILDER_2D.use_imu_data = true
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.1)

SPARSE_POSE_GRAPH.constraint_builder.min_score = 0.65
SPARSE_POSE_GRAPH.constraint_builder.global_localization_min_score = 0.7

return options




Holger Rapp

unread,
Oct 30, 2017, 4:14:49 AM10/30/17
to LEI TAI, google-cartographer
​Hey Lei Tai,

this is unfortunately insufficient information to really tell what is going on: We are unable to reproduce your problem. For example, what would ​TURTLEBOT3_MODEL be? Please either post a full repro case, starting from a fresh ros install including all commands you run so we can repro or - even better - provide us with a dockerfile that shows your problem.

Also, please put all your changes into a GitHub git repo, so that we can see what you already tried.

Cheers,
Holger



--
You received this message because you are subscribed to the Google Groups "google-cartographer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cartographer+unsub...@googlegroups.com.
To post to this group, send email to google-cartographer@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cartographer/cf6fcbbf-e01f-4716-a979-a69179fd8f0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Google Germany GmbH
Erika-Mann-Straße 33
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Reply all
Reply to author
Forward
0 new messages