0
$\begingroup$

Rosanswers logo

Hi,

I am trying to use bash to execute a bunch of rosservice calls, one after the other. Some work but the ones that ask for position ones don't:

rosservice call /wam/cart_move "position:

  • 0
  • 0
  • 0.5"

They work if I put them in terminal no problem, but I cannot bash call them.. Any suggestions as to why this my be the case?

Update: 21 Jan - @Wolf saved the day - had to include sleep command to allow the service to run.. Thank you ros answers!


Originally posted by kleinsplash on ROS Answers with karma: 13 on 2014-01-17

Post score: 1


Original comments

Comment by Wolf on 2014-01-17:
How does your script file look like? What is the error messsage? I can call rosservice from a bash shell script without problems. Did you select bash (# !/bin/bash ) at top of your script?

Comment by kleinsplash on 2014-01-17:
It's a typical .sh script:

#! /bin/bash

rosservice call /bhand/open_spread rosservice call /wam/cart_move "position:

  • 0
  • 0
  • 0.5" rosservice call /wam/cart_move "position:
  • 0.87
  • -0.15
  • -0.45"

Comment by dornhege on 2014-01-20:
What type of service is that?

Comment by kleinsplash on 2014-01-20:
wam/cart_move - type wam_srvs/CartPosMove; float32[3] position ---; (http://code.google.com/p/gwam-ros-pkg/wiki/GWAMPackagewam_node); (http://code.google.com/p/gwam-ros-pkg/source/browse/trunk/wam/wam_common/wam_srvs/srv/CartPosMove.srv?spec=svn203&r=86)

Comment by BennyRe on 2014-01-20:
What kind of error do you get?

Comment by kleinsplash on 2014-01-20:
I dont get an error - this runs without a problem - but does not execute all the command (specifically the service call to /wam/cart_move)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Did you try to add a sleep for a short time between your service calls (Or call with --wait ...)? Maybe your node is just busy if you call the services immediately one after another...


Originally posted by Wolf with karma: 7555 on 2014-01-20

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by kleinsplash on 2014-01-20:
Thats it :) thank you.. I tried converting your comment to answer - but wasnt able to.. perhaps admin did the rest..

Comment by dornhege on 2014-01-20:
If this answer solves the problem, please click the checkmark item next to the question to mark it answered.

$\endgroup$

Your Answer

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