Having trouble reading ROS 2 bag with custom messages
10 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Sakshay
on 13 Mar 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:
0 Comments
See Also
Categories
Find more on Specialized Messages in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!