tier4 / caret

CARET (Chain-Aware ROS Evaluation Tool) is one of performance analysis tools dedicated with ROS 2 applications
https://tier4.github.io/caret_doc/main/
Apache License 2.0
64 stars 16 forks source link

DispatchError from the multimethod package when validating traces #177

Closed m-alcon closed 11 months ago

m-alcon commented 11 months ago

Checklist

Issue type

Help wanted

Step where the issue is related to

Visualization

Environments

CARET version

Target application

Description

Hello Team.

A python error arises when trying to validate the trace data of the Autoware's logging_simulator example execution. However, babeltrace parses it without issues. The error is a DispatchError from the multimethod package.

I don't know if it could be related, but when building Autoware with CARET, the lidar_apollo_instance_segmentation package was not build using caret-rclcpp. I checked it with the following command.

ros2 caret check_caret_rclcpp -w ./

Moreover, I had another issue because of bokeh. But I could solve it downgrading bokeh from version 3.3.0 to 2.4.1.

Steps to reproduce

  1. Follow the Source Installation guide to build Autoware.
  2. Follow the Manual Installation guide to build CARET.
  3. Follow this guide to analyze Autoware with CARET.
  4. The error arises at this step, when validating trace data. The error also occurs if I try to create the analysis report following the guide.

Commands

ros2 caret check_ctf -d ~/.ros/tracing/autoware_launch_trace_20231027-143038/

Logs

Succeed to find record_cpp_impl. the C++ version will be used.
Traceback (most recent call last):
  File "/opt/ros/humble/bin/ros2", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.18.7', 'console_scripts', 'ros2')())
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 89, in main
    rc = extension.main(parser=parser, args=args)
  File "/home/me/Projects/ros2_caret_ws/build/ros2caret/ros2caret/command/caret.py", line 32, in main
    return extension.main(args=args)
  File "/home/me/Projects/ros2_caret_ws/build/ros2caret/ros2caret/verb/check_ctf.py", line 36, in main
    Lttng(args.trace_dir)
  File "/home/me/Projects/ros2_caret_ws/build/caret_analyze/caret_analyze/infra/lttng/lttng.py", line 284, in __init__
    data, events, begin, end = self._parse_lttng_data(
  File "/home/me/Projects/ros2_caret_ws/build/caret_analyze/caret_analyze/infra/lttng/lttng.py", line 307, in _parse_lttng_data
    data = Ros2DataModel()
  File "/home/me/Projects/ros2_caret_ws/build/caret_analyze/caret_analyze/infra/lttng/ros2_tracing/data_model.py", line 99, in __init__
    self.callback_start_instances = RecordsFactory.create_instance(
  File "/usr/local/lib/python3.10/dist-packages/multimethod/__init__.py", line 326, in __call__
    func = self[tuple(func(arg) for func, arg in zip(self.type_checkers, args))]
  File "/usr/local/lib/python3.10/dist-packages/multimethod/__init__.py", line 320, in __missing__
    raise DispatchError(msg, types, keys)
multimethod.DispatchError: ('create_instance: 2 methods found', (<class 'NoneType'>, <class 'multimethod.<class 'list'>'>), [(<class 'multimethod.typing.Optional[collections.abc.Sequence[dict[str, int]]]'>, <class 'multimethod.typing.Optional[collections.abc.Sequence[caret_analyze.record.column.ColumnValue]]'>), (<class 'multimethod.typing.Optional[collections.abc.Sequence[caret_analyze.record.interface.RecordInterface]]'>, <class 'multimethod.typing.Optional[collections.abc.Sequence[caret_analyze.record.column.ColumnValue]]'>)])

LTTng trace log file

No response

Screenshots

No response

xygyo77 commented 11 months ago

Thank you for your report. As you assumed, this error is caused by multimethod not being version 1.10 or higher. Please manually upgrade your multimethod version or bring your caret up to date.

If you bring caret up to date, ros2 caret check_caret_rclcpp -w . / is, ros2 caret check_caret_rclcpp . / " -w" is unnecessary.

ros2 caret check_ctf -d ~/.ros/tracing/autoware_launch_trace_20231027-143038/ is, ros2 caret check_ctf ~/.ros/tracing/autoware_launch_trace_20231027-143038/ will become " -d" is not necessary.

We are not familiar with the issue of lidar_apollo_instance_segmentation package not being built with caret-rclcpp. Have you already applied the following 3 FAQs? https://tier4.github.io/caret_doc/main/faq/known_issues/#build

m-alcon commented 11 months ago

Thank you very much for your help.

I had the repository up to date but I did not think about the repos in the src/ folder, sorry for that. I updated them and the multimethod problem is solved.

Before, I had only applied the first of the FAQs (Conflicts of dependency on libtracetools.so), since only with this modification all the packages were built and I thought all was OK. Now I have also applied the last one (SYSTEM's rclcpp is referred) and all packages are built using caret-rclcpp (checked with ros2 caret check_caret_rclcpp ./). However, I also tried to apply the second one (Build using ament_cmake) and the building did not finish. I can try to reproduce it and send the build error in case you want it, but all Autoware packages are built with caret-rclcpp and I had no errors with ros2 caret check_ctf, so it seems all is OK so far.

Thank you again.

xygyo77 commented 11 months ago

I am glad it worked out. Regarding the build, basically, I think it is a good idea to implement everything in the FAQ. Since caret is affected by ros2_humble, any changes to ros2 may require additional action. We recommend that you also check this FAQ.