View Single Post
  #15   Spotlight this post!  
Unread 23-06-2008, 13:55
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Control a vex with a laptop?

Quote:
Originally Posted by dtengineering View Post
Well, I happen to think you're on to a great idea here... mainly because I've got something pretty similar running on my VEX bot right now. It carries the laptop around, has a webcam mounted to a servo on the arm, and connects over wifi using Skype.

I have lots of fun driving the robot from another room using the live video feed and have been waiting to fix up a few little things before posting the video link here.

Then I was going to ask a question similar to yours, but a bit different... Does anyone have any suggestions on how to interface the laptop on the robot to the rest of the internet, so that I can control the data feed down the serial port TO the robot using any computer on the planet?

Skype will take care of the video feedback for the operator... I just need to get data... preferably from a joystick but I'll settle fo the keyboard or mouse for now... across a few firewalls and down a serial port.

And that is something I could do with a few suggestions on how to implement!

Jason
This is the way I would do it. Maybe it will give you a starting point. I would build it out in three parts. I use .NET, but you can probably do it in any language.

1) A serial IO component to provide an interface between the onboard laptop and the vex controller. The easiest protocol would be a 4-byte packet with the camera PWM, left motor PWM, right motor PWM, and 0xFF delimiter. The PWM values should be in the range 0-254. The Vex controller will need to listen and parse data from the serial port. The Vex controller will also want to stop the motors if no data is coming in, in case the link to the laptop is broken.

2) A Windows service to manage the connection to the Vex controller. The service will keep the current PWM command in memory and resend then on a fixed schedule. The service will expose a method to update the motor values. The service itself would be implemented as a WCF web service.

3) An ASP.NET application running on the laptop to collect inputs and call into the service to update the motor values. You can configure your WAP to route traffic on a non-standard port (ex. 8085) to the laptop. You would access the web application at your router's public IP address and the port you configured in the WAP settings. You can get the public IP by hitting http://ipchicken.com from behind the router, or through the router settings.