SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.67k stars 525 forks source link

Map does not grow after its initialization #438

Closed mac137 closed 3 years ago

mac137 commented 3 years ago

Required Info:

Steps to reproduce issue

I provide the static transform between my lidar base_scan and odom frame 'odom' in online_sync_launch.py:

    odom_lidar_static_tf = Node(
        name='tf2_ros_odom_lidar',
        package='tf2_ros',
        executable='static_transform_publisher',
        output='screen',
        arguments=['0', '0', '0', '0.0', '0.0', '0.0', 'odom', 'base_scan'],
    )

    ...

    ld.add_action(odom_lidar_static_tf)

    ...

... and I modify mapper_params_online_sync.yaml like this:

    # ROS Parameters
    odom_frame: odom
    map_frame: map
    base_frame: base_scan
    scan_topic: /scan

and then I do ros2 launch slam_toolbox online_sync_launch.py

Expected behavior

The map should grow and build progressively as my lidar moves.

Actual behavior

The map stays the same after its initialization by the package like this: Screenshot from 2021-09-18 19-33-35

and all the time after the initialization, the map stays as above even though the lidar moved and rotated a lot: Screenshot from 2021-09-18 19-33-15

Additional information

After running ros2 run tf2_tools view_frames.py I get this TF tree: Screenshot from 2021-09-18 19-45-30

and when I check the transform between map and odom is stays the same all the time:

ros2 run tf2_ros tf2_echo map odom
[INFO] [1631990416.761771843] [tf2_echo]: Waiting for transform map ->  odom: Invalid frame ID "map" passed to canTransform argument target_frame - frame does not exist
At time 1631990417.939988347
- Translation: [0.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
At time 1631990418.939988140
- Translation: [0.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
At time 1631990419.939991397
- Translation: [0.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
At time 1631990420.940001147
- Translation: [0.000, 0.000, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]

The console displays this all the time:

ros2 launch slam_toolbox online_sync_launch.py 
[INFO] [launch]: All log files can be found below /home/user_name/.ros/log/2021-09-18-19-52-49-142812-u20-21619
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [static_transform_publisher-1]: process started with pid [21621]
[INFO] [sync_slam_toolbox_node-2]: process started with pid [21623]
[INFO] [rviz2-3]: process started with pid [21625]
[static_transform_publisher-1] [INFO] [1631991169.189978256] [tf2_ros_fp_odom]: Spinning until killed publishing transform from 'odom' to 'base_scan'
[sync_slam_toolbox_node-2] [INFO] [1631991169.211974174] [slam_toolbox]: Node using stack size 40000000
[sync_slam_toolbox_node-2] [INFO] [1631991169.223044981] [slam_toolbox]: Using solver plugin solver_plugins::CeresSolver
[sync_slam_toolbox_node-2] [INFO] [1631991169.223135162] [slam_toolbox]: CeresSolver: Using SCHUR_JACOBI preconditioner.
[rviz2-3] [INFO] [1631991169.785774056] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-3] [INFO] [1631991169.785861010] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-3] [INFO] [1631991169.812876302] [rviz2]: Stereo is NOT SUPPORTED
[sync_slam_toolbox_node-2] Info: clipped range threshold to be within minimum and maximum range!
[sync_slam_toolbox_node-2] Registering sensor: [Custom Described Lidar]
[rviz2-3] [INFO] [1631991173.253112738] [rviz2]: Trying to create a map of size 115 x 79 using 1 swatches

Any idea what I do wrong? Thanks!

mac137 commented 3 years ago

Ofc the map does not grow because I put a static transform between odom and base_frame which is wrong. There should be an odometry method that keeps computing the relative pose between these two frames.

amjack0 commented 2 years ago

Ofc the map does not grow because I put a static transform between odom and base_frame which is wrong. There should be an odometry method that keeps computing the relative pose between these two frames.

Hi @maciej-3

I am having the similar issue. Did providing the odometry method between two frames worked? How did you solve this?

Regards,

mac137 commented 2 years ago

Hi @amjack0

I wrote a simple scan-to-scan odometry node for my lidar and it works good enough for this slam package.