Having trouble reading ROS 2 bag with custom messages

26 Ansichten (letzte 30 Tage)
Ari Schwartz
Ari Schwartz am 5 Mär. 2023
Beantwortet: Sakshay am 13 Mär. 2023
I used ros2genmsg to generate the custom message types, but then I run ros2bagreader, it fails. It says that it doesn't recognize one of the message types.
When I run "ros2 msg list" in matlab, the custom message does appear...
Would appreciate any help. Thanks in advance!

Antworten (1)

Sakshay
Sakshay am 13 Mär. 2023
Hello Ari,
As per my understanding, after running "ros2genmsg" function, you are not able to view the custom messages that are generated using the "ros2 msg list" command.
ROS 2 custom messages are specified in ROS 2 package folders that contain a folder named "msg". The "msg" folder should contain all the custom message type definitions. Hence, you must have a ROS 2 package that contains the required "msg" file.
After ensuring that your custom message package is correct, you specify the path to the parent folder and call "ros2genmsg" with the specified path. The commands for that would look as below:
folderPath = fullfile(pwd,"<ROS2 Package Name>");
ros2genmsg(folderPath);
After running this command, make sure that the output indicates a successful build. After a successful build, you may run the "ros2 msg list" command to make sure the custom message is generated correctly.
For more information on generating custom messages from ROS2 definitions, you may refer to the following documentation:

Kategorien

Mehr zu Specialized Messages finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by