Society of Robots - Robot Forum

Software => Software => Topic started by: 12grahamb on October 17, 2009, 08:31:35 PM

Title: Joystick Controlled Robot Help
Post by: 12grahamb on October 17, 2009, 08:31:35 PM
My latest plan for a robot is one controlled by a joystick.  I was thinking of using Bluetooth or Xbee to have my robot communicate with my computer.  I have seen some projects on the internet similar to what I want to do and they said they used Visual Studio.net.  I am not sure how to use this, I tried downloading Visual Basic but I do not know how to work with joysticks in it.  I guess what I am asking is how do I work with joysticks, or serial in data, and then convert that to be sent out over Bluetooth to a robot? Would I want to use Visual Studio? I have looked around and it looks like there are a lot of programming environments; Python, Arduino Sketch, Visual Studio, GlovePie...  The only programming skills I have are from EasyC for VEX, which is pretty much not even programming...


Thanks for any possible help!

-Ben 
Title: Re: Joystick Controlled Robot Help
Post by: waltr on October 18, 2009, 11:10:27 AM
Just a little help.
You need to break your project into sections:
First what is needed on the PC side, hardware used, then second on the Bot side.
Within each you break it into the required tasks at each end.
PC side:
 Acquire the joystick values for whatever PC input you are using (joystick port, serial port, USB?)
 Convert the joystick input to send to the Bot.
 Send this the the RF device, serial stream
Bot side:
 Receive the data from the RF device, serial.
 Decode to the appropriate Bot control function.
 Have the control respond; motor start, stop, change speed, turn right/left, etc.

Visual Studio is a MicroSoft programming environment or IDE. There are several program languages that can be used under Visual Studio, C/C++ or C# being common.

Do you have a basic robot working? If not then do this first, the $50 robot is a great start and can be expanded with a remote joystick if desired.

It does sound as you have a general idea of computers, communication and electronics but lack knowledge of the details. Google and study each area then put them together. Joystick do come in different 'flavors' and are handled differently by the software. Is there a particular joystick you want to use? If so google it to find the technical details.
Title: Re: Joystick Controlled Robot Help
Post by: 12grahamb on October 18, 2009, 02:20:21 PM
Waltr-

I am using this joystick: http://www.amazon.com/gp/product/images/B00009OY9U/ref=dp_image_0?ie=UTF8&n=172282&s=electronics (http://www.amazon.com/gp/product/images/B00009OY9U/ref=dp_image_0?ie=UTF8&n=172282&s=electronics) It is USB.  I am not sure how to read the data input from it.  As for the robot side, I am using a robot I made out of the VEX kit.  It is pretty basic.  If you don't know about the VEX, it has a simple microcontroller, with TX/RX ports. I wanted to hook a Xbee module up to this and my PC.  I am just not sure how to read data from a usb port, in this case a joystick, and then send it out a serial port, a Xbee module.  I could probably mess around with it and figure out how to read the data from the computer on the robot side.

You are defiently right.  I have a decent understanding of all these things, I just don't know the details.  I have been Googling everything for the past couple of days to learn more about it.  There just seems to be so many different programming languages and options it is somewhat overwhelming haha.

Thanks,

-Ben
Title: Re: Joystick Controlled Robot Help
Post by: waltr on October 18, 2009, 05:04:18 PM
Hi Ben,

Here is some info on using a USB joystick under Windows.
http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/45a2f7fe-e6fc-4c3b-8fa4-46cfc0834642 (http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/45a2f7fe-e6fc-4c3b-8fa4-46cfc0834642)
http://social.msdn.microsoft.com/Forums/en-US/roboticscommunity/thread/7ef69a4a-198f-4ce5-a589-75123b151c69 (http://social.msdn.microsoft.com/Forums/en-US/roboticscommunity/thread/7ef69a4a-198f-4ce5-a589-75123b151c69)
http://social.msdn.microsoft.com/Forums/en/gametechnologiesdirectx101/thread/fa6669c6-89c1-4719-ab9a-7e08b630eebb (http://social.msdn.microsoft.com/Forums/en/gametechnologiesdirectx101/thread/fa6669c6-89c1-4719-ab9a-7e08b630eebb)

Windows XP and newer does have built-in USB Joystick drivers. It is supposedly not hard to interface (write code) to this driver.

As to programming languages, I don't think you can go wrong with learning C. It it one of the more popular programming languages so there are many people to help with code. Plus 'C' is used on PC's and many microprocessor platforms.
The XNA Game Studio Express may be a good start and I believe is a free download from Micrsoft. Worth checking out but maybe someone else has a suggestion.

The XBee RF modules are easy to use and do work well but the documentation is a bit daunting as its written for professional embedded designers. But there are many people using them as hobbyist who can help. They should be about to do what you need and then some (they are bi-directional so in the future you could have the robot send info back to the PC). I have never used Bluetooth so can't tell you much there.

Also check into and read the many post on SparkFuns forum at: http://www.sparkfun.com/commerce/categories.php (http://www.sparkfun.com/commerce/categories.php)
Lots of good ideas, info and links.