ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Question about generalizing a system

asked 2012-02-13 07:07:50 -0500

updated 2012-02-13 11:52:45 -0500

joq gravatar image

This question is about the best practices when generalizing a working ROS stack. I have a system that has many nodes working together to control a dynamic system. There is a vision processing node, an estimation node, a controller node, a wireless communication node, and a keyboard interface node (that allows the user to control all of the rest of the system). The way that the system runs is that there are a few rosparams that govern everything. For instance, there is a param that says what state the system is in e.g. calibration, running, idling, etc.; there is a param that says where the robot is supposed to start in a world frame (used for calibration and initializing an ekf); and there is a param that sets an index that tells my wireless system which robot I am talking to.

I have this system fully debugged and working nicely, and now I am looking to run multiple robots at the same time. I could make a parameter that specifies the number of robots I'm using, and then in every node add for-loops around all of the relevant pieces of code to handle multiple robots. However it seems to me that there should be a far easier solution. If I can just start up multiple instances of each node, and then have each node only have access to parameters in its own namespace, then I can create the functionality I want by just creating a bit more complicated launch file.

Does this seem possible? Where should I go to look for examples?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-02-13 08:04:52 -0500

DimitriProsser gravatar image

The easiest ways to do this is to use the <group> tag in a roslaunch XML. You can find that documentation here. Essentially, it would just launch each "system" (aka group of nodes) under a unique namespace. Thus, each robot would operate with its own set of parameters, and your launch file is actually quite simple.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2012-02-13 07:07:50 -0500

Seen: 225 times

Last updated: Feb 13 '12