ros2genmsg not recognizing folder?
8 次查看(过去 30 天)
显示 更早的评论
I have the current folder structure here

where msg containts all the .msg files (as seen in px4_msgs github). I'm trying to add the PX4 messages to my matlab to incorporate it into a SitL loop for a quadrotor, but I'm receiving the following error:

But the msg folder clearly contains all the correct .msg files, so I'm not sure why this is having this error. Is there another step I need to add here?
3 个评论
TED MOSBY
2025-6-19
@Walter Roberson this is the same directory as the github repo mentioned by patrick
回答(1 个)
TED MOSBY
2025-6-24
Hi,
You can try the following workarounds:
- Double check your path actually contains .msg files and the folder containing those files should be named "msg" only so you can check for any whitespaces, etc.
- You can try putting the actual folder path in the "ros2genmsg" command.
- You can try going level 1 or 2 up in the folderpath, so instead of "...work/ros2_ws/src/px4_msgs" you can try "...work/ros2_ws/src" or "...work/ros2_ws/src/ros2_ws"
- If the above doesn't work then you can try a known bug fix as below, although the error message suggests something else but with the limited information provided, these are the only ways to debug the issue.
Refer to this MATLAB answer for the bug fix: https://www.mathworks.com/matlabcentral/answers/2042607-error-using-ros2genmsg-custom
Here is also a list of other MATLAB answers that you can refer if your issue persists futher: https://www.mathworks.com/support/search.html?c%5B%5D=support&q=ros2genmsg&page=1
Hope this helps! Feel free to reply to this answer for further queries.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Custom Message Support 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!