ros2 / tutorials

Apache License 2.0
30 stars 11 forks source link

Creating custom msg and srv files: Files have to be in folders called msg or srv #29

Closed definitelyuncertain closed 1 year ago

definitelyuncertain commented 1 year ago

Hi, I was following the tutorial on Creating custom msg and srv files.

When I placed my .msg file in a folder that was not called msg, I got an error about the .idl file not being found when querying with ros2 interface show. The error went away when I renamed the folder to msg.

So it appears that the .msg files are expected to be in the msg directory in the package. The tutorial on the other hand suggests that it is recommended but not an issue to do otherwise:

It is good practice to keep .msg and .srv files in their own directories within a package.

If it is the case that the directory needs to be called msg, then the tutorial needs to state explicitly as such. Could somebody confirm this?

clalancette commented 1 year ago

Yes, this does indeed seem to be the case. It is interesting that the messages still show up in ros2 interface list, but at the moment ros2 interface show needs to have these in the msg or srv subdirectory.

Would you mind opening a pull request to https://github.com/ros2/ros2_documentation/blob/rolling/source/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.rst with that change?

definitelyuncertain commented 1 year ago

Hi, I've made a PR. I forgot to mention, I was using Galactic. Should I make a separate pull request for that branch too?

clalancette commented 1 year ago

Hi, I've made a PR. I forgot to mention, I was using Galactic. Should I make a separate pull request for that branch too?

No, we have a bot that will automatically backport it. Thanks for making the PR.

fujitatomoya commented 1 year ago

@definitelyuncertain can you close this, everything has been merged including backport to humble, galactic and foxy.