ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

ERROR: package name '***' is illegal and cannot be used in message generation.

asked 2018-08-11 23:24:52 -0500

Lemontree gravatar image

I add a msg file and build the working space. Add it reports such error. If anyone could help me out? Thanks very much!

edit retag flag offensive close merge delete



Please add your CMakeLists.txt and your package.xml to your question. Use the edit button/link for that.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-12 01:07:34 -0500 )edit

What @gvdhoorn wrote, plus - what is the name of your package / msg file?

autonomy gravatar image autonomy  ( 2018-08-13 12:56:12 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-08-12 01:15:04 -0500

gvdhoorn gravatar image

Without more information this is going to be difficult to pinpoint exactly, but the error message that you quote comes from generate_messages(..) in genpy/ (here). It checks whether the package name it's been passed is a legal ROS name using genmsg.is_legal_resource_base_name(..) (this one).

If that function returns false, the name is not legal (ie: contains characters that cannot be used, such as colons or other special characters other than _ and -), the error is printed and message generation is aborted.

You'll have to check whether your package name you used contains any such illegal characters and then change it.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-08-11 23:24:52 -0500

Seen: 937 times

Last updated: Aug 12 '18