Giter Club home page Giter Club logo

Comments (11)

SteveMacenski avatar SteveMacenski commented on July 28, 2024

Please edit the ticket title and description to accurately and descriptively address what youre seeing and what youre expecting.

Pictures/figures are good

from slam_toolbox.

SteveMacenski avatar SteveMacenski commented on July 28, 2024

Also make sure you carefully read the readme on localization. Iā€™m going to make a really good guess that its working correctly

from slam_toolbox.

gary-robotics avatar gary-robotics commented on July 28, 2024

my goal is to use ur localization.launch to locate my robot in the map.
here is my understanding:
first, i need to building a map use the online_sync.launch,which is




and the mapper_params_online_sync.yaml is

//# Plugin params
solver_plugin: solver_plugins::CeresSolver
ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
ceres_preconditioner: SCHUR_JACOBI
ceres_trust_strategy: LEVENBERG_MARQUARDT
ceres_dogleg_type: TRADITIONAL_DOGLEG
ceres_loss_function: None

//# ROS Parameters
odom_frame: odom
map_frame: map
base_frame: base_footprint
mode: mapping #localization

//# if you'd like to immediately start continuing a map at a given pose
//# or at the dock, but they are mutually exclusive, if pose is given
//# will use pose
//#map_file_name: test_steve
//#map_start_pose: [0.0, 0.0, 0.0]
//#map_start_at_dock: true

debug_logging: false
throttle_scans: 1
transform_publish_period: 0.02 #if 0 never publishes odometry
map_update_interval: 5.0
resolution: 0.05
max_laser_range: 20.0 #for rastering images
minimum_time_interval: 0.5
transform_timeout: 0.2
tf_buffer_duration: 10.
stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps

//# General Parameters
use_scan_matching: true
use_scan_barycenter: true
minimum_travel_distance: 0.5
minimum_travel_heading: 0.5
scan_buffer_size: 10
scan_buffer_maximum_scan_distance: 10
link_match_minimum_response_fine: 0.1
link_scan_maximum_distance: 1.5
loop_search_maximum_distance: 3.0
do_loop_closing: true
loop_match_minimum_chain_size: 10
loop_match_maximum_variance_coarse: 3.0
loop_match_minimum_response_coarse: 0.35
loop_match_minimum_response_fine: 0.45

//# Correlation Parameters - Correlation Parameters
correlation_search_space_dimension: 0.5
correlation_search_space_resolution: 0.01
correlation_search_space_smear_deviation: 0.1

//# Correlation Parameters - Loop Closure Parameters
loop_search_space_dimension: 8.0
loop_search_space_resolution: 0.05
loop_search_space_smear_deviation: 0.03

//# Scan Matcher Parameters
distance_variance_penalty: 0.5
angle_variance_penalty: 1.0

fine_search_angle_offset: 0.00349
coarse_search_angle_offset: 0.349
coarse_angle_resolution: 0.0349
minimum_angle_penalty: 0.9
minimum_distance_penalty: 0.5
use_response_expansion: true

after launched it.the result is
mapping

and the tf tree is map->odom->base_link->base_laser
tf

right now, i need to generate a serialized map,but i don't know how to do it?
secondly,if i had a serialized map , eg:the name is "test_localiztion".
so I will launch the localization.launch file, which is




and the mapper_params_localization.yaml is

//# Plugin params
solver_plugin: solver_plugins::CeresSolver
ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
ceres_preconditioner: SCHUR_JACOBI
ceres_trust_strategy: LEVENBERG_MARQUARDT
ceres_dogleg_type: TRADITIONAL_DOGLEG
ceres_loss_function: HuberLoss

//# ROS Parameters
odom_frame: odom
map_frame: map
base_frame: base_link #base_footprint
mode: localization #localization

//# if you'd like to start localizing on bringup in a map and pose
map_file_name: /file_path/test_localiztion
map_start_pose: [0.0, 0.0, 0.0]
debug_logging: false
throttle_scans: 1
transform_publish_period: 0.02 #if 0 never publishes odometry
map_update_interval: 5.0
resolution: 0.05
max_laser_range: 20.0 #for rastering images
minimum_time_interval: 0.5
transform_timeout: 0.2
tf_buffer_duration: 10.
stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps

