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

How to create a ROS package?

asked 2014-11-20 15:06:38 -0600

ed_win33 gravatar image

After creating a ROS package i'm trying the compile a code for a publisher node. I execute the command

rosmake minimal_nodes

The following error appears:

[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['minimal_nodes']
[ rosmake ] Logging to directory /home/fcs_basestation/.ros/rosmake/rosmake_output-20141120-145630 [ rosmake ] Expanded args ['minimal_nodes'] to: []
[ rosmake ] WARNING: The following args could not be parsed as stacks or packages: ['minimal_nodes'] [ rosmake ] ERROR: No arguments could be parsed into valid package or stack names.

I know i have to add the package to the ros_package_path. My question is how i do that? I have seen this question a lot of time here with worthless answers to it. I'm using hydro.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2014-11-20 17:00:14 -0600

William gravatar image

If the package you want to build is a rosbuild package (it has a manifest.xml and not a package.xml) then you need to put one of its containing folders in the ROS_PACKAGE_PATH. Imagine you have something like this:

% tree /tmp/my_workspace
└── my_package
    └── manifest.xml
    └── ...

1 directory, 1 file

And you want to build my_package, then you should put at least the my_workspace folder on the ROS_PACKAGE_PATH:

$ export ROS_PACKAGE_PATH=/tmp/my_workspace:$ROS_PACKAGE_PATH

That will allow rosmake to find your package and try to build it.

Also you should do that export line after sourcing any other setup.bash files, e.g. source /opt/ros/hydro/setup.bash.

edit flag offensive delete link more


Correct, it has a manifest.xml and not a package.xml.

I run the the command: $ export ROS_PACKAGE_PATH=/tmp/my_workspace:$ROS_PACKAGE_PATH replacing my_workspace with TestcodesRos which is my package and i'm still having the same error.

ed_win33 gravatar image ed_win33  ( 2014-11-21 13:13:52 -0600 )edit

You put the _path_ to TestcodesRos or just TestcodesRos? Please post exactly what you ran.

William gravatar image William  ( 2014-11-21 13:37:21 -0600 )edit

I ran:

$ export ROS_PACKAGE_PATH=/tmp/TestcodeRos:$ROS_PACKAGE_PATH

PD: My TestcodeRos is created on the desktop.

ed_win33 gravatar image ed_win33  ( 2014-11-24 08:32:07 -0600 )edit

@ed_win33 if TestcodeRos is on your Desktop then you have to put the path to it in your ROS_PACKAGE_PATH... Something like this export ROS_PACKAGE_PATH=/home/YOURUSER/Desktop/TestcodeRos:$ROS_PACKAGE_PATH. It obviously isn't at /tmp/TestcodeRos...

William gravatar image William  ( 2014-11-24 17:18:12 -0600 )edit

I successfully added the package to the path but when I run rosmake minimal_nodes is still not running. Also if i open a new terminal and run echo $ROS_PACKAGE_PATH the package that I just add is not there anymore. I read that this is something to be with the setup.bash.

ed_win33 gravatar image ed_win33  ( 2014-11-25 13:22:03 -0600 )edit

I tried several thing to fix the sourcing, if this is the problem, but no results by now

ed_win33 gravatar image ed_win33  ( 2014-11-25 13:23:14 -0600 )edit

You have to add it to the RPP in every new terminal or add it to your .bashrc. I would encourage you to read up on Linux terminals and how the shell environment works, the problems you are having are not really ROS related, but are instead related to how shells work in Linux.

William gravatar image William  ( 2014-11-27 08:08:52 -0600 )edit

Question Tools

1 follower


Asked: 2014-11-20 15:06:38 -0600

Seen: 259 times

Last updated: Nov 20 '14