Isaac-ros-visual-slam LoadMapAdnLocalize crashes

Im having an issue when i try to load map and localize using vslam.

here is the action service call i use:

admin@lse-desktop:/workspaces/isaac_ros-dev$ ros2 action send_goal /visual_slam/load_map_and_localize isaac_ros_visual_slam_interfaces/action/LoadMapAndLocalize "{map_url: '/workspaces/isaac_ros-dev/maps/lab_map_vslam/data.mbd', localize_near_point: {x: 0.0, y: 0.0, z: 0.0}}"
Waiting for an action server to become available...
Sending goal:
     map_url: /workspaces/isaac_ros-dev/maps/lab_map_vslam/data.mbd
localize_near_point:
  x: 0.0
  y: 0.0
  z: 0.0

Goal accepted with ID: 2e1cdfa4eb314d538c5ffe09e6f9d3de


here is the output from vslam node:

between current and previous frame [44.508928] is above threshold [20.000000]
[component_container-1] [WARN] [1715217219.850367777] [visual_slam_node]: Delta between current and previous frame [22.254848] is above threshold [20.000000]
[component_container-1] [WARN] [1715217219.969362526] [visual_slam_node]: CallbackLoadMapAndLocalizeAccepted()
[component_container-1] [INFO] [1715217219.969472736] [visual_slam_node]: cuvslam: LoadMapAndLocalize /workspaces/isaac_ros-dev/maps/lab_map_vslam/data.mbd [0.000000, 0.000000, 0.000000]
[component_container-1] [WARN] [1715217219.975820676] [visual_slam_node]: Localization failed. Status=4
[component_container-1] [WARN] [1715217219.977607977] [visual_slam_node]: CUVSLAM_LocalizeInExistDb Error 4
[component_container-1] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
[component_container-1]   what():  goal_handle attempted invalid transition from state ABORTED with event ABORT, at /tmp/binarydeb/ros-humble-rcl-action-5.3.6/src/rcl_action/goal_handle.c:95
[ERROR] [component_container-1]: process has died [pid 24714, exit code -6, cmd '/opt/ros/humble/lib/rclcpp_components/component_container --ros-args -r __node:=visual_slam_launch_container -r __ns:=/'].

restarting the node and trying again does not work.

Im able to save the map with no issues:

admin@lse-desktop:/workspaces/isaac_ros-dev$ ros2 action send_goal /visual_slam/save_map isaac_ros_visual_slam_interfaces/action/SaveMap "{map_url: '/workspaces/isaac_ros-dev/maps/lab_map_vslam'}"
Waiting for an action server to become available...
Sending goal:
     map_url: /workspaces/isaac_ros-dev/maps/lab_map_vslam

Goal accepted with ID: 759b66557c694ff0b839776892d19b3a

Result:
    success: true
error: ''

Goal finished with status: SUCCEEDED

If anyone could shed some light on this issue it would be much appreciated.

When are you loading the map?

Before Isaac ROS vslam starts to build a map, it’s important to load the map first.

Thank you i was loading it after! This could be added as a comment somewhere in the quick starts so noobs like me don’t make this mistake!

Thank you for your time

@Raffaello Im still having issues with the map loading. first i have rviz open, then load map, then start vslam and the process dies anyways.

output from map action:

admin@lse-desktop:/workspaces/isaac_ros-dev$ ros2 action send_goal /visual_slam/load_map_and_localize isaac_ros_visual_slam_interfaces/action/LoadMapAndLocalize "{map_url: '/workspaces/isaac_ros-dev/maps/lab_map_vslam/data.mbd', localize_near_point: {x: 0.0, y: 0.0, z: 0.0}}"
Waiting for an action server to become available...
Sending goal:
     map_url: /workspaces/isaac_ros-dev/maps/lab_map_vslam/data.mbd
localize_near_point:
  x: 0.0
  y: 0.0
  z: 0.0

Goal accepted with ID: 7f7b271c45374dbb821b2ce2963acd30

output from vslam:

