<div>A day later and I'm getting more familiar it. </div><div><br></div><div>I've been rebuilding an old arm control engine of ours into an ros environment, pulling apart the components very similarly to (but much simpler) than ros' move_arm and got a bit confused when running through the code that move_arm uses. It maintains its own state engine for the controller (server) status and I couldn't work out why you wouldn't just contact the server directly to query if its idle. Which is where getState came in, and I misinterpreted that as being the server state, not the state of whatever goal the client is managing.<br>
</div><div><br></div><div>I've since put alot more decision logic into the pre-emption parts and as Vijay mentioned, the code which contains your client can quite easily (when structured ok - aka move arm's internal controller status state) know whether a goal has or hasn't been sent for the SimpleActionClient/Server pair. I guess having this front-end state logic will, of course, only work if your server is serving only a single client, otherwise you'd have to address it in the pre-emption code/callback.</div>
<div><br></div><div>As for a usage scenario, what happens if you're low on computational power, and your goal preparation is pretty costly? You might want to periodically check while preparing that some other client hasn't dumped a goal on the server, at which point you could terminate the preparation and simply abort whatever you wanted to do a little bit earlier in the pipeline. In this sort of situation, it might be useful to know if the server is idle or not. This may be rare enough not to worry about though - whoever is writing the server could just add their own custom topic to do the job.</div>
<div><br></div><div>Cheers,</div><div>Daniel.</div><div><br></div><div class="gmail_quote">On 23 October 2010 00:53, Blaise Gassend <span dir="ltr"><<a href="mailto:blaise@willowgarage.com">blaise@willowgarage.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Daniel,<br>
<br>
getState() is telling you the state of the client's current goal, not<br>
the state of the server. Hence, if there is no goal, getState is<br>
meaningless. This makes sense because a server could have the ability<br>
to handle multiple goals in parallel. Hence, there isn't a single<br>
state for the server that you can query.<br>
<br>
I imagine that what you are trying to do is determine if a server that<br>
can only handle a single goal is currently busy. I don't think that<br>
there is a general answer to that question. Some servers might reject<br>
your goal if they are already busy. Others might interrupt the<br>
existing goal. Let's see what others have to reply.<br>
<br>
Blaise<br>
<div><div class="h5"><br>
On Fri, Oct 22, 2010 at 12:51 AM, Daniel Stonier <<a href="mailto:d.stonier@gmail.com">d.stonier@gmail.com</a>> wrote:<br>
><br>
> Just a quick question with regards to the simple action client - why is<br>
> using the getState() method considered improper when there is no goal<br>
> (action client outputs an ROS_ERROR when you do so). Is there another means<br>
> of querying the server to know whether it is currently handling a goal or<br>
> not?<br>
> Or perhaps, am I mistaken in thinking that I should be needing to?<br>
> Regards,<br>
> Daniel Stonier.<br>
> --<br>
> Phone : +82-10-5400-3296 (010-5400-3296)<br>
> Home: <a href="http://snorriheim.dnsdojo.com/" target="_blank">http://snorriheim.dnsdojo.com/</a><br>
> Yujin Robot: <a href="http://www.yujinrobot.com/" target="_blank">http://www.yujinrobot.com/</a><br>
> Eros: <a href="http://www.ros.org/wiki/eros" target="_blank">http://www.ros.org/wiki/eros</a><br>
> Embedded Control Libraries: <a href="http://snorriheim.dnsdojo.com/redmine/wiki/ecl" target="_blank">http://snorriheim.dnsdojo.com/redmine/wiki/ecl</a><br>
><br>
</div></div>> _______________________________________________<br>
> ros-users mailing list<br>
> <a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
> <a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
><br>
><br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Phone : +82-10-5400-3296 (010-5400-3296)<br>Home: <a href="http://snorriheim.dnsdojo.com/">http://snorriheim.dnsdojo.com/</a><br>Yujin Robot: <a href="http://www.yujinrobot.com/">http://www.yujinrobot.com/</a><br>
Embedded Control Libraries: <a href="http://snorriheim.dnsdojo.com/redmine/wiki/ecl">http://snorriheim.dnsdojo.com/redmine/wiki/ecl</a><br>