Author Topic: Scripting and Server/Client Robotics  (Read 4960 times)

0 Members and 1 Guest are viewing this topic.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
    • DC/MD/VA Robotics and Automation Team
Scripting and Server/Client Robotics
« on: January 03, 2008, 05:55:20 AM »
Scripting languages like Javascript, PHP are always used for web development on a PC. Why couldn't one do the same for a robot microcontroller?
And setup the architecture where the microcontroller is now the client and the server is a wire-less PC serving script as needed to the robot.

 Also what would be the advantage and disadvantages versus using compiled language? I would think the scripting language would be more dynamic.

The reason I ask this question is because I predict that scripting languages are going to become increasingly popular over the next 4 years.

I think a lot more people would be involved with Robotics if you could use scripting languages instead of code like C/C++ and Java.

Thoughts, (except not to banish me from the forum forever)?
« Last Edit: January 03, 2008, 05:56:29 AM by vidam »

Offline Dr_Worm

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Scripting and Server/Client Robotics
« Reply #1 on: January 03, 2008, 06:44:05 AM »
Php is basically just scripting that allows you to organize text/objects and project them the way you want them (databases, scripts that get  info... etc), so I couldn't see it being used for robotics, compiled usually means the script/coding is quicker and uncompiled coding such as python is interpreted and needs certain software to actually use it and normally takes more time performing the tasks laid out by the program thus its slower, and scripting languages do seem to be getting a lot more popular, and it seems there are a lot more blogs, and websites that use them, and I would like robotics a lot more if I could code them in perl, and I don't see server side scripting languages being used for robotics coding anytime soon, since they were mostly developed for web based applications and nothing else.
« Last Edit: January 03, 2008, 06:50:15 AM by Dr_Worm »

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: Scripting and Server/Client Robotics
« Reply #2 on: January 03, 2008, 08:54:33 AM »
so in the past i've controlled bots over the internet by connecting them to a computer running a web server.
the bot was connected to the PC via wireless serial connection.
i wrote a Python script to send control codes over the serial link.
i then wrote my bot's control web page in Python with a lot of JavaScript.
over all it worked very well.

a lot of people use Java to control this sort of application.
i'm not a fan of Java websites as doing the processing at the web browser end is an inefficient waste of bandwidth.
using a server side scripting language all your brouser sees is HTML and JavaScript.

although i used Python, PHP or Perl would work equally well as a server side scripting language for this task.
(i think it's possible to use Java as a server side CGI as well but i'm not 100% sure....)

the bot i am currently working on is similar although i have the web server running on the on board computer.
at the moment i'm writing the control programs in C++ (for the computer vision bits) and Python (for the simple motor control and I/O pin control)  and calling them from the onboard web server as CGIs.
for testing purposes i just have an HTML form which calls a Python script which in turn runs my C++ programs or further Python scripts.

eventually i want the main control program running on the bot to be running constantly rather than just called by the web server when a web page is updated.
the webserver communicate with the main control program to influence the bot's behaviour according to user instructions.
when incoming instructions are not incoming from a web server the main control program will be free to control the bot.
Python would be a good scripting language to write this sort of control program in as it has built in web servers and most of the other tools i will need.
i will need to stick to C or C++ for the machine vision and path planning parts of my control programming though as they will be extremely processor intensive and take far too long on a simple scripting language like Python.

anyway,
in answer to Vidam's question about scripting languages, i think they definitely have a place in bots where the control is performed by a remote computer.
the key advantages are ease of use and speed of development.
the down sides are slower code execution and the need of a remote computer.

dunk.

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
    • Jon's Place
Re: Scripting and Server/Client Robotics
« Reply #3 on: January 03, 2008, 09:29:06 AM »
I run Squeak (a version of Smalltalk) that is fully interpreted, on my robots, typically on a gumstix or (soon) on a Hammer (http://www.tincantools.com)

- Jon

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Scripting and Server/Client Robotics
« Reply #4 on: January 03, 2008, 09:36:27 AM »
Dunk, thats waaaay too many languages for one robot :P


http://www.squeak.org/About/
Quote
Squeak offers a true uniform fully reflective environment - real live objects. In this environment, when a change is made to an object, its behavior changes immediately without having to restart the system. You can even modify or create objects while the application is running.
interesting . . . sounds great for testing robots . . .

Jon, what do you use it for specifically on your robot(s)?

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
    • Jon's Place
Re: Scripting and Server/Client Robotics
« Reply #5 on: January 03, 2008, 10:45:56 AM »
Well, the brain, of course  :)

- Jon

paulstreats

  • Guest
Re: Scripting and Server/Client Robotics
« Reply #6 on: January 03, 2008, 06:40:47 PM »
Dont forget that people actually use their own forms of interpreted language.

Like when I am running tests, I usually connect it up to my pc via serial and then use simple characters such as "f" for move forwards. "r" read range finder etc... These are obviously pre coded by c. The compiled code on the bot just interprets the serial characters.

Maybe somebody could work on a command set, Although it would be difficult since it would need to be configured to your robots hardware. The only trouble is that it quite often takes up a lot of programming space(but so do first versions of anything.Getting it to work is a priority, optimising is a luxury).

There is one thing that always impresses me about interpreted languages is the way that you can make undefined arrays on the fly, and also change array length easily even while it is holding data

Offline Dank55

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: Scripting and Server/Client Robotics
« Reply #7 on: January 13, 2008, 09:45:26 AM »
I'll put this in the "what languages" thread, although it's only relevant to the proposed group project.  My one small area of competence is extracting rangefinding and image information and throwing it into a database, so that you can use it to make decisions about pathfinding and other things.  If we want that part of the project to be a group thing, something that pulls in a lot of participation from wiki people, then I'd recommend that we use the language and concepts of database management (specifically MySQL) as much as possible.  Programming is scary for many people who could and would participate.

Dan
#wikia, #wikia-de, #wikiversity on irc.freenode.net, admin at robots.wikia.com
Dan, dank55 on gmail.com and Wikipedia

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Scripting and Server/Client Robotics
« Reply #8 on: January 26, 2008, 10:21:18 AM »
Quote
Well, the brain, of course
jon, lol, i meant what specific applications :P

 


Get Your Ad Here

data_list