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

Do ROS srv open and close nodes?

asked 2015-09-24 08:45:44 -0500

Metalzero2 gravatar image

Hello all,

Not sure if it's important information for this question but I am using ROS indigo.

Let me give you the back story. I have two nodes. Lets call them Node1 and Node2. Node1 publishes messages to Node2. But Node2 does not want a continues stream of data. So the logical thing is to make Node1 use a srv so Node2 can request the data when ever it needs it. Here is where I am skeptical.

When ever I run Node1 (using rosrun) it needs about 2.5 seconds to start streaming data. After it starts, it will send data every 0.5 sec.

If I use srv on Node1, will it need the 2.5 sec it need to start (so every time Node2 request something Node1 will startup, answer and close down) or will it be able to answer every 0.5 sec (so Node1 does not close down but is in a "idle" state) like it does now that it is continuously sending data?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-09-24 08:49:02 -0500

NEngelhard gravatar image

Is there a reason why you don't just try?

If Node1 is already running, it will be able to answer the service-request immediately.

edit flag offensive delete link more

Comments

Because I am not experienced with rossrv yet and it will take me many hours to change it from rosmsg. I just wanted to be sure that it will not need the initialization time (the 2.5 sec). Thanks very mush for your help :)

Metalzero2 gravatar image Metalzero2  ( 2015-09-24 13:36:05 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-09-24 08:45:44 -0500

Seen: 118 times

Last updated: Sep 24 '15