Closed ResearcherYan closed 5 months ago
First, I have to correct my wrong judgement above. According the link, actually the above warning icp_odometry: Did not receive data since 5 seconds! Make sure the input topics are published
doesn't mean the odometry mulfunctions. Setting use_sim_time
to true
in rtabmap_s3e_lidar_odometry.launch.py
can mute these warnings.
The odom topic is published normally.
$ ros2 topic echo /r0/odom | grep position -A3
position:
x: 60.38409423828125
y: -96.45026397705078
z: 22.329843521118164
--
position:
x: 60.287715911865234
y: -96.53614044189453
z: 22.338281631469727
--
position:
x: 60.1495246887207
y: -96.63011932373047
z: 22.352752685546875
--
position:
x: 60.008033752441406
y: -96.71749877929688
z: 22.359445571899414
--
position:
x: 59.893531799316406
y: -96.8121109008789
z: 22.371158599853516
So I want to check the map built by the odometry. But ros2 topic hz /r0/odom_local_map
shows nothing. Using cslam_visualization
yields nothing as well. Logs and rviz are shown below.
$ ros2 launch cslam_visualization visualization_lidar.launch.py
[INFO] [launch]: All log files can be found below /root/.ros/log/2024-03-14-07-44-38-357204-focal-fossa-382468
[INFO] [launch]: Default logging verbosity is set to INFO
/Swarm-SLAM/install/cslam_visualization/share/cslam_visualization/config/lidar.rviz
[INFO] [visualization_node.py-1]: process started with pid [382469]
[INFO] [rviz2-2]: process started with pid [382471]
[rviz2-2] QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[rviz2-2] amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
[rviz2-2] If they do, bad things may happen!
[rviz2-2] amdgpu: drmGetDevice2 failed.
[rviz2-2] [INFO] [1710402278.786154731] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] [INFO] [1710402278.786377196] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-2] [INFO] [1710402278.824423561] [rviz2]: Stereo is NOT SUPPORTED
[visualization_node.py-1] [INFO] [1710402280.481047464] [cslam_visualization]: rotation_to_sensor_frame: [0.5, -0.5, 0.5, -0.5]
[visualization_node.py-1] [INFO] [1710402280.481894046] [cslam_visualization]: Initialization done.
[visualization_node.py-1] [INFO] [1710402285.365301625] [cslam_visualization]: Publishing 0 pointclouds.
[visualization_node.py-1] [INFO] [1710402290.364881388] [cslam_visualization]: Publishing 0 pointclouds.
[visualization_node.py-1] [INFO] [1710402295.364725938] [cslam_visualization]: Publishing 0 pointclouds.
[visualization_node.py-1] [INFO] [1710402300.364767124] [cslam_visualization]: Publishing 0 pointclouds.
[visualization_node.py-1] [INFO] [1710402305.364765231] [cslam_visualization]: Publishing 0 pointclouds.
[visualization_node.py-1] [INFO] [1710402310.365180516] [cslam_visualization]: Publishing 0 pointclouds.
Can you post your Swarm-SLAM config file? Check if you enabled visualization
@lajoiepy The config file graco_lidar.yaml
is shown below. visualization.enable
is set to true by default.
/**:
ros__parameters:
frontend:
odom_topic: "odom"
sensor_type: "lidar"
pointcloud_topic: "pointcloud"
voxel_size: 0.5
registration_min_inliers: 60
inter_robot_loop_closure_budget: 1
inter_robot_detection_period_sec: 5
enable_sparsification: true
max_queue_size: 10
similarity_threshold: 0.8
global_descriptors_topic: "global_descriptors"
intra_loop_min_inbetween_keyframes: 20
detection_publication_period_sec: 0.5
detection_publication_max_elems_per_msg: 100
enable_intra_robot_loop_closures: true
keyframe_generation_ratio_distance: 0.5
pointcloud_odom_approx_time_sync_s: 0.1
use_vertex_cover_selection: true
map_manager_process_period_ms: 100
global_descriptor_technique: "scancontext"
neighbor_management:
enable_neighbor_monitoring: true
max_heartbeat_delay_sec: 5.0
init_delay_sec: 5.0
heartbeat_period_sec: 1.0
backend:
pose_graph_optimization_start_period_ms: 10000
pose_graph_optimization_loop_period_ms: 100
max_waiting_time_sec: 3600
enable_broadcast_tf_frames: true
evaluation:
enable_logs: true
log_folder: "results"
enable_gps_recording: false
gps_topic: "gps/fix"
enable_sparsification_comparison: false
visualization:
enable: true
publishing_period_ms: 1000
Do you have any errors when you launch the visualization package? https://github.com/lajoiepy/cslam_visualization
When I type ros2 launch cslam_visualization visualization_lidar.launch.py
, the cslam_visualization package doesn't report any error. But rviz seems to complain about my gpu. Yet rviz interface pops out normally. The logs and rviz interface is shown below.
root@focal-fossa:/# ros2 launch cslam_visualization visualization_lidar.launch.py
[INFO] [launch]: All log files can be found below /root/.ros/log/2024-03-23-03-37-54-376452-focal-fossa-10518
[INFO] [launch]: Default logging verbosity is set to INFO
/Swarm-SLAM/install/cslam_visualization/share/cslam_visualization/config/lidar.rviz
[INFO] [visualization_node.py-1]: process started with pid [10519]
[INFO] [rviz2-2]: process started with pid [10521]
[rviz2-2] QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[rviz2-2] amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
[rviz2-2] If they do, bad things may happen!
[rviz2-2] amdgpu: drmGetDevice2 failed.
[rviz2-2] [INFO] [1711165074.825419596] [rviz2]: Stereo is NOT SUPPORTED
[rviz2-2] [INFO] [1711165074.825701006] [rviz2]: OpenGl version: 4.6 (GLSL 4.6)
[rviz2-2] [INFO] [1711165074.860264893] [rviz2]: Stereo is NOT SUPPORTED
[visualization_node.py-1] [INFO] [1711165076.345212321] [cslam_visualization]: rotation_to_sensor_frame: [0.5, -0.5, 0.5, -0.5]
[visualization_node.py-1] [INFO] [1711165076.345676968] [cslam_visualization]: Initialization done.
[visualization_node.py-1] [INFO] [1711165081.248205032] [cslam_visualization]: Publishing 0 pointclouds.
I finally found the reason why cslam_visualization didn't display any information.
In cslam_lidar.launch.py
line 38, it remaps /r0/pointcloud
to /points
. However, in lidar_handler_node.py
line 29, the ApproximateTimeSynchronizer
still subscribes to the topic /r0/pointcloud
, which has been remapped to /points
. So the lidar_callback
function in lidar_handler_node.py
is never called.
The following wrong rqt_graph shows node /r0/cslam_map_manager
doesn't even subscribe to any lidar topic.
When I remove the remappings, things seem to be back on track. The new rqt_graph shows that /r0/cslam_map_manager
can subscribe to lidar topic correctly now.
Here is the final trajectory visualized by cslam_visualization
after all three graco bags ran over and all the loop closures were done.
Yet, the trajectories should be wrong, since they are actually not in the same plane. Maybe it's because the odometry is not real-time on my computer. It can be seen that the odometry can only run at a rate of around 2~3Hz even no loop have been detected.
[icp_odometry-6] [INFO] [1711546109.177350137] [r0.icp_odometry]: Odom: ratio=0.433020, std dev=0.057857m|0.018296rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546109.641444070] [r0.icp_odometry]: Odom: ratio=0.516837, std dev=0.050595m|0.016000rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546110.126337347] [r0.icp_odometry]: Odom: ratio=0.484840, std dev=0.053708m|0.016984rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546110.597401408] [r0.icp_odometry]: Odom: ratio=0.472437, std dev=0.057664m|0.018235rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546110.815501746] [r0.icp_odometry]: Odom: ratio=0.517016, std dev=0.049948m|0.015795rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546111.172892491] [r0.icp_odometry]: Odom: ratio=0.576974, std dev=0.046333m|0.014652rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546111.712104702] [r0.icp_odometry]: Odom: ratio=0.543582, std dev=0.048948m|0.015479rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546112.078467445] [r0.icp_odometry]: Odom: ratio=0.465846, std dev=0.052607m|0.016636rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546112.534179020] [r0.icp_odometry]: Odom: ratio=0.574168, std dev=0.040468m|0.012797rad, update time=0.000000s
[icp_odometry-6] [INFO] [1711546112.930852585] [r0.icp_odometry]: Odom: ratio=0.506273, std dev=0.054459m|0.017221rad, update time=0.000000s
I'll try to run the algorithm on a more advanced computer later.
I met the visualization problem as well, could you list the order and command as well? Thanks
@HaynesLi Actually for my case it's quite easy to fix the visualization problem.
cslam_lidar.launch.py
line 38-40. colcon build
Then cslam_visualization
works fine.
Hope it'll help you.
@HaynesLi Actually for my case it's quite easy to fix the visualization problem.
1. Remove [`cslam_lidar.launch.py` line 38-40](https://github.com/lajoiepy/cslam_experiments/blob/6a576a6ad040036b6b71691e1fa01b7b79e5d828/launch/cslam/cslam_lidar.launch.py#L38). 2. Rebuild: `colcon build`
Then
cslam_visualization
works fine.Hope it'll help you.
It seems that you don't use the Graco ros2bag to run, right?
These following processes are what I have done. Configuration:
I created the three folders named Graco-0, Graco-1 and Graco-2 under the /src/cslam_experiments/data/Graco_Ground/ , where I put my symlinks to the first three ROS2bags datasets that I downloaded from the GRACO datasets website (Ground-01, Ground-02 and Ground-03). I also had to do the same in the /install/cslam_experiments/share/cslam_experiments/data/Graco_Ground/ folder to be able to run the experiment without errors of missing data.
Execution:
I launch the simulation executing ros2 launch cslam_experiments graco_lidar.launch.py .
I launch the visualization with ros2 launch cslam_visualization visualization.laun
@HaynesLi I also used the graco dataset and launched the same launch file as you did.
@HaynesLi If you still have the visualization problem after following the above instruction, I suggest you check your rqt_graph to make sure the message flow is normal.
The code of this project is different from what I cloned before 5 months. In my codes, there is no remappings function just like you mentioned. It still can not be visualized. Can this project really be processed?
I installed Swarm-SLAM on docker and ran the graco example with visualization successfully, except for the bad real-time performance. If you want to try, maybe you could refer to my previous experience on issue #30.
I installed Swarm-SLAM on docker and ran the graco example with visualization successfully, except for the bad real-time performance. If you want to try, maybe you could refer to my previous experience on issue #30.
I run in docker as well. Now I found the problem. The data might not transport between 2 terminal windows even if these two windows exec the same docker container.
But the new problem to me is I don't know how to run the launch command in backend so that the running process will not be interrupted. Do you have any ideas?
If I do not run it in the backend, I can not run the visualization command in the same terminal.
I launch graco_lidar.launch.py
and cslam_visualization
in two separate terminals. I think there's no data transport problem.
I launch
graco_lidar.launch.py
andcslam_visualization
in two separate terminals. I think there's no data transport problem.
I tried 2 times with different visualization command in i) and ii)
i)
Step 1: ros2 launch cslam_experiments graco_lidar.launch.py
output of terminal:
step2: ros2 launch cslam_visualization visualization_lidar.launch.py
output of terminal:
ii)
Step 1: ros2 launch cslam_experiments graco_lidar.launch.py
output of terminal:
Step2: ros2 launch cslam_visualization visualization_lidar.launch.py
output of terminal:
ii)
It seems your cslam_visualization
package can't find rclpy module. Maybe you should try to fix that first.
icp_odometry mulfunction
After successfully launching Swarm-SLAM without error, I want to visualized the accmulated map but yield failure. The logs are shown below.
The warning
icp_odometry: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set
seems indicatertabmap
doesn't receive the lidar data.However, the lidar data's topic pulishes pointclouds just fine.
Then I use
rqt_graph
to check the ROS graph, where I find thepose_graph_manager
will publish the topic/r0/cslam/keyframe_odom
andmap_manager
will subscribe to it.However, the topic
/r0/cslam/keyframe_odom
doesn't publish any data, which confirmed that thertabmap
doesn't run correctly.I have no idea why rtabmap doesn't receive the lidar data when it's published correctly.
rtabmap can't activate visualization
In
rtabmap_s3e_lidar_odometry.launch.py
,rtabmapviz
is set totrue
. But when I launch this launch file, rviz doesn't show up.Intead, using rtabmap source launch file with
ros2 launch rtabmap_launch rtabmap.launch.py
can activate the rviz.I don't know why the
rtabmap_s3e_lidar_odometry.launch.py
doesn't activate rviz.@lajoiepy Any help will be appreciated! Thank you!