mcap icon indicating copy to clipboard operation
mcap copied to clipboard

Ability to load ros 2 message files directly from filesystem

Open amacneil opened this issue 2 years ago • 12 comments

Rather than needing --ament-prefix-path, let me specify a folder to recursively search for the appropriate missing msg files.

amacneil avatar Apr 27 '22 21:04 amacneil

Do you know how to point to the missing schemas? Pointing to my ROS2 project folder does not seem to help.

V0XNIHILI avatar Aug 27 '22 19:08 V0XNIHILI

@V0XNIHILI Have you tried using --ament-prefix-path as described here? https://mcap.dev/getting-started/ros-2

More info about the flag is available from mcap help convert:

      --ament-prefix-path string   (ros2 only) list of directories to search for message definitions
                                   separated by ':' on Unix-like platforms and ';' on Windows
                                   (e.g /opt/ros/galactic:/opt/ros/noetic, or C:\opt\ros\galactic;C:\opt\ros\noetic)

jtbandes avatar Aug 29 '22 18:08 jtbandes

Yes, I have tried that. When I pass the contents of the environment variable AMENT_PREFIX_PATH with that flag, the same happens. However, the error comes back so fast after pressing enter that I have the idea that it does not really consider my argument.

I run it like this:

./mcap convert rosbag2_2022_08_09-14_19_47_0.db3 test.mcap --ament-prefix-path /home/parallels/Projects/ROS2-Project/install/viz:/home/parallels/Projects/ROS2-Project/install/testing:/home/parallels/Projects/ROS2-Project/install/simulator:/home/parallels/Projects/ROS2-Project/install/fake_state_estimation:/home/parallels/Projects/ROS2-Project/install/fake_sensors:/home/parallels/Projects/ROS2-Project/install/fake_perception:/home/parallels/Projects/ROS2-Project/install/ava_state_estimation:/home/parallels/Projects/ROS2-Project/install/vehicle_config:/home/parallels/Projects/ROS2-Project/install/rviz_controller_plugin:/home/parallels/Projects/ROS2-Project/install/fake_embedded:/home/parallels/Projects/ROS2-Project/install/fake_dynamics:/home/parallels/Projects/ROS2-Project/install/controls_bypass:/home/parallels/Projects/ROS2-Project/install/collision_detector:/home/parallels/Projects/ROS2-Project/install/ava_planning:/home/parallels/Projects/ROS2-Project/install/sim_msgs:/home/parallels/Projects/ROS2-Project/install/se_msgs:/home/parallels/Projects/ROS2-Project/install/rviz_interface_plugin:/home/parallels/Projects/ROS2-Project/install/rosbag_frame_loader:/home/parallels/Projects/ROS2-Project/install/mission_control:/home/parallels/Projects/ROS2-Project/install/labeling_assist:/home/parallels/Projects/ROS2-Project/install/labeling_msgs:/home/parallels/Projects/ROS2-Project/install/keyboard_controls:/home/parallels/Projects/ROS2-Project/install/cms_car:/home/parallels/Projects/ROS2-Project/install/can_interface:/home/parallels/Projects/ROS2-Project/install/ava_fake_trackdrive:/home/parallels/Projects/ROS2-Project/install/embedded_msgs:/home/parallels/Projects/ROS2-Project/install/ava_perception:/home/parallels/Projects/ROS2-Project/install/cv_msgs:/home/parallels/Projects/ROS2-Project/install/cms_car_msgs:/opt/ros/galactic

Then, the output is:

failed to convert file: failed to find schema for embedded_msgs/msg/ASControlsEstimations: schema not found

However, the package that contains the missing messages is built successfully and can also be found/seen:

image

I 'installed' mcap like below (taken from this - https://github.com/foxglove/mcap/tree/main/go/cli/mcap - page)

wget https://github.com/foxglove/mcap/releases/latest/download/mcap-linux-amd64 -O mcap
chmod +x mcap

V0XNIHILI avatar Aug 30 '22 21:08 V0XNIHILI

Did you figure this out - @V0XNIHILI ? I have the same error - not sure how to point the tool to the correct message definition.

vj2181 avatar Sep 07 '22 17:09 vj2181

No, unfortunately not :(

Maybe @jtbandes, do you have some ideas/suggestions? Because I am unable to use Foxglove Studio without the MCAP CLI tool working

V0XNIHILI avatar Sep 07 '22 17:09 V0XNIHILI

In my case, echo $AMENT_PREFIX_PATH already has the correct directories with the message definitions - still the CLI tool fails with "schema not found" message. Explicitly specifying the directories does not help as well. Will wait and see if anyone else replies here.

vj2181 avatar Sep 07 '22 18:09 vj2181

@jtbandes would you have time to take a look at this? Because this leaves us unable to use the Foxglove Data Platform

V0XNIHILI avatar Sep 22 '22 09:09 V0XNIHILI

@james-rms putting on your radar

amacneil avatar Sep 22 '22 09:09 amacneil

@V0XNIHILI @vj2181 are you folks using .msg files or .idl?

jtbandes avatar Sep 22 '22 15:09 jtbandes

I am using .msg files

V0XNIHILI avatar Sep 22 '22 15:09 V0XNIHILI

Any update on this?

V0XNIHILI avatar Oct 03 '22 09:10 V0XNIHILI

If you are having difficulty with mcap convert, I recommend trying ros2 bag convert instead. It should achieve the same thing but will be more reliable at finding message definitions since it has access to the ros workspace.

amacneil avatar Oct 05 '22 14:10 amacneil

Closing this issue as not planned - for complex workspaces I recommend using ros2 bag convert with the mcap storage plugin.

james-rms avatar Nov 01 '22 23:11 james-rms