To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.teleOpen lugnet.robotics.tele in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Telerobotics / 38
37  |  39
Subject: 
Re: Easy Telerobotics, no programming needed!
Newsgroups: 
lugnet.robotics.tele
Date: 
Fri, 15 Sep 2000 17:23:20 GMT
Viewed: 
4005 times
  
That Math.random is a hack to fool JavaScript into sending messages to
WebBrick. Here is how the JavaScript works:
First, I make a fake image variable "dummy." When you push a button,
JavaScript is given the command to load the image with the image file from the
web server at your URL. However, this is not a real web server... it is
WebBrick, and it takes the file name and it uses it as a command instead of
returning an image. It just returns the error for Server Temporarily
Overloaded, so JavaScript stops trying to load the image and the command is
activated. However, the next time you push the button, JavaScript will not try
to load the image again. It gives up after one try. To fix this, I add a
random number to the name. That way, JavaScript thinks it is trying to get
some other image file, so it trys again. WebBrick just strips the random
number off and ignores it, and it uses the first two characters as a command.

I will add that SendMessage functionality.

I have not seen Vision Command yet, but that should work with this. I used a
Logitech QuickCam camera and WebCam32. You can try WebCam32 for free to see if
it will work for you. I have DSL, so the connection is pretty brisk, but
somewhat bursty. The framerate is between .2 and 5 frames per second or so.
When it is humming along it looks really great.

WebBrick is written in multithreaded C++ with MFC.

Thanks for the feedback!
-Amnon

In lugnet.robotics.tele, Ryan J. Schave writes:
That's a pretty slick program.  It has a clean interface.  What did you
write it in?  VB ?

I imagine I can use the camera from Vision Command as a web cam.
Unfortunately I don't know anything about web cam's as far as software goes.
Can you point me in the right direction?

Regarding the java script:

   <INPUT TYPE="button" NAME="button1" VALUE="Program 1" onClick='dummy.src
=
WebBrickURL+"X1"+Math.random()'><br>

What is the Math.random() part for?  how about the dummy.src?  I can barely
spell javascript so I'm curious as to what it is sending to web brick.

I would want to keep a single program running so that I can limit the web
cam (via a rotation sensor) to look at only certain parts of the room
(privacy).  The javascript and web brick could be modified to send messages
using SendMessage().  The program running in the RCX could then respond to
them - up, down, left right, open close, etc.

You could also just send commands to activate the motors (like the remote)
regardless of the program running - ideal for a motorized web cam stand.

Thanks and keep up the good work.

Ryan
--

reply to: rjschave at home dot com
http://members.home.net/rjschave

"Amnon Silverstein" <amnon@best.com> wrote in message
news:G0wy6u.15x@lugnet.com...
WebBrick is a free program that lets you connect your Lego Mindstorm's • robot to
a web-page user interface.
http://www.best.com/~amnon/Homepage/Lego/



Message is in Reply To:
  Re: Easy Telerobotics, no programming needed!
 
That's a pretty slick program. It has a clean interface. What did you write it in? VB ? I imagine I can use the camera from Vision Command as a web cam. Unfortunately I don't know anything about web cam's as far as software goes. Can you point me in (...) (24 years ago, 15-Sep-00, to lugnet.robotics.tele)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR