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

Revision history [back]

OK I'm going to try answer that question but I'm not sure I'll give you the best answer so be nice =P.

I think it all depend on what you want to do exactly and I think running a Service might not be that stupid.

Service is used for a request-reply type of communication. You might want to use it there for when your arm is positioned then it send a message to the main node saying "I'm done you can start setting up yourself" and wait for a reply from the main telling him everything is ready. It could be a solution.

Using actionlib, you'll be able to have information about the user setting up the arm process at all the time. Meaning if you have any use in controlling the user set up this is the way to go. However, action lib is usually used to control how on "order" you gave is going, I didn't hear about it being used only as a way to "control" an action but I can't see any reason for it to not be possible. Again, I'm no expert on that so you'll be better searching a bit about it in case I'm wrong.

But if you want more than one node to be able to know when the user did put the arm in position, then just publish a topic /is_ready that tell everyone if the user finished his set up (sending a bool value or the arm position maybe ?). I think it's the easiest way to go and the most adaptable one to new designs (if you change your program design I mean).

So I think it's all depend on what you want and which type of usage you'll have.

Finally I don't know if it's possible to start a roslaunch within a C++ program and I'll be glad to know as it could be a quite elegant solution maybe.

Hope it helped.

OK I'm going to try answer that question but I'm not sure I'll give you the best answer so be nice =P.

I think it all depend on what you want to do exactly and I think running a Service might not be that stupid.

Service is used for a request-reply type of communication. You might want to use it there for when your arm is positioned then it send a message to the main node saying "I'm done you can start setting up yourself" and wait for a reply from the main telling him everything is ready. It could be a solution.

Using actionlib, you'll be able to have information about the user setting up the arm process at all the time. Meaning if you have any use in controlling the user set up this is the way to go. However, action lib is usually used to control how on "order" you gave is going, I didn't hear about it being used only as a way to "control" an action but I can't see any reason for it to not be possible. Again, I'm no expert on that so you'll be better searching a bit about it in case I'm wrong.

But if you want more than one node to be able to know when the user did put the arm in position, then just publish a topic /is_ready that tell everyone if the user finished his set up (sending a bool value or the arm position maybe ?). I think it's the easiest way to go and the most adaptable one to new designs (if you change your program design I mean).

So I think it's all depend on what you want and which type of usage you'll have.

Finally I don't know if it's possible to start a roslaunch within a C++ program and I'll be glad to know as it could be a quite elegant solution maybe.

EDIT :

Personally I would try to implement the "service" solution. Please, if something in my assumption is wrong, someone correct me :

Looking at this page, I don't see any reason that you can't have multiple nodes calling a service. Thus I would create the robot like this :

  • One main node that subscribe to the service (let's say /isready) that tell him when the robot is ready and set up by the user.
  • Then you have a "set-up" node that check if the robot is ready and publish false when not and true when it is ready on the service /isready. This node does all the setup.

Like this you don't need to publish sparse data since everything is done in the setup-node and you just say ready or not when the service is called. If you add a new node in your program it can then connect to the service and ask the same information as well on demand.

Hope it helped.