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 / 33
32  |  34
Subject: 
Re: Tele-Operate Me
Newsgroups: 
lugnet.robotics.tele
Date: 
Mon, 3 Jul 2000 14:30:32 GMT
Viewed: 
3629 times
  
In lugnet.robotics.tele, Dean Husby writes:
I'm working on a web control system too but have the enormous problem of how • to
restrict the control to one person for x time. then switch to the next in the
queue.

This is likely going to require some significant web knowledge on your part.
Off the top of my head, there are two ways you can do it:

Simple way: Create a 'lock' file with the IP of the person visiting and the
time he started visiting.  If someone else stops by, and the time in the
lockfile is still recent, tell them to try back in a few seconds.  If the time
in the lock file is stale, or the user has 'logged out' via an explicit link
(thus wouldn't be present in the lock file), set the new guy up in the lock
file and let him have at it.  No queueing needed.

A more complex way: Set up a time for requests, say $duration = 30 seconds.
When a request comes in, add them (their IP perhaps, or a session ID sent back
to a cookie?) to a queue (say, a file) along with a timestamp.  If they're the
only one in the queue, fine, let them work as long as they want.  When someone
else comes along, repeat the process: Add them to the queue, log the
timestamp, then run through those before them in the queue, drop those that
have gone past the $duration and if there are still some before him, count
them up, multiply by $duration (subtract some of that depending on the
timestamp of the first guy), and then send him to a "wait one moment" page,
set to refresh in $duration * $count seconds.  Maybe let them know how long
they have to wait.  If they refresh by hand, repeat the check to see if
they're any closer to the top of the queue (or maybe auto-refresh at earlier
intervals), in case someone has explicitely logged out, bumping everyone else
up a few seconds.  When it's finally his turn, poof he's refreshed at the
control screen, his IP is at the top of the queue, and he has $duration
seconds to mess with it (assuming someone else is waiting).  When his time is
up, his commands simply don't work anymore.  He's given the option to re-enter
the queue.



Message has 1 Reply:
  Re: Tele-Operate Me
 
You can combine both techniques. Neither is difficult. With some javascript and .asp you can utilize session variables on an IIS server to do this. (24 years ago, 7-Jul-00, to lugnet.robotics.tele)

Message is in Reply To:
  Re: Tele-Operate Me
 
(...) Are you actually controlling your rover in real time. IE is it actually moving around? I'm working on a web control system too but have the enormous problem of how to restrict the control to one person for x time. then switch to the next in (...) (24 years ago, 26-May-00, to lugnet.robotics.tele)

5 Messages in This Thread:

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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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