Content-type: text/html Set-Cookie: cookiehash=D8TIX1F9GET8DML97LCWDC1UDL31CF7Q; expires=Tue, 21 Jul 2020 00:00:00 GMT; path=/; domain=.drivemeinsane.com
Previous Entry.. Next Entry.. |
January 07, 2003 15:18
The video transmitter has been ordered. I should have it by friday, but assume the worst and predict receival by the middle of next week. This will solve the problem with the RC Car running out of range of the cam, as it won't need to be observed from a static cam any longer. However, there will be a host of new problems. First off, there's that ledge.... I will probably build some steps with a wide cascade. In the meantime, I'll just forbid people from driving over it, and ban anyone who does. End of problem. :)
There's also the problem of the first come, first serve method of command acceptance. Steering commands respond immediately. However, power commands, moving forward and backwards, take time to complete. They operate by giving power to the car for a specified period of time, typically about half a second, then releasing power. There's also a 1-2 second cooldown period after any power command to make sure the car is at a standstill before it receives the next command. Otherwise, it could accumulate velocity over several commands and do some undesireable things, like slamming into a wall full speed, or even flipping over.
The other problem is simply a one of coordination. The server takes the commands from whoever sends them, in whatever order they come in. If three people are trying to drive the car, it will go in all different directions. Don't even try to think about what it will be like with 20 people.
To solve these problems, two separate queues are being implemented. An event queue, and a wait queue. The event queue takes the car's power commands and adds them to a queue, instead of immediately executing the commands. A separate process thread will then take care of each queue command one at a time. Also, any host can only have one event on the queue at a time. Any more commands from that host will be ignored. This prevents people from sending hundreds of commands while waiting for the car to move. This slows down everything else. A similar queue will be implemented for the X10 devices, which have a similar delay problem.