admin@lse-desktop:/workspaces/isaac_ros-dev$ ros2 launch isaac_ros_visual_slam isaac_ros_visual_slam_realsense.launch.py
[INFO] [launch]: All log files can be found below /home/admin/.ros/log/2024-05-11-12-20-26-146716-lse-desktop-21063
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [component_container-1]: process started with pid [21076]
[INFO] [realsense2_camera_node-2]: process started with pid [21078]
[component_container-1] [INFO] [1715444426.775932518] [visual_slam_launch_container]: Load Library: /workspaces/isaac_ros-dev/install/isaac_ros_visual_slam/lib/libvisual_slam_node.so
[realsense2_camera_node-2] [INFO] [1715444426.881207118] [camera.camera]: RealSense ROS v4.51.1
[realsense2_camera_node-2] [INFO] [1715444426.881425298] [camera.camera]: Built with LibRealSense v2.54.2
[realsense2_camera_node-2] [INFO] [1715444426.881454003] [camera.camera]: Running with LibRealSense v2.54.1
[realsense2_camera_node-2] [WARN] [1715444426.881474003] [camera.camera]: ***************************************************
[realsense2_camera_node-2] [WARN] [1715444426.881489715] [camera.camera]: ** running with a different librealsense version **
[realsense2_camera_node-2] [WARN] [1715444426.881504084] [camera.camera]: ** than the one the wrapper was compiled with!   **
[realsense2_camera_node-2] [WARN] [1715444426.881517620] [camera.camera]: ***************************************************
[realsense2_camera_node-2] [INFO] [1715444426.923638718] [camera.camera]: Device with serial number 243522073251 was found.
[realsense2_camera_node-2] 
[realsense2_camera_node-2] [INFO] [1715444426.923828577] [camera.camera]: Device with physical ID /sys/devices/platform/3610000.xhci/usb2/2-2/2-2:1.0/video4linux/video0 was found.
[realsense2_camera_node-2] [INFO] [1715444426.923854146] [camera.camera]: Device with name Intel RealSense D435I was found.
[realsense2_camera_node-2] [INFO] [1715444426.924255593] [camera.camera]: Device with port number 2-2 was found.
[realsense2_camera_node-2] [INFO] [1715444426.924294153] [camera.camera]: Device USB type: 3.2
[realsense2_camera_node-2] [INFO] [1715444426.929657928] [camera.camera]: getParameters...
[realsense2_camera_node-2] [INFO] [1715444426.932457690] [camera.camera]: JSON file is not provided
[realsense2_camera_node-2] [INFO] [1715444426.932529147] [camera.camera]: Device Name: Intel RealSense D435I
[realsense2_camera_node-2] [INFO] [1715444426.932551644] [camera.camera]: Device Serial No: 243522073251
[realsense2_camera_node-2] [INFO] [1715444426.932571260] [camera.camera]: Device physical port: /sys/devices/platform/3610000.xhci/usb2/2-2/2-2:1.0/video4linux/video0
[realsense2_camera_node-2] [INFO] [1715444426.932587740] [camera.camera]: Device FW version: 5.15.1
[realsense2_camera_node-2] [INFO] [1715444426.932602972] [camera.camera]: Device Product ID: 0x0B3A
[realsense2_camera_node-2] [INFO] [1715444426.932628061] [camera.camera]: Sync Mode: Off
[component_container-1] [INFO] [1715444426.971024101] [visual_slam_launch_container]: Found class: rclcpp_components::NodeFactoryTemplate<nvidia::isaac_ros::visual_slam::VisualSlamNode>
[component_container-1] [INFO] [1715444426.971173223] [visual_slam_launch_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<nvidia::isaac_ros::visual_slam::VisualSlamNode>
[realsense2_camera_node-2] [WARN] [1715444427.019208378] [camera.camera]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [WARN] [1715444427.028494334] [camera.camera]: Could not set param: rgb_camera.power_line_frequency with 3 Range: [0, 2]: parameter 'rgb_camera.power_line_frequency' could not be set: Parameter {rgb_camera.power_line_frequency} doesn't comply with integer range.
[realsense2_camera_node-2] [WARN] [1715444427.047586928] [camera.camera]: re-enable the stream for the change to take effect.
[realsense2_camera_node-2] [INFO] [1715444427.101884049] [camera.camera]: Stopping Sensor: Stereo Module
[component_container-1] [INFO] [1715444427.133395775] [visual_slam_node]: cuVSLAM version: 11.4
[realsense2_camera_node-2] [INFO] [1715444427.207412349] [camera.camera]: Starting Sensor: Stereo Module
[realsense2_camera_node-2] [INFO] [1715444427.268568696] [camera.camera]: Open profile: stream_type: Infra(1), Format: Y8, Width: 640, Height: 360, FPS: 90
[realsense2_camera_node-2] [INFO] [1715444427.268750555] [camera.camera]: Open profile: stream_type: Infra(2), Format: Y8, Width: 640, Height: 360, FPS: 90
[realsense2_camera_node-2] [INFO] [1715444427.268852957] [camera.camera]: Stopping Sensor: Motion Module
[realsense2_camera_node-2] [WARN] [1715444427.305197312] [camera.camera]: 
[realsense2_camera_node-2] [INFO] [1715444427.306894110] [camera.camera]: Starting Sensor: Motion Module
[realsense2_camera_node-2] [INFO] [1715444427.313597845] [camera.camera]: Open profile: stream_type: Accel(0)Format: MOTION_XYZ32F, FPS: 200
[realsense2_camera_node-2] [INFO] [1715444427.313754552] [camera.camera]: Open profile: stream_type: Gyro(0)Format: MOTION_XYZ32F, FPS: 200
[realsense2_camera_node-2] [INFO] [1715444427.316820974] [camera.camera]: RealSense Node Is Up!
[component_container-1] [INFO] [1715444429.338716849] [visual_slam_node]: Time taken by CUVSLAM_WarmUpGPU(): 2.204767
[INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/visual_slam_node' in container '/visual_slam_launch_container'
[component_container-1] [INFO] [1715444429.384380248] [visual_slam_node]: left_pose_right reading from CameraInfo
[component_container-1] [INFO] [1715444429.384486938] [visual_slam_node]: Baseline is : 0.050040
[component_container-1] [INFO] [1715444429.384522107] [visual_slam_node]: left_camera_pose_imu reading from TF Tree
[component_container-1] [INFO] [1715444429.384746207] [visual_slam_node]: Use use_gpu: true
[component_container-1] [INFO] [1715444429.384773951] [visual_slam_node]: Enable IMU Fusion: true
[component_container-1] [INFO] [1715444429.384792544] [visual_slam_node]: gyroscope_noise_density: 0.000244
[component_container-1] [INFO] [1715444429.384810400] [visual_slam_node]: gyroscope_random_walk: 0.000019
[component_container-1] [INFO] [1715444429.384826656] [visual_slam_node]: accelerometer_noise_density: 0.001862
[component_container-1] [INFO] [1715444429.384843329] [visual_slam_node]: accelerometer_random_walk: 0.003000
[component_container-1] [INFO] [1715444429.384858657] [visual_slam_node]: frequency: 200.000000
[component_container-1] [INFO] [1715444429.479447114] [visual_slam_node]: Time taken by CUVSLAM_CreateTracker(): 0.094571
[component_container-1] [WARN] [1715444429.576124024] [visual_slam_node]: CallbackLoadMapAndLocalizeAccepted()
[component_container-1] [INFO] [1715444429.576217402] [visual_slam_node]: cuvslam: LoadMapAndLocalize /workspaces/isaac_ros-dev/maps/lab_map_vslam/data.mbd [0.000000, 0.000000, 0.000000]
[component_container-1] [WARN] [1715444429.582781486] [visual_slam_node]: Localization failed. Status=4
[component_container-1] [WARN] [1715444429.583284439] [visual_slam_node]: CUVSLAM_LocalizeInExistDb Error 4
[component_container-1] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
[component_container-1]   what():  goal_handle attempted invalid transition from state ABORTED with event ABORT, at /tmp/binarydeb/ros-humble-rcl-action-5.3.6/src/rcl_action/goal_handle.c:95
[ERROR] [component_container-1]: process has died [pid 21076, exit code -6, cmd '/opt/ros/humble/lib/rclcpp_components/component_container --ros-args -r __node:=visual_slam_launch_container -r __ns:=/'].

it seems to accept the goal but then the vslam process dies. is there anything you see that stands out that is wrong?

thanks

hi, I was wondering how can we load a map without running vslam node, or before it starts building the map.

If I want to load the map, then the action “/visual_slam/load_map_and_localize” should be avaiable which means vslam node is running.

I tried in two cases which fails:
a. I first set the parameter “enable_localization_n_mapping” to false so that vslam will not build a map, and when I load the map still get error:

[visual_slam_node]: CUVSLAM_LocalizeInExistDb Error 6

b. and if I set the parameter “enable_localization_n_mapping” to True, still I get the error:

[visual_slam_node]: Localization failed. Status=3