Hello Matlabbe
I am running RTAB-Map in a real environment using SCOUT. The mapping works very well, but after switching to **Localization Mode** in RTAB-Map Viz, **Nav2 does not activate** no matter how many times I run the following commands: ``` ros2 launch nav2_bringup navigation_launch.py ros2 launch nav2_bringup bringup_launch.py ``` In **Gazebo with TurtleBot3**, running `ros2 launch nav2_bringup navigation_launch.py` from the demo package worked perfectly, and Nav2 launched without any issues. However, in the real environment, it seems to require **Map.pgm and Map.yaml files**. Am I doing something wrong, or is this the expected behavior? Thank you for your dedication. |
return LaunchDescription([
# Arguments DeclareLaunchArgument('stereo', default_value='false', description='Use stereo input instead of RGB-D.'), DeclareLaunchArgument('localization', default_value='false', description='Launch in localization mode.'), DeclareLaunchArgument('rtabmap_viz', default_value='true', description='Launch RTAB-Map UI (optional).'), DeclareLaunchArgument('rviz', default_value='true', description='Launch RVIZ (optional).'), DeclareLaunchArgument('use_sim_time', default_value='false', description='Use simulation (Gazebo) clock if true'), DeclareLaunchArgument('log_level', default_value='info', description="ROS logging level (debug, info, warn, error). For RTAB-Map\'s logger level, use \"args\" argument."), # Config files DeclareLaunchArgument('cfg', default_value='', description='To change RTAB-Map\'s parameters, set the path of config file (*.ini) generated by the standalone app.'), DeclareLaunchArgument('gui_cfg', default_value='~/.ros/rtabmap_gui.ini', description='Configuration path of rtabmap_viz.'), DeclareLaunchArgument('rviz_cfg', default_value=config_rviz, description='Configuration path of rviz2.'), DeclareLaunchArgument('frame_id', default_value='base_link', description='Fixed frame id of the robot (base frame), you may set "base_link" or "base_footprint" if they are published. For camera-only config, this could be "camera_link".'), DeclareLaunchArgument('odom_frame_id', default_value='odom', description='If set, TF is used to get odometry instead of the topic.'), DeclareLaunchArgument('map_frame_id', default_value='map', description='Output map frame id (TF).'), DeclareLaunchArgument('map_topic', default_value='map', description='Map topic name.'), DeclareLaunchArgument('publish_tf_map', default_value='true', description='Publish TF between map and odomerty.'), DeclareLaunchArgument('namespace', default_value='rtabmap', description=''), DeclareLaunchArgument('database_path', default_value='~/.ros/rtabmap.db', description='Where is the map saved/loaded.'), DeclareLaunchArgument('topic_queue_size', default_value='60', description='Queue size of individual topic subscribers.'), DeclareLaunchArgument('queue_size', default_value='60', description='Backward compatibility, use "sync_queue_size" instead.'), DeclareLaunchArgument('qos', default_value='0', description='General QoS used for sensor input data: 0=system default, 1=Reliable, 2=Best Effort.'), DeclareLaunchArgument('wait_for_transform', default_value='0.2', description=''), DeclareLaunchArgument('rtabmap_args', default_value='--delete_db_on_start', description='Backward compatibility, use "args" instead.'), DeclareLaunchArgument('launch_prefix', default_value='', description='For debugging purpose, it fills prefix tag of the nodes, e.g., "xterm -e gdb -ex run --args"'), DeclareLaunchArgument('output', default_value='screen', description='Control node output (screen or log).'), DeclareLaunchArgument('initial_pose', default_value='', description='Set an initial pose (only in localization mode). Format: "x y z roll pitch yaw" or "x y z qx qy qz qw". Default: see "RGBD/StartAtOrigin" doc'), DeclareLaunchArgument('output_goal_topic', default_value='/goal_pose', description='Output goal topic (can be connected to nav2).'), DeclareLaunchArgument('use_action_for_goal', default_value='true', description='Connect to nav2\'s navigate_to_pose action server instead of publishing the output goal topic.'), DeclareLaunchArgument('ground_truth_frame_id', default_value='', description='e.g., "world"'), DeclareLaunchArgument('ground_truth_base_frame_id', default_value='', description='e.g., "tracker", a fake frame matching the frame "frame_id" (but on different TF tree)'), DeclareLaunchArgument('approx_sync', default_value='true', description='If timestamps of the input topics should be synchronized using approximate or exact time policy.'), DeclareLaunchArgument('approx_sync_max_interval', default_value='1.0', description='(sec) 0 means infinite interval duration (used with approx_sync=true)'), # RGB-D related topics DeclareLaunchArgument('rgb_topic', default_value='/camera/camera/color/image_raw', description=''), DeclareLaunchArgument('depth_topic', default_value='/camera/camera/depth/image_rect_raw', description=''), DeclareLaunchArgument('camera_info_topic', default_value='/camera/camera/color/camera_info', description=''), # Stereo related topics DeclareLaunchArgument('stereo_namespace', default_value='/stereo_camera', description=''), DeclareLaunchArgument('left_image_topic', default_value=[LaunchConfiguration('stereo_namespace'), '/left/image_rect_color'], description=''), DeclareLaunchArgument('right_image_topic', default_value=[LaunchConfiguration('stereo_namespace'), '/right/image_rect'], description='Use grayscale image for efficiency'), DeclareLaunchArgument('left_camera_info_topic', default_value=[LaunchConfiguration('stereo_namespace'), '/left/camera_info'], description=''), DeclareLaunchArgument('right_camera_info_topic', default_value=[LaunchConfiguration('stereo_namespace'), '/right/camera_info'], description=''), # Use Pre-sync RGBDImage format DeclareLaunchArgument('rgbd_sync', default_value='false', description='Pre-sync rgb_topic, depth_topic, camera_info_topic.'), DeclareLaunchArgument('approx_rgbd_sync', default_value='true', description='false=exact synchronization.'), DeclareLaunchArgument('subscribe_rgbd', default_value=LaunchConfiguration('rgbd_sync'), description='Already synchronized RGB-D related topic, e.g., with rtabmap_sync/rgbd_sync nodelet.'), DeclareLaunchArgument('rgbd_topic', default_value='rgbd_image', description=''), DeclareLaunchArgument('depth_scale', default_value='1.0', description=''), # Image topic compression DeclareLaunchArgument('compressed', default_value='false', description='If you want to subscribe to compressed image topics'), DeclareLaunchArgument('rgb_image_transport', default_value='compressed', description='Common types: compressed, theora (see "rosrun image_transport list_transports")'), DeclareLaunchArgument('depth_image_transport', default_value='compressedDepth', description='Depth compatible types: compressedDepth (see "rosrun image_transport list_transports")'), # LiDAR DeclareLaunchArgument('subscribe_scan', default_value='true', description=''), DeclareLaunchArgument('scan_topic', default_value='/scan', description=''), DeclareLaunchArgument('subscribe_scan_cloud', default_value='false', description=''), DeclareLaunchArgument('scan_cloud_topic', default_value='/velodyne_points', description=''), DeclareLaunchArgument('scan_normal_k', default_value='0', description=''), # Odometry DeclareLaunchArgument('visual_odometry', default_value='false', description='Launch rtabmap visual odometry node.'), DeclareLaunchArgument('icp_odometry', default_value='false', description='Launch rtabmap icp odometry node.'), DeclareLaunchArgument('odom_topic', default_value='/vectornav/imu', description='Odometry topic name.'), DeclareLaunchArgument('vo_frame_id', default_value=LaunchConfiguration('odom_topic'), description='Visual/Icp odometry frame ID for TF.'), DeclareLaunchArgument('publish_tf_odom', default_value='true', description=''), DeclareLaunchArgument('odom_tf_angular_variance', default_value='0.01', description='If TF is used to get odometry, this is the default angular variance'), DeclareLaunchArgument('odom_tf_linear_variance', default_value='0.001', description='If TF is used to get odometry, this is the default linear variance'), DeclareLaunchArgument('odom_args', default_value='', description='More arguments for odometry (overwrite same parameters in rtabmap_args).'), DeclareLaunchArgument('odom_sensor_sync', default_value='false', description=''), DeclareLaunchArgument('odom_guess_frame_id', default_value='', description=''), DeclareLaunchArgument('odom_guess_min_translation', default_value='0.0', description=''), DeclareLaunchArgument('odom_guess_min_rotation', default_value='0.0', description=''), # imu DeclareLaunchArgument('imu_topic', default_value='/vectornav/imu', description='Used with VIO approaches and for SLAM graph optimization (gravity constraints).'), DeclareLaunchArgument('wait_imu_to_init', default_value='false', description=''), DeclareLaunchArgument('always_check_imu_tf', default_value='false', description='The odometry node will always check if TF between IMU frame and base frame has changed. If false, it is checked till a valid transform is initialized.'), # User Data DeclareLaunchArgument('subscribe_user_data', default_value='false', description='User data synchronized subscription.'), DeclareLaunchArgument('user_data_topic', default_value='/user_data', description=''), DeclareLaunchArgument('user_data_async_topic', default_value='/user_data_async', description='User data async subscription (rate should be lower than map update rate).'), #GPS DeclareLaunchArgument('gps_topic', default_value='/gps/fix', description='GPS async subscription. This is used for SLAM graph optimization and loop closure candidates selection.'), # Tag/Landmark DeclareLaunchArgument('tag_topic', default_value='/detections', description='AprilTag topic async subscription. This is used for SLAM graph optimization and loop closure detection. Landmark poses are also published accordingly to current optimized map. Required: Remove optional frame name parameters from apriltag\'s cfg file so that TF frame can be deducted from topic\'s family and id.'), DeclareLaunchArgument('tag_linear_variance', default_value='0.0001', description=''), DeclareLaunchArgument('tag_angular_variance', default_value='9999.0', description='>=9999 means rotation is ignored in optimization, when rotation estimation of the tag is not reliable or not computed.'), DeclareLaunchArgument('fiducial_topic', default_value='/fiducial_transforms', description='aruco_detect async subscription, use tag_linear_variance and tag_angular_variance to set covariance.'), OpaqueFunction(function=launch_setup) ]) This is my parameter setting. |
Administrator
|
I general I recommend to start a new launch file from scratch or based on one of the examples or demos, instead of using rtabmap.launch.py. Or if you use rtabmap.launch.py, show only the arguments that were changed instead of copying the file (which makes it difficult to see the differences with the original).
Otherwise for: Map.pgm and Map.yaml would be files used by map_server node. With rtabmap, we don't need map_server node, rtabmap publishes directly the map topic. It means inside config of nav2, there could be a way to remove the map_server. |
Free forum by Nabble | Edit this page |