Shop OBEX P1 Docs P2 Docs Learn Events
need help with coding even though i am a pretty good coder — Parallax Forums

need help with coding even though i am a pretty good coder

okonisfreeokonisfree Posts: 38
edited 2006-07-28 03:16 in Robotics
I hope someone can help me with this. My Boe-Bot cannot get out of corners. Right now, I have the IR configuration set up. I tried the code that is meant for the whiskers in the manual, but it doesn't work. BTW, I am doing high performance IR navigation.roll.gifyeah.gif

Comments

  • okonisfreeokonisfree Posts: 38
    edited 2006-07-24 23:46
    plz..
  • dandreaedandreae Posts: 1,375
    edited 2006-07-24 23:57
    Can you show us a picture of how your IR is set up?· Make sure that they are pointed out to a 45 degree angle from the chassis.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-24 23:59
    1sec...
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 00:04
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 00:05
    oo...i meant i tried the code for escaping corners for the whiskers with the code slightly changed...
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 00:06
    sry if u meant like how everything was connected not a literal pic. (btw, i took pic w/ webcam)
  • dandreaedandreae Posts: 1,375
    edited 2006-07-25 00:07
    My first suggestion is to try and straighten up some of the wiring to make sure that it is not interferring with the IR.· Have you ran the IR test to verify that both IR sets are working properly?·

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 00:10
    yes my IR stuff works fin though but sometimes it goes to a corner and the right ir detects first so it turns slightly left, then it turns slightly right becasuse left IR detects and keeps going. I was trying to do the escaping corners code for whiskers frm the manual but for some reason, it failed.
  • scary_botscary_bot Posts: 32
    edited 2006-07-25 05:18
    I havn't looked at the code you have mentioned. But you could try using a trigger to set off a certain action.

    ·ir_det = ir_det + 1
    · if (ir_det >3) then
    ·· gosub u_turn


    ·· Or something like that.... Just my two cents...... [noparse];)[/noparse]



    Post Edited (scary_bot) : 7/25/2006 6:48:20 AM GMT
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 16:17
    hmm..i tried something just like that that was in the manual..but it was for the whiskers instead of IR. I tweaked it a little to go along with my bot but it did not work.
  • dandreaedandreae Posts: 1,375
    edited 2006-07-25 16:33
    Save your code as a .bs2 file and attach it to this forum thread so that we can look at it and test it.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 16:34
    I already did on one of my messages @ top ^^ or do you mean the code for the escaping corners in the manual?
  • dandreaedandreae Posts: 1,375
    edited 2006-07-25 16:57
    Try experimenting with the "pulseCount" by increasing the value.· Example:

    Change pulseCount = 0 TO 20 to pulseCount = 0 TO 35.

    There is also another pulseCount in code you change under "Turn_Left"

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 18:16
    oo...that is for the remote...i am talking about IR roaming
  • dandreaedandreae Posts: 1,375
    edited 2006-07-25 19:01
    After looking at your code more closely I noticed that you mixed a few codes together.· Basically you need to adjust the back up routine of the IR so that it doesn't stay focused on the corner.··Write your code so that when the IR detects the object to back up and turn to a complete·90 degree angle and see if this·solves the problem.· Becareful when you mix different codes together, it usually results in oddd behavior.



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • okonisfreeokonisfree Posts: 38
    edited 2006-07-25 21:02
    but i am using high performance IR navigation

    Post Edited By Moderator (Chris Savage (Parallax)) : 7/28/2006 5:25:53 AM GMT
  • scary_botscary_bot Posts: 32
    edited 2006-07-28 03:16
    You can also try using a do while loop. Like this..

    ····if·(ir_l = 0)AND (ir_r = 1) THEN
    ····· DO WHILE (ir_l = 0)
    ······· GOSUB left_turn
    ·········· LOOP


    ······· This will keep it moving left as long as,(ir_l = 0).
Sign In or Register to comment.