Google cartographer-ros 3D slam empty map problem
I am trying to adapt the bagpack_3d tutorial of cartographer ROS to a sick laser scanner with an imu. The scanner and imu are working. However with the current setup, I do not get any localization/map (empty /submap_list). So basically somewhere in the \cartographer_node there is an error.
My configuration file looks like this:
include "map_builder.lua"
include "trajectory_builder.lua"
options = {
map_builder = MAP_BUILDER,
trajectory_builder = TRAJECTORY_BUILDER,
map_frame = "map",
tracking_frame = "imu_link",
published_frame = "base_link",
odom_frame = "odom",
provide_odom_frame = true,
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.,
fixed_frame_pose_sampling_ratio = 1.,
imu_sampling_ratio = 1.,
landmarks_sampling_ratio = 1.,
}
TRAJECTORY_BUILDER_3D.num_accumulated_range_data = 160
MAP_BUILDER.use_trajectory_builder_3d = true
MAP_BUILDER.num_background_threads = 7
POSE_GRAPH.optimization_problem.huber_scale = 5e2
POSE_GRAPH.optimize_every_n_nodes = 320
POSE_GRAPH.constraint_builder.sampling_ratio = 0.03
POSE_GRAPH.optimization_problem.ceres_solver_options.max_num_iterations = 10
POSE_GRAPH.constraint_builder.min_score = 0.62
POSE_GRAPH.constraint_builder.global_localization_min_score = 0.66
return options
In comparison to the backpack tutorial (with 2 velodyne scanners), I have a simple horizontal lidar. Accordingly, I have changed the parameters:
num_laser_scans = 1,
num_point_clouds = 0
To create the tf, we call the robot urdf file with the robot state publisher in the launchfile
<launch>
<param name="robot_description"
textfile="$(find robot_navigation)/urdf/robot_3d.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 robot_navigation)/configuration_files
-configuration_basename robot_3d.lua"
output="screen">
<remap from="imu" to="imu/data_raw" />
<remap from="scan" to="sick_s300_laser/scan" />
</node>
<node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"
type="cartographer_occupancy_grid_node" args="-resolution 0.05" />
</launch>
My major question: Do you have any idea, why I do not get any localization/map?
My minor question: As I am using the melodic binary version: sudo apt install ros-melodic-cartographer-ros Using the debugger from visual studio code with ROS plugin, I can launch the cartographer, but pausing the debugger does not work/give me any address in the binaries. Do you have a good idea how to debug the binary ros packages?
Thanks a lot!
You miss the tf
odom
, you seem to have removed it from your previous question (#q316747) that might be the issue. Also you have the paramuse_odometry
set to false, is it intended ?The tf odom was actually not wanted, as it was provided by the pervious IMU filter. What I would like to have is that the cartographer computes the odom based on the laser and imu measurements. I think "use_odometry" should be negative here as I don't want to impose an externally calculated odom.
lua params seems good. but transfrom time from the tf pic, are 0.0, this will affect the transformation calculation. pls check
Hi, thanks for your help. Isn't it normal that the tf time is 0.0, as those are static transformations?
its abnormal. tf is broadcasting to the system and no one knows that it is a static transform. It is just like a common tf, should have a proper time stamp.
if possible pls indicate whats print on the terminal,any warning like tf_old_data?
I disagree with you on that. Since the broadcaster is
/robot_state_publisher
that meansbase_laser_link
andimu_link
are defined in the urdf. When you have fixed joint then you have this kind of output in the tf tree so that's just show that those two tfs are fixed tobase_link
.Hi, thanks for your input. As I still couldn't get any result, I opened the issue: https://github.com/googlecartographer...