MichaelGrupp / evo

Python package for the evaluation of odometry and SLAM
https://michaelgrupp.github.io/evo/
GNU General Public License v3.0
3.33k stars 745 forks source link

Unable to use /tf for trajectories #613

Closed Neathle closed 6 months ago

Neathle commented 7 months ago

Description: I have read in the wiki that I can use /tf:map.base_link to pass a tf to evo_traj, but it crashes inmediatly.

Command:

evo_traj bag 2023-12-10-10-42-17.bag /odom_gt /tf:odom.base_footprint --ref /odom_gt -as 

Console output:


[ERROR] Unhandled error in evo.main_traj
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/evo/entry_points.py", line 95, in launch
    main_module.run(args)
  File "/usr/local/lib/python3.8/dist-packages/evo/main_traj.py", line 196, in run
    trajectories, ref_traj = load_trajectories(args)
  File "/usr/local/lib/python3.8/dist-packages/evo/main_traj.py", line 105, in load_trajectories
    trajectories[topic] = file_interface.read_bag_trajectory(
  File "/usr/local/lib/python3.8/dist-packages/evo/tools/file_interface.py", line 284, in read_bag_trajectory
    return tf_tree_cache.get_trajectory(reader, identifier=topic)
  File "/usr/local/lib/python3.8/dist-packages/evo/tools/tf_cache.py", line 157, in get_trajectory
    self.from_bag(reader, topic, static_topic)
  File "/usr/local/lib/python3.8/dist-packages/evo/tools/tf_cache.py", line 94, in from_bag
    msg = deserialize_cdr(ros1_to_cdr(rawdata, connection.msgtype),
  File "/usr/local/lib/python3.8/dist-packages/rosbags/serde/serdes.py", line 139, in ros1_to_cdr
    msgdef = get_msgdef(typename, typestore)
  File "/usr/local/lib/python3.8/dist-packages/rosbags/serde/messages.py", line 49, in get_msgdef
    entries = typestore.FIELDDEFS[typename][1]
KeyError: 'tf/msg/tfMessage'

Additional files: Please attach all the files needed to reproduce the error.

Please give also the following information:

{ "console_logging_format": "%(message)s", "euler_angle_sequence": "sxyz", "global_logfile_enabled": false, "plot_axis_marker_scale": 0.0, "plot_backend": "Qt5Agg", "plot_figsize": [ 6, 6 ], "plot_fontfamily": "sans-serif", "plot_fontscale": 1.0, "plot_invert_xaxis": false, "plot_invert_yaxis": false, "plot_linewidth": 1.5, "plot_mode_default": "xyz", "plot_multi_cmap": "none", "plot_pose_correspondences": false, "plot_pose_correspondences_linestyle": "dotted", "plot_reference_alpha": 0.5, "plot_reference_axis_marker_scale": 0.0, "plot_reference_color": "black", "plot_reference_linestyle": "--", "plot_seaborn_palette": "deep6", "plot_seaborn_style": "darkgrid", "plot_show_axis": true, "plot_show_legend": true, "plot_split": false, "plot_start_end_markers": false, "plot_statistics": [ "rmse", "median", "mean", "std", "min", "max" ], "plot_texsystem": "pdflatex", "plot_trajectory_alpha": 0.75, "plot_trajectory_cmap": "jet", "plot_trajectory_length_unit": "m", "plot_trajectory_linestyle": "-", "plot_usetex": false, "plot_xyz_realistic": true, "pygments_style": "monokai", "ros_map_alpha_value": 1.0, "ros_map_cmap": "Greys_r", "ros_map_enable_masking": true, "ros_map_unknown_cell_value": 205, "ros_map_viewport": "keep_unchanged", "save_traj_in_zip": false, "table_export_data": "stats", "table_export_format": "csv", "table_export_transpose": true, "tf_cache_lookup_frequency": 10, "tf_cache_max_time": 10000.0 }

MichaelGrupp commented 7 months ago

KeyError: 'tf/msg/tfMessage'

Probably the /tf topic in your bag has the old tf message type instead of tf2_msgs/TFMessage?

The rosbags loader used here could maybe support this with a custom workaround. But for this I would need your data to be able to check, I haven't used the old tf since several years now so I don't have data. Can you upload it here somehow?

Otherwise this would be unsupported and I can add a note in the docs & a proper error in the library.