Having trouble reading ROS 2 bag with custom messages
26 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Sakshay
2023-3-13
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specialized Messages 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!