Ask Your Question
0

Package name is illegal

asked 2020-02-08 04:12:53 -0500

AndreaCec gravatar image

updated 2022-01-22 16:10:18 -0500

Evgeny gravatar image

Hello,

I installed ROS and then cloned the package into catkin_ws.

In the building of the package procedure through cd ~/catkin_ws, I got the ERROR message (ERROR 2) "Package name is illegal and cannot be used in the message generation".

Why? What can I do?

Thanks. Regards.

edit retag flag offensive close merge delete

Comments

You've very skillfully avoided mentioning the name of the package.

I would start with telling us what the name is.

and then cloned the package into catkin_ws.

which package is "the package"?

In the building of the package procedure through cd ~/catkin_ws

Merely cd-ing to the root of your workspace does not build it. That would be with either catkin_make or catkin build.

Finally, take a look at wiki/Names: Package Resource Names. Names for packages follow almost identical rules.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-08 04:56:31 -0500 )edit

Hello

You are right. The name of the package is visual-crop-row-navigation

AndreaCec gravatar image AndreaCec  ( 2020-02-08 05:07:19 -0500 )edit

Here what I had inserted into the terminal:

cd ~/catkin_ws catkin build visual-crop-row-navigation

AndreaCec gravatar image AndreaCec  ( 2020-02-08 05:15:39 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-02-08 05:19:10 -0500

gvdhoorn gravatar image

updated 2020-02-08 05:23:28 -0500

Dashes are indeed not legal in package names.

I suggest you use underscores (_) instead. Using underscores to separate words in package names is best practice.

See also REP-144: ROS Package Naming.


Edit: actually, I just remembered since ros-infrastructure/catkin_pkg#199 dashes are actually allowed. wiki/Names has not been updated to reflect this I believe.

catkin_tools (package providing the catkin tool) also seems to be enforcing the old rules.

However, having written this, I would strongly recommend to not use dashes (-) in package names. It goes against 10+ years of convention in ROS, and I doubt every tool has been updated to process them correctly.

In your case, I'd use the name visual_crop_row_navigation.

edit flag offensive delete link more

Comments

Related Q (no A yet): #q342424.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-08 05:24:32 -0500 )edit

I used as per your advice the underscores.

Error is solved but system now says that given package 'visual_crop_row_navigation' is not in the workspace.

I assume because in the clonig phase into catkin_ws, I used:

cd ~/catkin_ws/src git clone https://github.com/PRBonn/visual-crop...

Do I need to change something in the previous phase of cloning?

Thanks

AndreaCec gravatar image AndreaCec  ( 2020-02-08 05:32:04 -0500 )edit

Error is solved but system now says that given package 'visual_crop_row_navigation' is not in the workspace.

the name of a package is not determined by the name of the directory in which it resides.

To fix this you'd indeed have to change the name of the package (in the package.xml). Note however that there may be multiple references to the "old" name.

You may want to post an issue on the issue tracker of the author/maintainer to discuss this situation first.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-08 05:35:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-02-08 04:12:53 -0500

Seen: 414 times

Last updated: Feb 08 '20