Shop OBEX P1 Docs P2 Docs Learn Events
Distance input to reach the distination with object avoidance + Can I use C lan — Parallax Forums

Distance input to reach the distination with object avoidance + Can I use C lan

Mengz_ZaiMengz_Zai Posts: 7
edited 2009-12-23 07:37 in BASIC Stamp
Hi.... everyone

I am stump by this project.


I would need to do a programming which allows the user to input 2 distances, the length and breadth then boe bot will find the shortest path to the finishing point.

I do not know even how to start on this problem.


Once completed this step, I need to do an object avoidance at a radius of , example, 4 cm and come back to the shortest path line ( if there is no other obstruction).


Please help me in the this and if there is any sample code similar to this for me to view, analyze and understand.

I really pulling my hair out soon...

Attached is are the 2 picture of my requirements.

Thank you!!!!
960 x 720 - 16K
960 x 720 - 17K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-22 21:00
    This is obviously a class project and several others have asked for help on very similar projects. You'll have to do the work. It's cheating otherwise.

    As with any problem, you need to break it into pieces, understand and solve each piece separately, then combine the pieces.

    There are examples and learning exercises for the object avoidance part. You can find them in the tutorial "Robotics with the BoeBot" which you can download from Parallax if you don't have it already. There's also a modification of the program "Roaming with the PING)))" which uses the PING ultrasonic sensor for object avoidance. This is downloadable from the PING))) product page in Parallax's webstore.

    For the "shortest path" part, this is really a geometry problem. The Stamps have sine (SIN), hypotenuse (HYP), and arctangent (ATN) operators which can be used to compute an angle and distance given two sides of a right triangle. There's a detailed explanation of these in "BASIC Stamp Syntax and Reference Manual" and in the Stamp Editor's help files. You'll have to figure out how to turn the BoeBot to an approximate angle and how to get it to travel in a straight line. The "Robotics with the BoeBot" tutorial may give you some ideas.

    If you have specific questions, feel free to ask.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-22 21:05
    You also asked about the use of C with the BoeBot. The only language that you can use to program the Stamp that controls the BoeBot is Parallax Basic. You can't use C.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-12-22 22:03
    You can use the javelin stamp that uses a subset of java.
    This is like C with the addition of classes.
    There is a manual with tutorial examples for the boebot using javelin
    http://forums.parallax.com/showthread.php?p=829542
    This is a reworked version of the Robotics with the Boebot text.

    regards peter
  • Mengz_ZaiMengz_Zai Posts: 7
    edited 2009-12-23 03:53
    Thanks Mike for the reply.

    Yes this is a class project, but I have been searching for similar project for code reference.

    I do understand the geometry formula and also for the avoidance I know I have to check the individual radius base on different rpm on the individual servo motor.

    My problem here is to input the length and breadth. Is it the only way to input the dimension is in the code itself?

    Or is there a way or code when executing the code a screen will pop up (i.e java) asking for the length and breadth, which after it will calculate using the code and execute the movement....
  • FranklinFranklin Posts: 4,747
    edited 2009-12-23 04:02
    If you write the program to do so you can enter data to the stamp while it is running. You can use buttons to increment values and an LCD to show the results.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mengz_ZaiMengz_Zai Posts: 7
    edited 2009-12-23 04:17
    Hi Peter, thanks for the reply

    Can I check If javelin stamp code can be use to create a java like pop up to input the Length and Breadth as stated above?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-23 04:32
    You will need some kind of keyboard / display to be able to enter data. You can use the serial channel used for downloading programs and for debugging or you can connect a keypad and small LCD display. With the Basic Stamps, you'd use the DEBUG and DEBUGIN statements to display messages and accept input values using the PC. You can run any kind of terminal emulator on the PC like Hyperterm or the debug window in the Stamp Editor or the Propeller Terminal program which can be used instead of the debug window even though it was written to be used with the Propeller. There are serial I/O statements for the Javelin Stamp that work similarly. You'll have to consult the documentation for details.
  • Mengz_ZaiMengz_Zai Posts: 7
    edited 2009-12-23 06:01
    Yes I will connect it to a laptop, update the length and breadth before uploading into the Micro controller.

    Will try out the debug program as you have mention and will upload the code when success!!!

    Cheers!!
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-12-23 07:37
    The javelin has its own IDE message window that can be used to display
    messages and input data to the javelin. It uses the programming cable.
    Other option is to use a Uart object to communicate with standard
    terminal programs like hyperterminal. This requires 2 I/O pins and
    a TTL to RS232 converter chip like max232.

    regards peter
Sign In or Register to comment.