0
$\begingroup$

Rosanswers logo

After I run my pr2, I use this command to let his arm close up.

  rosrun pr2_tuckarm tuck_arms.py -r t -l t

But if I make a launch file like this

  <launch>
  <node pkg="pr2_tuck_arms_action" type="tuck_arms.py" name="tuck_arms" output="screen"/>
  </launch>

It couldn't work at all! Why?


Originally posted by Jui Wang on ROS Answers with karma: 15 on 2012-11-07

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

The equivalent launch file for that command would be

<launch>
   <node name="tuck_arms" pkg="pr2_tuckarm" type="tuck_arms.py" args="-r t -l t"/>
</launch> 

Originally posted by David Lu with karma: 10932 on 2012-11-07

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Jui Wang on 2012-11-10:
Since that these two are not the same, what's the function of ""? What should I see if I execute these launch file?

$\endgroup$
0
$\begingroup$

Rosanswers logo

To answer the question in the comment, I need to write an answer.

<launch>
   <node name="tuck_arms" pkg="pr2_tuckarm" type="tuck_arms.py" args="-r t -l t"/>
</launch>

This launch file executed a node instead of a launch file, since the beginning is "node name..."

1.node name = "tuck_arms" means you'll see a node named "tuck_arms" in rxgraph.

2.type="tuck_arms.py" means this launch file will execute this python file.

3.pkg="pr2_tuckarm" means the executable file you are going to execute is in this package.

As for "What should you see if you execute these launch file?", the effect should be same as running

rosrun pr2_tuckarm tuck_arms.py -r t -l t

And for the output message, mine is

rosfuerte@rosfuerte-K53SM:~/project/ros/code_training$ roslaunch ./tuck_arm.launch 
... logging to /home/rosfuerte/.ros/log/5cf83a42-3227-11e2-b51f-c860003a5122/roslaunch-rosfuerte-K53SM-15395.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://rosfuerte-K53SM:47533/

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion

NODES
  /
    tuck_arms (pr2_tuckarm/tuck_arms.py)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[tuck_arms-1]: started with pid [15415]
[WARN] [WallTime: 1353315583.144633] [15.934000] You've passed in true for auto_start to the python action server, you should always pass in false to avoid race conditions.

Originally posted by Po-Jen Lai with karma: 1371 on 2012-11-18

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.