PR2 / pr2_common_actions

2 stars 14 forks source link

tuck_arms_main.py doesn't work properly #34

Open sonyaa opened 9 years ago

sonyaa commented 9 years ago

This script is used by the tuck_arm app, and that app calls the main function of the script, assuming it will tuck the arms (https://github.com/PR2/pr2_apps/blob/hydro-devel/pr2_tuckarm/scripts/tuck_arms.py) - that's the way it was in Groovy. The most recent version of tuck_arms_main.py, however, only launches the server, and doesn't actually do anything. I'm not sure if this is a bug here or there, but I'm inclined to think here, because in Groovy it used to work, and the pr2_apps didn't change anything.

In short, tucking arms from the command line doesn't work in Hydro at all, which is frustrating - the only way to tuck arms is to write your own script.

sonyaa commented 9 years ago

Oh, there's actually a pull request for that already: https://github.com/PR2/pr2_common_actions/pull/33

UltronDestroyer commented 9 years ago

tuck_arms_main should work properly because this package is being generated from the hydro-devel-unstable repository, which has that code.

sonyaa commented 9 years ago

Are you sure? This seems to be the same: https://github.com/PR2/pr2_common_actions/blob/hydro-devel-unstable/pr2_tuck_arms_action/src/pr2_tuck_arms_action/tuck_arms_main.py I understand that this is the server code, but its main() function is called by tuck_arms with the assumption that it will tuck the arms.

On the other hand, the pr2_tuck_arms_action/tuck_arms_main.py on my computer (installed from debs) contains only the client code, and not the server code... I can't actually find the server code anywhere.

UltronDestroyer commented 9 years ago

I was able to get this to work properly, but it is a bit convoluted on how it does it now. I'm not sure why it was changed, I haven't read through the docs/history yet, but I'll take a look.

Here's the flow now: rosrun pr2_tuck_arms_action tuck_arms_main.py rosrun pr2_tuck_arms_action tuck_arms_test.py -l tuck

(you can use -l or -r to specify left or right, and tuck and untuck to do that)

sonyaa commented 9 years ago

That didn't work for me, I got the following error:

[rosrun] Couldn't find executable named tuck_arms_test.py below /opt/ros/hydro/share/pr2_tuck_arms_action
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /opt/ros/hydro/share/pr2_tuck_arms_action/tuck_arms_test.py

I made it executable, but it still didn't work. Both tuck_arms_main.py and tuck_arms_test.py look exactly the same: http://pastebin.com/tUaLFzSB Note that it's just the client, there's no server anywhere.

sonyaa commented 9 years ago

I just removed the pr2_tuck_arms_action package and installed it again (from the repository), and now there's just no tuck_arms_main.py file (probably someone added it manually).

UltronDestroyer commented 9 years ago

Yikes. I'll see what's up.

sonyaa commented 9 years ago

The tuck_arms_main.py does exist, but only in the directory /opt/ros/hydro/lib/python2.7/dist-packages/pr2_tuck_arms_action, but when I try to "rosrun pr2_tuck_arms_action tuck_arms_main.py", it says "[rosrun] Couldn't find executable named tuck_arms_main.py below /opt/ros/hydro/share/pr2_tuck_arms_action".

Sorry, I don't really know how ros manages paths, so maybe I'm doing something wrong here...

UltronDestroyer commented 9 years ago

I've installed tuck_arms_main.py into the Hydro and Indigo builds and re-released them. For the mean time, you can use the script by locating it on your directory and executing it directly with python. When the new debs have been built and released to public, this will be fixed. However, you can still use currently by doing this:

cd /opt/ros/indigo/lib/python2.7/dist-packages/pr2_tuck_arms_action/ python tuck_arms_main.py osrun pr2_tuck_arms_action tuck_arms_test.py -l tuck

Sorry for the confusion.

sonyaa commented 9 years ago

Thank you!!

How long does it usually take for debs to be updated?

UltronDestroyer commented 9 years ago

Quite a while for them to be released into public. You might want to ask on the ros-users-release mailing list. (Est 1-2 wks)