JP3D.NET
[ JP3D.NET Menu ]
[ Lego MIndstorms ]

EROVER Building Instructions:
(instructions for making the control system at the bottom of page)




How to set up your robot:

You will need the following:
  • RCXCC to program the rcx in NQC
  • web brick to provide interface between your webpage and the RCX
  • True Tech Webcam software to provide the streaming webcam image.
  • You will also need to edit some HTML for this project.
  • You will need a LEGO RCX. 1.0 is the best because it has a external power adapter, making your webcam run at top speed all the time. So if you do have a 1.0 RCX find a 9-12v AC adapter.
  • You also need the LEGO Vision Command Camera to make it more interesting for the people driving your robot.
    Robot Control Page
    controls example
    click on em
    Ok so now that you have gotten all those programs listed above you need to make them work together to form your webcam robot. First you need to put together a web page interface for your robot. You can use mine as a starter and also the API on the web brick site.

    Basically you just need to copy the javascript program from the API into the top of your page and then use a button to start the function you want from the API. I used tasks for each function i wanted the robot to do. An example of one of my buttons is:
    <button TYPE="button" VALUE="name" onclick="ExecuteNow(1,4)">

    onclick="ExecuteNow(1,4)" tells the API to run program 1, task 4. If you wanted to say run program 5, task 2 you would use onclick="ExecuteNow(5,2)"

    To make your control page just arrange some buttons and assign then each a different task#
    WEBBRICK API CODE - paste in the head section of your control page

    VERY IMPORTANT TIP: use a small javascript program at the top of your control page like this:
    <SCRIPT type="text/javascript">var myip = "put your ip address here";</SCRIPT>

    ...to place your IP address in all the right places through out your page without having to search through it and type it multiple times. Just put " + myip + " wherever your IP is required

    (" + myip + " is already in all of the code samples i have so all you need to do is copy this the little javascript code into the HEAD section of your page and put in your own IP address)


    Robot NQC Program
    Next, write the program in NQC to make the RCX move when you press a button on your control page. I used 10 tasks to make my robot move. Each task does one thing such as rotate right or tilt the camera up. The tasks are numbered according to which one comes first in the program so put them in order so that the first task matches the button you assigned task 1 and so on. See the NQC tutorial that come with RCXCC for more info. Here is my nqc program for an example.

    NQC CODE - erover.nqc


    Web Cam
    After that you will probably want to add a webcam so people can see where they are going. I copied the javascript code from my true tech webcam page and stuck it into the control page.

    WEB CAM CODE - Just paste this where you want your webcam image to appear


    Making it all work
    So now you are probably going to want to get your robot working. First start Web Brick and click on [OPEN SOCKET]. Copy your IP address from Web Brick into the appropriate places in your control page (once at the top of the API script and in two places in the web cam script). save changes to your page. Next start the Web Cam software. Now upload your control page to your website.


    Troubleshooting
    Now your robot should be working. But it probably isn't. Make sure you have your ip address entered correctly in all the appropriate places in your control webpage. Make sure you have webbrick connected also. You should also test your program in RCXCC using the direct control pannel to run your different tasks and see that they are running properly. if you need any more help feel free to contact me.

    For more help see: Web Brick site and NQC tutorial that comes with RCXCC.


                   
    ©2001-2004 Jesse Palmer
    Please Email me before using anything from this site unless otherwise stated. If you find any broken images links or other errors, please email me about it.
    For best browsing experience try mozilla!
    Thank You

    Link to my site!