//# General Parameters
use_scan_matching: true
use_scan_barycenter: true
minimum_travel_distance: 0.5
minimum_travel_heading: 0.5
scan_buffer_size: 10
scan_buffer_maximum_scan_distance: 10
link_match_minimum_response_fine: 0.1
link_scan_maximum_distance: 1.5
loop_search_maximum_distance: 3.0
do_loop_closing: true
loop_match_minimum_chain_size: 10
loop_match_maximum_variance_coarse: 3.0
loop_match_minimum_response_coarse: 0.35
loop_match_minimum_response_fine: 0.45

//# Correlation Parameters - Correlation Parameters
correlation_search_space_dimension: 0.5
correlation_search_space_resolution: 0.01
correlation_search_space_smear_deviation: 0.1

//#Correlation Parameters - Loop Closure Parameters
loop_search_space_dimension: 8.0
loop_search_space_resolution: 0.05
loop_search_space_smear_deviation: 0.03

//#Scan Matcher Parameters
distance_variance_penalty: 0.5
angle_variance_penalty: 1.0
fine_search_angle_offset: 0.00349
coarse_search_angle_offset: 0.349
coarse_angle_resolution: 0.0349
minimum_angle_penalty: 0.9
minimum_distance_penalty: 0.5
use_response_expansion: true
The above is what i know, is it right? if not, please let me know how to correct it . thank u very much!

from slam_toolbox.

SteveMacenski avatar SteveMacenski commented on July 28, 2024

That is correct. You may use the RVIZ plugin to serialize the map, there's an exposed service serialize_map to serialize the map. Then if you use the config files you have shown it will try to localize in the map file given at the position given.

You bring up a good point that I don't actually explicitly describe the exposed services / topics in the README. If you'd like to update those that would be great.

You renamed the ticket to "cannot localize just use localization.launch" but that doesn't describe your issue, it sounds like your problem is that you don't know how to serialize the map. Have you tried to use localization.launch?

from slam_toolbox.

gary-robotics avatar gary-robotics commented on July 28, 2024

I used the RVIZ plugin to serialize the map, and generate two files: test.data, test.posegraph. which file should I put to the map_file_name: /file_path/test.* in file mapper_params_localization.yaml ? actually I tried both. but failed,and report the messages:
serialization::Read: Failed to open requested file: serialization::Read: Failed to open requested file: ./test.posegraph.
[ERROR] [1567930130.823841180]: DeserializePoseGraph: Failed to read file: ./test.posegraph.
. need some help , thank u.

from slam_toolbox.

SteveMacenski avatar SteveMacenski commented on July 28, 2024

You do not need to include the file extension. ./ is not a valid path.

from slam_toolbox.

gary-robotics avatar gary-robotics commented on July 28, 2024

I corrected the file and the path,but it also cannot locate. my steps are belows:
1.roslaunch a simulation enviroment.
Screenshot 2019-09-14 00:00:00
2.roslaunch slam_toolbox localization.launch

mapper_params_localization.yaml:

//# link_match_minimum_response_fine: 0.4
//# link_scan_maximum_distance: 20.0
//# loop_search_maximum_distance: 50.0
//# distance_variance_penalty: 1.8
//# angle_variance_penalty: 0.20
//# minimum_angle_penalty: 1.6 #0.9

//# Plugin params
solver_plugin: solver_plugins::CeresSolver
ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
ceres_preconditioner: SCHUR_JACOBI
ceres_trust_strategy: LEVENBERG_MARQUARDT
ceres_dogleg_type: TRADITIONAL_DOGLEG
ceres_loss_function: None

//# ROS Parameters
odom_frame: odom
map_frame: map
base_frame: base_link #base_footprint
mode: localization #localization

//# if you'd like to start localizing on bringup in a map and pose
map_file_name: gary_test
map_start_pose: [0.0, 0.0, 0.0]

debug_logging: false
throttle_scans: 1
transform_publish_period: 0.02 #if 0 never publishes odometry
map_update_interval: 5.0
resolution: 0.05
max_laser_range: 20.0 #for rastering images
minimum_time_interval: 0.5
transform_timeout: 0.2
tf_buffer_duration: 30.
stack_size_to_use: 40000000 #// program needs a larger stack size to serialize large maps

//# General Parameters
use_scan_matching: true
use_scan_barycenter: true
minimum_travel_distance: 0.5
minimum_travel_heading: 0.5
scan_buffer_size: 10
scan_buffer_maximum_scan_distance: 10
link_match_minimum_response_fine: 0.1
link_scan_maximum_distance: 1.5
loop_search_maximum_distance: 3.0
do_loop_closing: true
loop_match_minimum_chain_size: 10
loop_match_maximum_variance_coarse: 3.0
loop_match_minimum_response_coarse: 0.35
loop_match_minimum_response_fine: 0.45

