Rosanswers logo

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?

Originally posted by fherrero on ROS Answers with karma: 738 on 2014-04-02

Post score: 3

Original comments

Comment by hawesie on 2014-04-02:
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.

Comment by hawesie on 2014-04-02:
I solved my version of this problem using this answer: http://answers.ros.org/question/64935/importerror-with-custom-action-in-python/

Comment by hawesie on 2014-04-02:
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.


1 Answer 1


Rosanswers logo

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?


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

Originally posted by demmeln with karma: 4306 on 2014-04-02

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by fherrero on 2014-04-02:
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.

Comment by demmeln on 2014-04-03:
Aha, yes I can confirm this problem. Not sure if this is a known limitation of the devel space. @Dirk Thomas do you know?

Comment by Dirk Thomas on 2014-04-04:
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.

Comment by fherrero on 2014-04-06:
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.

Comment by Dirk Thomas on 2014-04-07:
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.

Comment by fherrero on 2014-04-07:
"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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.