ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosservice call syncing service starts

asked 2014-08-26 18:03:21 -0600

DrBot gravatar image

I am trying to get a brushed motor differential drive robot to drive straight without encoders. I am controlling the motors by a RC style ESC (PWM) that takes a servo signal. I can control the motors with 'rosservice call /service 1 2' (1 is the servo ID, 2 is the speed) The problem is when I write a shell script, one motor takes about a full second to start after the other. I am not sure if the service call can support multiple devices from the CLI. I am unclear of the syntax needed if this indeed is possible.

Is there any way to get rosservice call to sync so the motors stop and start at the same time.

(Yes, I know I should be using PID, twist and cmd_vel, but I just need to get the darn thing driving straight first!)

Thank you.

edit retag flag offensive close merge delete

Comments

Focussing on your question, how about creating another service which takes as request fields the speed of both motors (a bit of a hack, I know)? ROS services are intrinsically asynchronous.

Murilo F. M. gravatar image Murilo F. M.  ( 2014-08-26 18:29:50 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-08-27 15:41:50 -0600

tfoote gravatar image

There is a lot of overhead for starting and stopping command line programs. They have to start up, join the communication network do their work and finish. You should probably write a simple rospy script which will call both services, or as @Murilo F. M. suggests consider restructuring your command datatype to allow more atomic operations.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-08-26 18:03:21 -0600

Seen: 327 times

Last updated: Aug 27 '14