Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clip] Script fails when encountering an unknown message type #4

Open
boxanm opened this issue Feb 7, 2024 · 1 comment
Open

[clip] Script fails when encountering an unknown message type #4

boxanm opened this issue Feb 7, 2024 · 1 comment

Comments

@boxanm
Copy link
Contributor

boxanm commented Feb 7, 2024

When processing a rosbag containing an unknown message type, the clip tool ends raising a rosbags.typesys.base.TypesysError.
A preferred behavior, in my opinion, would be to notify the user about it but process the rest of the bag file.

@RedLeader962
Copy link

RedLeader962 commented Apr 6, 2024

Same here

$ rosbag-tools topic-remove -f -t /diagnostics rosbag2_2023_09_25-14_20_35

/usr/local/lib/python3.8/dist-packages/rosbag_tools/topic_remove/topic_remover.py:164: UserWarning: Output path rosbag2_2023_09_25-14_20_35_filt already exists, output overwriting flag has been set, deleting old output file
  warnings.warn(
Traceback (most recent call last):
  File "/usr/local/bin/rosbag-tools", line 8, in <module>
    sys.exit(cli_main())
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/rosbag_tools/utils.py", line 75, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/rosbag_tools/topic_remove/main.py", line 59, in cli
    rosbag_rem.export(default_outpath, force_output_overwrite=force)
  File "/usr/local/lib/python3.8/dist-packages/rosbag_tools/topic_remove/topic_remover.py", line 196, in export
    conn_map[conn.id] = writer.add_connection(
  File "/usr/local/lib/python3.8/dist-packages/rosbags/rosbag2/writer.py", line 195, in add_connection
    msgdef, _ = generate_msgdef(msgtype, ros_version=2)
  File "/usr/local/lib/python3.8/dist-packages/rosbags/typesys/msg.py", line 493, in generate_msgdef
    msgdef, md5sum = gendefhash(typename, subdefs, typestore, ros_version)
  File "/usr/local/lib/python3.8/dist-packages/rosbags/typesys/msg.py", line 405, in gendefhash
    raise TypesysError(f'Type {typename!r} is unknown.')
rosbags.typesys.base.TypesysError: Type 'rosbridge_msgs/msg/ConnectedClients' is unknown.

I figure we need to use the --msg-path <path/to/custom/msg> flag in that case. If that so, maybe the script could handle the error and tell the user about proper usage recommandation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants