ros2genmsg not recognizing folder?

8 visualizzazioni (ultimi 30 giorni)
Patrick
Patrick il 18 Giu 2025
Risposto: TED MOSBY il 24 Giu 2025
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 Commenti
Walter Roberson
Walter Roberson il 19 Giu 2025
I would double check that the msg directory contains *.msg files
TED MOSBY
TED MOSBY il 19 Giu 2025
@Walter Roberson this is the same directory as the github repo mentioned by patrick

Accedi per commentare.

Risposte (1)

TED MOSBY
TED MOSBY il 24 Giu 2025
Hi,
You can try the following workarounds:
  1. 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.
  2. You can try putting the actual folder path in the "ros2genmsg" command.
  3. 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"
  4. 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.
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.

Categorie

Scopri di più su Custom Message Support in Help Center e File Exchange

Tag

Prodotti


Release

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by