//# Correlation Parameters - Correlation Parameters
correlation_search_space_dimension: 0.5
correlation_search_space_resolution: 0.01
correlation_search_space_smear_deviation: 0.1

//# Correlation Parameters - Loop Closure Parameters
loop_search_space_dimension: 8.0
loop_search_space_resolution: 0.05
loop_search_space_smear_deviation: 0.03

//# Scan Matcher Parameters
distance_variance_penalty: 0.5
angle_variance_penalty: 1.0

fine_search_angle_offset: 0.00349
coarse_search_angle_offset: 0.349
coarse_angle_resolution: 0.0349
minimum_angle_penalty: 0.9
minimum_distance_penalty: 0.5
use_response_expansion: true

the result is like this:
Screenshot 2019-09-14 00:17:44

Screenshot 2019-09-14 00:19:31

Screenshot 2019-09-14 00:20:30
I don't know why it cannot locate itself. can u help me to work it out, thank u so much!

from slam_toolbox.

SteveMacenski avatar SteveMacenski commented on July 28, 2024

You're setting your initial pose to 0,0,0. Is that where the robot is? Just like AMCL, you need to give it a reasonable estimation of the actual pose

from slam_toolbox.

gary-robotics avatar gary-robotics commented on July 28, 2024

My start point is 0,0,0. and can this project solve the robot kidnap?

from slam_toolbox.

SteveMacenski avatar SteveMacenski commented on July 28, 2024

No. That is not in the scope for most industrial applications.

from slam_toolbox.

maxxlife avatar maxxlife commented on July 28, 2024

How you solved it? @guorun198959 I have the same problem. @SteveMacenski Why I can't read the file?

Okay, I don't add the file extension, now it looks like this (in folder june_8 are 4 files: pgm, yaml, data, posegraph):
map_file_name: /home/maxxlife/Documents/abot_files_maps/maps/june_8/small_room_with_boxes_2_slam_tb_rviz

then I have another error:

Load From File /home/maxxlife/Documents/abot_files_maps/maps/june_8/small_room_with_boxes_2_slam_tb_rviz.posegraph 
Mapper <- Module
Mapper <- m_pSequentialScanMatcher
Mapper <- m_pGraph
MapperGraph <- Graph; Graph <- m_Edges; Graph <- m_Vertices
MapperGraph <- m_pMapper; MapperGraph <- m_pLoopScanMatcher; MapperGraph <- m_pTraversal
Mapper <- m_pMapperSensorManager
MapperSensorManager <- m_ScanManagers; MapperSensorManager <- m_Scans
Mapper <- m_Listeners
**Finished serializing Mapper**
Load From File
**Serializing Dataset**
Dataset <- m_SensorNameLookup
Dataset <- m_Data
Dataset <- m_Lasers
Dataset <- m_pDatasetInfo
**Finished serializing Dataset**
Registering sensor: [Custom Described Lidar]
[ INFO] [1654720423.919467495]: Waiting for incoming scan to get metadata...
[ INFO] [1654720424.110184084]: Got scan!
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0608 22:33:44.111160 64770 problem_impl.cc:635] Parameter block not found: 0x562d4c7e9050. You must add the parameter block to the problem before it can be set constant.
*** Check failure stack trace: ***
[ INFO] [1654720424.146080850]: rviz version 1.14.14
[ INFO] [1654720424.146137444]: compiled against Qt version 5.12.8
[ INFO] [1654720424.146151994]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1654720424.158584449]: Forcing OpenGl version 0.
[slam_toolbox-2] process has died [pid 64770, exit code -6, cmd /home/maxxlife/abot/ros/devel/lib/slam_toolbox/localization_slam_toolbox_node __name:=slam_toolbox __log:=/home/maxxlife/.ros/log/360923d0-e76a-11ec-83bc-abc5a51b81b3/slam_toolbox-2.log].
log file: /home/maxxlife/.ros/log/360923d0-e76a-11ec-83bc-abc5a51b81b3/slam_toolbox-2*.log
[ INFO] [1654720424.593604274]: Stereo is NOT SUPPORTED
[ INFO] [1654720424.593680046]: OpenGL device: Mesa DRI Intel(R) HD Graphics 4400 (HSW GT2)
[ INFO] [1654720424.593727468]: OpenGl version: 3,0 (GLSL 1,3).

from slam_toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.