I realize this is an old thread, but (I hope) this is related: is there documentation somewhere about the naming conventions for the generated message headers in ROS 2? The .msg files are all CamelCase, but the .hpp file names all seem to be converted to snake_case, which was a bit confusing at first.
Both file names must use an upper camel case name and only consist of alphanumeric characters.
So that’s for .msg & .srv files.
As for snake_case headers, that’s just file naming convention. While it doesn’t explicitly talk about it, the Introduction to msg and srv interfaces tutorial (although it’s a draft) does use snake_case headers.
@christophebedard Thanks, yes, I realize that now. My confusion was that, from the tutorial, I thought it just made the file names lower case (in the tutorial Num.msg becomes num.hpp). So I had defined a message file like Foo3D.msg and I tried including it as foo3D.hpp, which didn’t work. I had to use foo3_d.hpp.
Hey i know it’s an old thread but I’m learning ROS now and I’ve been trying to find info on precisely this.
So what I gather is that the msg and or srv should be named with camel case and then it will become an .hpp of the form "all lowercases and an underscore before every upercase in the the original camelcase name + .hpp?
thank you!
So… if I named a .msg “Sensor3DState.msg” what would the .hpp be?
sensor3_Dstate.hpp? sensor3_d_state.hpp?
Or I should I also never name anything that allows for 2 Caps to be together… which i guess makes sense.
and also… why does it seem to be an obvious thing? i dont see it mentioned or explained anywhere. Granted im a noob to it all but is like everyone understands it and is obvious. But I dont see it explained. Is it a C++ thing or a ROS thing?