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

Revision history [back]

Hi! Right I'll see what I can do, there's a lot of questions. But I do remember feeling exactly the same as yourself when I started working with ROS a couple of years ago, it can take a while to realise where everything should be and how bits of a project can be split up!

As you've noticed the built in ROS nodes which are already built live under /opt/ros/<ros_version>/bin this path is already setup so you can call these commands from anywhere.

When it comes to adding or removing packages as you've seen you can use catkin_create_pkg and define dependencies here. If you need to add or remove dependencies as you're developing a package you'll need to edit the package's CMakeLists.txt and package.xml files. These can look fairly daunting at first, but don't take too long to get used to and there are lots of questions you can search on here to help you along.

When it comes to deleting packages, you can simply remove the package's directory from the <your_workspace>/src/ folder. Assuming none of the other packages in your workspace depend on the deleted package everything should build fine after that.

Launch files are simply XML files that a read and executed by roslaunch they are not build in the same was as a c++ node will be for example. You can create and edit these and execute them using roslaunch without needed to rebuild your workspace.

When it comes to adding other peoples packages to your workspace, I've always had to build them after adding the source into my workspace. However there are a few parts of my ros system that I've used apt-get to download and install automatically, when this is available it's much simply and all the setup is taken care of by the debian package manager. However in these cases I these packages are not part of the workspace they are part of the larger ROS system on your computer. If they have custom message types or services you'll need to add them into a package in your workspace and build them, this will create the header files necessary to use them in your own c++ nodes.

In short most of the packages I've needed to download and work with I've added to my workspace in a directory such as <my_workspace>/src/<new_downloaded_package> then as long as you have all the dependencies of that new package installed it should build fine the next time you run catkin_make.

When it comes to creating new packages or editing existing ones, it's really down to how you design your system. The concept of a package is that it should be a set of nodes and functionality that stands by itself. For example where I work several different people perform different experiments and work on the same robot, so we've got one package that deals with the rover locomotion subsystem, another for the power sub system, and another for a particularly complex sensor. These packages are build and run on the robots on-board computer. Then different peoples experimental work exist in their own package usually on their own laptop. Each of these packages are maintained in their own git repository for safe keeping.

Final (bonus :-) question) Multiple devices do not need to share the same workspace in order to be able to interact. They simply need to share any custom message types or service types they are using. In some cases it's easier to use a single workspace that can be cloned onto multiple different devices and built, but it is not necessary to do this.

Hope that's cleared up some of your questions, let us know if you need anything else clearing up.