Ask Your Question
0

how to make a scriptable robot?

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

Edno gravatar image

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

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:

move("livining_room");    
object = detect("cube");

for(int i = 0; i<object.getNumberOfObjects(); ++i){    
    grap(object[i]);    
    move("room");
    release();
    move("livining_room");
}
shutDown();

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
4

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

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.

Actionlib: http://wiki.ros.org/actionlib

edit flag offensive delete link more

Comments

There is also rosh (http://wiki.ros.org/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 -0500 )edit
0

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

fivef gravatar image

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

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 180 times

Last updated: May 29 '14