Shop OBEX P1 Docs P2 Docs Learn Events
TrackBot — Parallax Forums

TrackBot

HandtoolHandtool Posts: 17
edited 2007-07-30 18:41 in Robotics
Howdy Folks,

Here's a video of a project I did for·an introduction to·programming course.·

http://www.youtube.com/watch?v=CguCTJyuJpo

I originally used the programming on a BoeBot before I switched to the tank platform, hence the TrackBot,·though its probably·better described as·a small unmanned ground vehicle.

As my first attempt at programming, the code is very basic.· I'm looking forward to learning more so I can streamline things as well as add more bells and whistles.

Future "bells and whistles" include using the arrow keys of the laptop for motion control and the mouse for camera control.· 1st Person Shooter style!· Hardware upgrades will be the addition of sensors other than the camera.· Ping)) and maybe a gps.

Comments

  • boeboyboeboy Posts: 301
    edited 2007-05-20 15:45
    WOW!! That is COOL!! could we see the code for the BS2 and your VB program?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lets see what this does... KA BOOM (note to self do not cross red and black)
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-20 17:12
    Nice work. If you could please post some code. I’m sure others would benefit from your example. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • bennettdanbennettdan Posts: 614
    edited 2007-05-20 22:03
    Handtool,
    I what did you use to program the GUI on your PC?
  • DiablodeMorteDiablodeMorte Posts: 238
    edited 2007-05-20 22:57
    The Author said it was Visual Basic. From video I'm gonna say VB 6 or lower. Doesn't have that overly styled yet simple look of .NET
  • HandtoolHandtool Posts: 17
    edited 2007-05-21 00:10
    Thanks for the comments.· The GUI was programmed in VB.net

    This was my first attempt at writing code so my approach was to keep things as simple as I could.

    When the button on the GUI·is pressed down (mousedown event) it sends a number to the com port where the bluetooth dongle lives. The number is received by the stamp via the EB500 and put into·a variable named CmdData.· The stamps looks at CmdData and runs·the subroutine that corresponds with the number.· When you stop pressing the button (mouseup event) it sends a "0" which·runs the·Halt subroutine.·

    For the video feed I'm using whatever software that came with the camera, though I wouldn't mind incorporating it into future versions of my VB program.
  • bennettdanbennettdan Posts: 614
    edited 2007-05-21 18:14
    Handtool,
    I can use a scroll bar to send a sort of analog control to you tank so you could control speed with the scroll bar. You want me help with that?
    I added this Slider Example program I use to control a older robot I had. The Serial code has been took out for the motor on and off buttons and some other things are left out so you can send them to your BS2 in the format you are using.·Let me know if you ike this also you an add a third Scroll bar to control both motors at the same time and·you can use the offset of the other two scroll bars to keep it going straight if·your servos·not a perfect match.

    What type of camera do you have mounted and how fast does it·refresh the image on your screen?

    Post Edited (bennettdan) : 5/21/2007 6:37:15 PM GMT
  • HandtoolHandtool Posts: 17
    edited 2007-05-21 18:56
    Wow, I was just thinking about speed control! I've moved on to version 2.0 using the arrow keys for motion control of the tank. I'd like to incorporate a speed control into this using the page up and page down keys. By hitting the the keys I'd like to be able to "change gears" by a 25% increment. I'd love to have a look at any code you have for your scroll bar speed control. Thanks.
  • bennettdanbennettdan Posts: 614
    edited 2007-05-22 00:17
    I attached a Zip File of the slider to my last post check it out you can use the mouse to control the slider. I think I can help with the arrow keys as well give me a day or so.
  • Rob7Rob7 Posts: 275
    edited 2007-05-22 14:13
    Handtool,

    I like the camera mounted on your robot, where did you purchase it?

    Rob7
  • bennettdanbennettdan Posts: 614
    edited 2007-05-22 14:24
    Handtool,
    · I have a small app to use the arrow keys to update a textbox but just send your data where the textbox1 update is.
  • HandtoolHandtool Posts: 17
    edited 2007-05-22 16:26
    I bought the camera here: http://www.4ucam.com/830G.html

    The quality and range are not quite as good as advertised but it was the only model in the price range that was wireless, built in battery and usb with dvr software.

    Bennettdan,
    Thanks for the code examples.· Are you a programmer by trade?· I'll send you a PM later today to pick your brain if that's ok.
  • bennettdanbennettdan Posts: 614
    edited 2007-05-22 16:37
    Handtool,
    I am a PLC and HMI interface programmer at my present job, but I have to interface with the companys database for box tracking data so I have ssome experience in the programming in .net. My email adress is bennettdan@bellsouth.net and its my windows messenger username.
  • bennettdanbennettdan Posts: 614
    edited 2007-05-22 18:29
    Handtool,

    · Hey I like the cam and might like to have one myself...I see in your video you have to open you VB.net program to control your bot and also you have to open a window to see your cam..

    If the cam interfaces just like a web cam this program might work for you and it will be on ne form the picturbox should show your cam image in it and then you can send out the controls with the buttons.

    Also I modified your BS2 code to hault when the BS2 is not recieveing a Cmd bit so you wont need the mouse button up and button down actions it will move when you press the button nd hen stop when you let off...its a little cleaner.

    Look at the haults in the Main loop on the BS2 code I attached.

    Hope you like it..

    Post Edited (bennettdan) : 5/23/2007 1:27:10 AM GMT
  • DiablodeMorteDiablodeMorte Posts: 238
    edited 2007-05-23 00:20
    For your just posted code shouldn't it read:
    IF CmdData < 1 THEN Halt
    IF CmdData > 9 THEN Halt
    
    



    instead of:
    IF CmdData > 1 THEN Halt
    IF CmdData < 9 THEN Halt
    
    
  • bennettdanbennettdan Posts: 614
    edited 2007-05-23 01:28
    DiadlodeMorte,
    Good catch I had it backwards..I dont know why I did that..OOps
    Well I have corrected it and reposted the code it should work fine now. Thanks
  • blank264blank264 Posts: 3
    edited 2007-07-26 01:03
    Nice project. I recently bought a camera for mine. Not as nice but pretty good for 75 bucks. Where did you find the tank chassis and treads?·It looks like a modified model or something. What scale is it? Thanks.
  • Steve JoblinSteve Joblin Posts: 784
    edited 2007-07-29 13:17
    Noobie question... how do I run the ".vb" programs attached to this thread?
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-07-30 17:30
    You need Visual Basic the .net version.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • HandtoolHandtool Posts: 17
    edited 2007-07-30 18:41
    The·chassis and treads came·from·a 1/16 scale rc tank.· It even had an airsoft cannon that I saved for future use...

    http://www.hobbytron.com/AirsoftRCSnowLeopardBattleTank.html
Sign In or Register to comment.