ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
3

Unable to locate custom action using rosmsg with catkin

asked 2014-04-02 04:23:56 -0500

fherrero gravatar image

updated 2014-04-03 02:39:38 -0500

Using Hydro-Catkin, when we add a custom.action to my_package, although it is correctly generated and we can use it, it is not listed when using the rosmsg list command. And if we specify the package, rosmsg show my_package/customAction, it reports the following:

Unable to load msg [my_package/customAction]: Cannot locate message [customAction] in package [my_package] with paths [['my_workspace/src/my_package/msg']]

We already tried this answer, and we still have the same problem.

We have noticed that the action generated messages (customAction.msg, customActionGoal.msg, customGoal.msg, CustomActionFeedback.msg, etc.) are created in my_workspace/devel/share/my_package/msg, BUT the rosmsg tool searches them in my_workspace/src/my_package/msg.

With rosbuild this didn't happen, because the generated messages of the action were placed along with the regular messages in my_package/msg.

Is this a rosmsg bug in catkin? Or which would be the correct way to locate and get information of a custom action in catkin?

edit retag flag offensive close merge delete

Comments

I've run into the same issue this morning. My python code can't find the custom action messages either. The message files are generated under `my_workspace/devel/share/my_package/msg` as above, and the python files under `my_workspace/devel/lib/python2.7/site-packages/my_package/msg` too.

hawesie gravatar imagehawesie ( 2014-04-02 23:18:42 -0500 )edit

I solved my version of this problem using this answer: http://answers.ros.org/question/64935/importerror-with-custom-action-in-python/

hawesie gravatar imagehawesie ( 2014-04-02 23:49:49 -0500 )edit

I had a python file the same name as my package, e.g. `my_workspace/src/my_package/scripts/my_package.py` and when I was doing the import it was loading this file, not the ones for the auto-generated action messages. rosmsg still does not find the message files, but my code works nonetheless.

hawesie gravatar imagehawesie ( 2014-04-02 23:49:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-04-02 05:03:17 -0500

demmeln gravatar image

updated 2014-04-06 02:37:44 -0500

This looks like a environment setup problem.

How do you setup your ROS environment? What does your .bashrc contain (ROS related)? Do you source the devel/setup.bash of your workspace?

Edit:

It seems it is indeed a bug. @Dirk Thomas has filed a report and submitted a patch (see comments below): https://github.com/ros/ros_comm/pull/385

edit flag offensive delete link more

Comments

1

I source my_workspace/devel/setup.bash in my .bashrc, and everything seems to work fine. The problem is just with the custom action generated messages, which are no longer placed within the package, as it happened in Fuerte-Rosbuild, and then, rosmsg list/show can't find them.

fherrero gravatar imagefherrero ( 2014-04-02 21:58:23 -0500 )edit
1

Aha, yes I can confirm this problem. Not sure if this is a known limitation of the devel space. @Dirk Thomas do you know?

demmeln gravatar imagedemmeln ( 2014-04-03 04:47:10 -0500 )edit
3

That is indeed a problem. I was able to reproduce it easily - seems like nobody noticed until now. I have created a ticket / pull request: https://github.com/ros/ros_comm/pull/385 It would be great if you could give it a try and confirm that it works for you.

Dirk Thomas gravatar imageDirk Thomas ( 2014-04-04 14:18:17 -0500 )edit

Thanks @Dirk Thomas. We have tried the ticket. First, the 'rosmsg list' works, but it takes long to give the result (~15 seconds with a loaded ws). Second, the 'rosmsg show customAction' does not work yet, seems that the share-path fix in iterate_packages is needed also at least in get_msg_text.

fherrero gravatar imagefherrero ( 2014-04-06 23:51:47 -0500 )edit

I have updated the PR to also fix "rosmsg show". Can you please also measure what the time for "rosmsg list" was before applying the change? The ticket already mentions that it is expected that the runtime might double.

Dirk Thomas gravatar imageDirk Thomas ( 2014-04-07 10:35:59 -0500 )edit

"rosmsg show" works. Before the change, "rosmsg list" was instant. Now for me it goes from 10 to 30 sec, depending on the number of pkgs in the ws ("rosmsg show" takes double time, for list and show). As the problem was with custom actions only, maybe the /opt/ros/hydro/share/* paths can be skipped.

fherrero gravatar imagefherrero ( 2014-04-07 23:12:53 -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

2 followers

Stats

Asked: 2014-04-02 04:23:56 -0500

Seen: 751 times

Last updated: Apr 06 '14