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

how to make a scriptable robot?

asked 2014-05-07 11:59:52 -0600

Edno gravatar image

updated 2014-05-07 12:05:38 -0600

Does anyone have an idea on how i can make a robot scriptable? So that anyone could program the robots to take actions without worrying about the hard stuff.

To be clear, i would like to do something like this: An user, could get my robot with ros running. He would then, in his notebook with ros running too, open a node that provides a window, so that he can script an action to the robot. Something like:

object = detect("cube");

for(int i = 0; i<object.getNumberOfObjects(); ++i){    

the node would process that and send messages to a node controlling the robot. My question really is how to embedd a script language to accomplish this. Could anyone give me some direction? And what language would be the best to do so? i was thinking about lua or python (i don't know neither one). Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2014-05-13 19:23:26 -0600

Mehdi. gravatar image

Since ROS supports Python I think that Python would be the best language to use. Supposing that all complex functions are implemented on the robot already (object detection, object localization, path planning, motion planning,robot localization), I think actionlib is what you need. you basically create an action server which can start each of the actions that you implemented on the robot. Then you create a python client (the one your friends will use) and define your functions (move,grap,release etc.) so that they ask the action server to start some actions. Actionlib will also send you some feedback about the current state of the action.


edit flag offensive delete link more


There is also rosh ( which is a python-based scripting environment for ROS. It simplifies a lot of things in rospy like subscribing/publishing. You could add any of your robot-specific functionality as a rosh plugin.

Dan Lazewatsky gravatar image Dan Lazewatsky  ( 2014-05-29 07:42:51 -0600 )edit

answered 2014-05-29 07:09:01 -0600

fivef gravatar image

I think SMACH is what you need: It is a Python library for creating hierarchical state machines. This video should make it clear: Video

edit flag offensive delete link more

Question Tools


Asked: 2014-05-07 11:59:52 -0600

Seen: 250 times

Last updated: May 29 '14