[ros-users] Action client and server code in the same file...

Wim Meeussen meeussen at willowgarage.com
Mon Feb 7 16:51:07 UTC 2011


Felix,


> Digging into tuck_arms_action.py, it looks like the file contain the code for the action server AND the client... This got me confused for quite a while. I can see that if one calls it without argument, it seems to just start the server, yet I am not quite sure why this is done that way,  any explanation?...  Would not it be better to clearly separate the client/server code?

The original tuck arm script was only usable from the command line, it
did not have an action interface, and was intended to be used from the
command line. At some point we wanted the ability to tuck the arms
programatically, and we added the action server to the script.  But we
wanted to remain backwards compatible with the original usage of the
script, so we added an action client for when the script is called
with parameters from the command line.  You're right that it would be
cleaner if the server and client are separated; this is just one
solution to remain backwards compatibility.

> Moreover, the code in /opt/ros/cturtle/stacks/pr2_common_actions/pr2_tuck_arms_action/test/tuck_arms_test.py does not seem to be adapted to this action anymore as it tries to acces a goal.untuck field which I do not see in the .action file.

Good catch! Could you file a ticket for this bug, so we don't loose
track of this issue?  <https://code.ros.org/trac/wg-ros-pkg>


> PS: is the tuck_arms action server started at boot on the PR2? I am not at the lab right now, and cannot check directly.

The tuck arms server is not started when the PR2 gets launched. The
tuck arms script lives in a stack that has not been reviewed yet, so
the pr2_robot stack cannot depend on it yet.

Wim


-- 
--
Wim Meeussen
Willow Garage Inc.
<http://www.willowgarage.com)



More information about the ros-users mailing list