Ask Your Question
1

rosservice call in bash causing issues

asked 2014-01-17 01:41:28 -0500

kleinsplash gravatar image

updated 2014-01-20 19:36:00 -0500

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!

edit retag flag offensive close merge delete

Comments

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?

Wolf gravatar image Wolf  ( 2014-01-17 03:16:25 -0500 )edit

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"

kleinsplash gravatar image kleinsplash  ( 2014-01-17 03:52:19 -0500 )edit

What type of service is that?

dornhege gravatar image dornhege  ( 2014-01-20 00:19:03 -0500 )edit
1

What kind of error do you get?

BennyRe gravatar image BennyRe  ( 2014-01-20 04:02:10 -0500 )edit

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)

kleinsplash gravatar image kleinsplash  ( 2014-01-20 04:38:21 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-01-20 05:04:36 -0500

Wolf gravatar image

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...

edit flag offensive delete link more

Comments

1

Thats it :) thank you.. I tried converting your comment to answer - but wasnt able to.. perhaps admin did the rest..

kleinsplash gravatar image kleinsplash  ( 2014-01-20 20:50:17 -0500 )edit
1

If this answer solves the problem, please click the checkmark item next to the question to mark it answered.

dornhege gravatar image dornhege  ( 2014-01-20 21:53:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-01-17 01:41:28 -0500

Seen: 676 times

Last updated: Jan 20 '14