Robotics StackExchange | Archived questions

Cartographer 2D generates wrong map

Hello All,

I am new to cartographer and am trying to generate a map for my data using it. I have a VLP-16 sensor and I make ue of the VLP16points.launch file in velodynepointcloud package to generate a laserscan for the specific ring. When I run 2D cartographer on this laserscan, my map is static (submaps are overwritten at the same point and the trajectory path is stationary) although my sensor is mounted on a car that is in motion.

Lua file:

include "map_builder.lua"

include "trajectory_builder.lua"

options = { mapbuilder = MAPBUILDER,

trajectorybuilder = TRAJECTORYBUILDER,

map_frame = "map",

trackingframe = "baselink",

publishedframe = "baselink",

odom_frame = "odom",

provideodomframe = true,

publishframeprojectedto2d = true,

useposeextrapolator = true,

use_odometry = false,

usenavsat = false,

use_landmarks = false,

numlaserscans = 1,

nummultiecholaserscans = 0,

numsubdivisionsperlaserscan = 1,

numpointclouds = 0,

lookuptransformtimeout_sec = 0.2,

submappublishperiod_sec = 0.3,

posepublishperiod_sec = 5e-3,

trajectorypublishperiod_sec = 30e-3,

rangefindersamplingratio = 1.,

odometrysamplingratio = 1.,

fixedframeposesamplingratio = 1.,

imusamplingratio = 1.,

landmarkssamplingratio = 1., }

MAPBUILDER.usetrajectorybuilder2d = true TRAJECTORYBUILDER2D.numaccumulatedrange_data = 1

MAPBUILDER.usetrajectorybuilder2d = true

TRAJECTORYBUILDER2D.min_range = 0.0

TRAJECTORYBUILDER2D.max_range = 20.0

TRAJECTORYBUILDER2D.missingdataray_length = 20

TRAJECTORYBUILDER2D.useimudata = false TRAJECTORYBUILDER2D.useonlinecorrelativescanmatching = true TRAJECTORYBUILDER2D.realtimecorrelativescanmatcher.linearsearchwindow = 0.1 TRAJECTORYBUILDER2D.realtimecorrelativescanmatcher.translationdeltacostweight = 10. TRAJECTORYBUILDER2D.realtimecorrelativescanmatcher.rotationdeltacostweight = 1e-1 TRAJECTORYBUILDER2D.motionfilter.maxangle_radians = math.rad(0.2)

POSEGRAPH.constraintbuilder.min_score = 0.5

POSEGRAPH.constraintbuilder.globallocalizationmin_score = 0.5

POSEGRAPH.optimizationproblem.huber_scale = 1e2

POSEGRAPH.optimizeeverynnodes = 35

return options

The sensor length and radius (in urdf file) are 0.07 and 0.05.

Can someone please help me understand what am I doing wrong?

Asked by user112233 on 2022-07-21 10:53:05 UTC

Comments

Answers

Have you tried running the Google Cartographer first on demo bag files? I would recommend you to try running and generating the map using the demo bag files and then try running the code on your robot. Follow the steps here: https://google-cartographer-ros.readthedocs.io/en/latest/demos.html

Asked by satvikgupta on 2023-06-08 03:03:18 UTC

Comments