PDA

View Full Version : Need assistance



CJW
04-17-2010, 09:00 PM
Hi,

I would like to know how to combined gripper and navigating with infrared headlights. can any1 guide me. Thank you

regards,
James

Mike Green
04-17-2010, 09:51 PM
If you look at the sample code for navigating with IR, you'll see that it really consists of some code that needs to be executed periodically, say a couple of times a second. The code generates a series of pulses of IR light at different frequencies and sees which pulse frequencies cause the detector to react. This gives an indication of roughly how far away the IR reflection is. This code can be used as a subroutine. Whenever you need a distance to the nearest object, you call that subroutine and you get a number some short time later.

The gripper is something that has an "open the gripper" and a "close the gripper" action. Each can also be made into a subroutine.

If your question is "Now what?", then you have to spend some time defining what you want your robot (presumably a BoeBot) to do. How do you want your robot to respond to obstacles and under what circumstances (distances detected by IR)? How do you want to use the gripper? What rules do you want to define for its use? Once you figure out some rules, you can reduce them to a program that uses the subroutines I've outlined. You may also have some actions like "turn right 90 degrees", "turn left 90 degrees", "move forward a specified distance (actually some period of time)".

CJW
04-17-2010, 10:40 PM
Hi Mike,

I have do some programming. can u help me check any error. I also figuring how the item to go straight, left, right, backward. Below is my programming:

' BOEGripperIF.bs2 SIMPLE BOE-Bot Gripper Test Using Infra Red Detection

' {$STAMP BS2}
' {$PBASIC 2.5}

DEBUG "Program Running!"



irDetectLeft VAR Bit ' Variable Declarations..
irDetectRight VAR Bit
pulseLeft VAR Word
pulseRight VAR Word
pulseGrip VAR Word

DEBUG "Testing piezospeaker..."
FREQOUT 4, 2000, 3000 ' Signal program start/reset..

DEBUG CLS,
"IR DETECTORS", CR,
"Left Right", CR


DO ' Main Routine..

FREQOUT 8, 1, 38500 ' Check IR Detectors..
irDetectLeft = IN9

FREQOUT 2, 1, 38500
irDetectRight = IN0
' Gripper Action..
IF (irDetectLeft = 1) AND (irDetectRight = 1) THEN 'Gripper IF..
HIGH 10
HIGH 1

pulseGrip = 1000 ' Close Gripper


ELSE
LOW 10
LOW 1
pulseGrip = 500 ' Open Gripper

ENDIF


DEBUG CRSRXY, 2, 3, BIN1 irDetectLeft,
CRSRXY, 9, 3, BIN1 irDetectRight

PAUSE 20 '(we PAUSE otherwise the servo hums,
'gotta give the program time to run.)

PULSOUT 13,pulseLeft ' Apply the pulse..
PULSOUT 12,pulseRight
PULSOUT 14,pulseGrip
LOOP



Yours Sincerely,
James

Franklin
04-17-2010, 10:59 PM
James, Have you loaded the code and tested it yet? That's how you will know if it works or not.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

CJW
04-17-2010, 11:50 PM
Hi Stephen,

I load the thing but i felt is not stable, i can't upload the video inside. I have recorded the video to post here but they wrote this " You cannot upload files that use MIME type : video/x-ms-wmv." So how i load the video to show you.

Yours Sincerely,
James

Mike Green
04-18-2010, 12:03 AM
You cannot post video here. You can use a service like YouTube to host the video, then post a link to that here.

It may be better to describe what you observe. A video by itself is often not very useful. You would need a description anyway.

CJW
04-18-2010, 08:54 PM
Hi,

when it run it able to open and close even the Led. I can't let my robot move straight, right,left and backward.

Yours Sincerely,
James