0
$\begingroup$

Rosanswers logo

Want to start a executable within a launchfile which needs an argument (its note a node), normally i would launch that executable like this from the commandline:

setuart2 on

where "on" is the argument.

I've put the executable into a scriptfolder into the workspace and am starting it like that in the launchfile:

, seems that it is found through the launchfile, but i get the following error (what is clear, because the parameter "on" is missing:

killing on exit remote[robotOS.local-0]: /home/robot/ROS-Groovy-Workspace/src/base_controller/scripts/setuart2: either 'on' or 'off' argument is required

Now i've found no way to pass the parameter, tryed it throug parameters, but no success.

Can somebody help?

Thx a lot Fabian


Originally posted by fabian77 on ROS Answers with karma: 126 on 2015-07-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Try using the args property:

<node name="setuart2" pkg="base_controller" type="setuart2" args="on"/>

But also note that roslaunch assumes that any nodes listed are ROS nodes, and silently passes additional __name and __log parameters to your program (which ROS nodes handle correctly).


Originally posted by ahendrix with karma: 47576 on 2015-07-10

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by fabian77 on 2015-07-10:
Hi, thanks for having a look, allready tried with args, but no success. Still getting error:

/home/robot/ROS-Groovy-Workspace/src/base_controller/scripts/setuart2: either 'on' or 'off' argument is required

Comment by fabian77 on 2015-07-10:
maybe i just try writing a scriptfile which passes the argument correct and trying to execute that script instead...

Comment by ahendrix on 2015-07-10:
Your program is probably confused by the __name and __log options I mentioned. Try writing a ROS node which calls your program.

$\endgroup$

Your Answer

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