Shop OBEX P1 Docs P2 Docs Learn Events
JBot Package — Parallax Forums

JBot Package

PeckPeck Posts: 4
edited 2007-04-18 01:23 in General Discussion
Hi,

I am new to programming Javelin stamps so I have been using hte JBOT manual (thanks to who made it!). However, I could not find the JBot package needed for the sample programs. The following website http://www.parallax.com/javelin/javelinbot.asp·no longer works. Could someone direct me to another place where i can buy a jbot package?

thanks!
«1

Comments

  • PeckPeck Posts: 4
    edited 2006-09-13 06:16
    Hi Peter,

    Thank you for helping me! However, what I am looking for is the JBot package that is used throughout the programs in that folder. For example most progarms import "package JBot ;"
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-09-13 13:09
    You must make a JBot folder within the lib folder.
    The default installation of the Javelini ide program is
    c:\program files\Parallax inc\Javelin IDE program
    so install the jbot files in folder
    c:\program files\Parallax inc\Javelin IDE program\lib\JBot

    Then you can use import JBot.* or package JBot

    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-05 09:23
    I`m new to the javelin. Currently I use Jbot files for experimenting. I followed every step of how to use it. Made a jbot map inside my lib but i still get alot of errors :S
    for example this one "stamp/util/os/Event was not found" I dont know how to fix this?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-05 11:05
    The JBot package requires additional os classes.
    Unzip attachement in folder ...\lib\stamp\util\os

    regards peter
    zip
    29K
    os.zip 29.3K
  • MakgiMakgi Posts: 10
    edited 2007-02-05 11:43
    thx peter but I still get error

    error: Type Jbot/Event was not found
    error: Type Jbot/Task was not found
    error: No entity named "state" was found in this evironment

    thats what i get if i want to compile PhotoresistorSensor.java
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-05 12:53
    It compiles fine on my pc.
    Check file PhotoresistorSensor.java.
    Maybe the boolean state is corrupted (for example to stat)
    Check file BaseSensor.java for entity event (which is of type Event)

    Make sure you unzipped the os package
    in folder ....\lib\stamp\util\os
    (folder name is case sensitive)

    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-05 13:14
    Ye I looked at the file but cant find anything wrong
    I give more details

    C:\Program Files\Parallax Inc\Javelin Stamp IDE\lib\JBot ( here I unzipped al the JBot files from youre Yahoo peter )
    C:\Program Files\Parallax Inc\Javelin Stamp IDE\lib\stamp\util\os ( here I unzipped youre OS files )

    that`s all did I do something wrong? sad.gif
    aint there some kind of tutorial? yeah.gif
    890 x 103 - 84K
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-05 14:21
    Check Task.java in folder ...\lib\stamp\util\os
    This Task class should extend Event
    If it extends LinkedListItem then the old Task.java is still there.
    I attached Task.java in case you need it.
    Since the files are default readonly, this file is probably not overwritten.

    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-05 15:01
    thx peter smile.gif

    I know I ask 2 much sad.gif· but I cant help but to ask

    Now compiling PhotoresistorSensor does work ( yeee )
    But RandomWalkTask now does not compile. I get this error ( see image )
    952 x 102 - 90K
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-05 15:47
    That is strange because Task should be ok now.
    Try closing down the IDE and then restart the IDE.
    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-05 16:18
    Nope keep getting error in Jbot/Task
    But that is strange cause I copied youre Task in mine JBot map and also in mine os map
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-05 16:27
    Remove Task.java from the JBot folder.
    This will conflict with the Task.java in folder os.

    regards peter

    Post Edited (Peter Verkaik) : 2/5/2007 5:40:16 PM GMT
  • MakgiMakgi Posts: 10
    edited 2007-02-06 06:06
    Now i can compile almost everything almost there =)
    But when i try to send RandomWalkTask to my javelin stamp it says " No suitable 'main' method found " ?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-06 06:46
    This indicates that the class is a support class and not a program class.
    It is common practice to write a special program class that has the main() method.
    This program class then imports all the classes it needs.
    AvoidObstacleTaskTest1.java is such a program class.
    Note that the program class needs its variables and methods to be declared static.
    Try RandomWalkTest1.java

    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-06 08:00
    aaah in that way

    I can compile all the supprt classes, but when i compile AvoidObstacleTaskTest1.java that has a main method i get errors
    I also tryed to compile RandomWalkTest1.java but it gives me this ( see image )
    761 x 102 - 65K
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-06 08:27
    They compile and link fine at my pc.
    You should have the following at the top of RandomWalkTest1.java·
    package JBot;
    import java.util.* ;
    import stamp.core.*;
    import stamp.util.os.* ;


    You do have the latest IDE v2.03 (see help->about)?
    If not, download it from here:
    http://www.parallax.com/javelin/downloads.asp

    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-06 09:26
    Yes everything works now yeah.gif
    I just uninstalled everything cause it was a mess

    I did the following

    - Install IDE v2.03 ( from http://www.parallax.com/javelin/downloads.asp )
    - Remove everything from the os map then unzip os from peter ( Its in this topic )
    - Make a map in de Lib named JBot then unizp de Rar file JBot ( http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin Stamp IDE/lib/JBot/ )

    Then everything must work rolleyes.gif

    Only 2 bad there is no images in the Jbot manuals

    Makgi
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-06 09:52
    Download the Roboticsv2_2.zip from here:
    http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/JBot/

    That is the same manual but for the Basic Stamp. The figures are the same though.
    Just locate the appropiate text and you have the pictures.

    If anybody has a final version of this manual, please post it.
    I only have the preliminary draft version.

    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-06 11:04
    another question

    I made this ( see image )
    and i used RandomWalkTest1.java
    Which pin numbers I need in order to get this work cause they are in basic mode now but the java is different.

    DAC pin
    PWM pin
    Detector pin
    374 x 509 - 146K
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-06 11:43
    The best way to find out is to start with the program class,
    RandomWalkTest1.java

    It declares a IrRangeSensor

    ········· ( new IrRangeSensor // IrRangeDropOffSensor
    ······················· ( CPU.pin7··· // left DAC pin
    ······················· , CPU.pin1··· // left PWM pin
    ······················· , CPU.pin0··· // left detector pin
    ······················· , CPU.pin8··· // right DAC pin
    ······················· , CPU.pin3··· // right PWM pin
    ······················· , CPU.pin2··· // right detector pin
    ······················· , 3·········· // deadband
    ······················· )) ;

    From the picture (assuming top detector is left)
    left detector pin is 9 -> becomes 0
    right detector pin is 0 -> becomes 2
    left dac pin is 8 -> becomes 7
    right dac pin is 2 -> becomes 8
    left pwm pin is left white wire -> becomes 1
    right pwm pin is right white wire -> becomes 3
    in picture pins 1 and 10 are used for current limiting resitors to LEDS.

    regards peter
  • MakgiMakgi Posts: 10
    edited 2007-02-06 12:06
    left pwm pin is left white wire -> becomes 1
    right pwm pin is right white wire -> becomes 3

    Here I am stuck cause I know they must be in pin 1 and 3 but where go`s the other end?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-02-06 12:43
    From Roboticsv2_2 manual, pages 60-61

    How do I tell which servo is connected to P13 and which servo is connected to P12?
    You just plugged your servos into headers with numbers above them. If the number above
    the header where the servo is plugged in is 13, it means the servo is connected to P13. If
    the number is 12, it means it’s connected to P12.


    It looks you need to change the pwm pins in the javelin program
    to comply with the board of education.

    regards peter
  • White PawnWhite Pawn Posts: 5
    edited 2007-04-16 00:00
    So, my left PWM pin is my left servo pin?
    Sorry for being a noob, but how does it actually work?
    I mean, since it's already being used for the servo.

    I tried Makgi's circuit and this one, but I couldn't make it work:
    ( new IrRangeSensor ( CPU.pin8    // left DAC pin
                        , CPU.pin13    // left PWM pin
                        , CPU.pin9    // left detector pin
                        , CPU.pin2    // right DAC pin
                        , CPU.pin12    // right PWM pin
                        , CPU.pin0    // right detector pin
                        , 1           // deadband
                        )
    



    I'm using AvoidObstacleTaskIrRangeTest1.
    My BOE-Bot moves for a second and then takes a left turn as if it detected an obstacle on the right,
    then moves forward again for another second, then turns left again and so on.

    I tested the sensors using IrRangeSensorTest1 and they worked fine
    (although the lowest distance printed in the debugger window was 7).
    My batteries are fully charged (5xAA, 6V).

    I noticed that the JBot manual mentions adding a couple of 10μF capacitors,
    but I didn't use them, since I'm not that familiar with electronics and there are no pictures in the manual,
    so I had no idea where to install them.

    Once again, I used the same circuit Makgi did.

    Post Edited (White Pawn) : 4/16/2007 12:05:43 AM GMT
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-04-16 12:20
    You said

    So, my left PWM pin is my left servo pin?
    Sorry for being a noob, but how does it actually work?
    I mean, since it's already being used for the servo.

    Yes, according to this schematic (USB BOE rev.C)
    http://www.parallax.com/dl/docs/prod/boards/BOERevC.pdf

    pins 12 to 15 are shared on connectors X2 and X4 and X5.
    If you use pins 12 and 13 for left and right servo (X5)
    then do not connect anything to P12 and P13 of X2.

    Makgi's circuit uses

    ········· ( new IrRangeSensor // IrRangeDropOffSensor
    ······················· ( CPU.pin7··· // left DAC pin
    ······················· , CPU.pin13··· // left PWM pin
    ······················· , CPU.pin0··· // left detector pin
    ······················· , CPU.pin8··· // right DAC pin
    ······················· , CPU.pin12··· // right PWM pin
    ······················· , CPU.pin2··· // right detector pin
    ······················· , 3·········· // deadband
    ······················· )) ;

    See some posts back, the pins specified above should match the picture.

    You can add 10uF capacitors across vdd (+) and gnd (-) or vin (+) and gnd (-).

    regards peter
  • White PawnWhite Pawn Posts: 5
    edited 2007-04-16 21:57
    Sorry for not making it clear enough.
    I know pins 12 and 13 are the servo pins and that I'm not supposed to connect anything to 12 and 13 of X2.
    I got confused because of this:
    J-Bot Manual said...

    To start with, the Javelin has a digital-to-analog (DAC) virtual peripheral. This can generate voltages
    between 0 and 5 volts in a stepped fashion (see Fig. 5.2a). Attach an IR LED to the DAC output and the
    output intensity of the LED will vary depending upon the voltage. Combine the DAC/IR LED combination
    with a 38.4 kHz PWM output (see Fig. 5.2b) and the J-Bot can generate a modulated output of varying
    intensity (see Fig. 5.2c)
    . Add in the IR detector and objects can be detected based on their distance from
    the IR LED/detector.

    So, what I'm still not getting is whether I'm supposed to
    "combine the DAC/IR LED combination with a 38.4kHz PWM output" of my servo pins or use different pins.

    I already noticed you were suggesting to use pins 12 and 13; that's why I asked how it works.

    What I'm not getting now is the piece of code in your previous post:


    ( new IrRangeSensor // IrRangeDropOffSensor
    ( CPU.pin7 // left DAC pin -- I don't see anything connected to pin 7
    , CPU.pin13 // left PWM pin
    , CPU.pin0 // left detector pin -- this one seems connected to the RIGHT IR detector
    , CPU.pin8 // right DAC pin -- this one seems connected to the LEFT IR LED
    , CPU.pin12 // right PWM pin
    , CPU.pin2 // right detector pin
    , 3 // deadband
    )) ;

    Are we looking at the same picture: CIRCUIT?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-04-16 22:08
    This picture, right?
    http://forums.parallax.com/attachment.php?attachmentid=45339

    I suggested that to keep the class mostly intact.

    To use the picture as is,
    use
    ········· ( new IrRangeSensor // IrRangeDropOffSensor
    ······················· ( CPU.pin8··· // left DAC pin
    ······················· , CPU.pin13··· // left PWM pin
    ······················· , CPU.pin9··· // left detector pin
    ······················· , CPU.pin2··· // right DAC pin
    ······················· , CPU.pin12··· // right PWM pin
    ······················· , CPU.pin0··· // right detector pin
    ······················· , 3·········· // deadband
    ······················· )) ;


    regards peter
  • White PawnWhite Pawn Posts: 5
    edited 2007-04-17 00:06
    That's the same piece of code I used. smile.gif
    In that case, back to my first post:

    I'm using AvoidObstacleTaskIrRangeTest1.
    My BOE-Bot moves for a second and then takes a left turn as if it detected an obstacle on the right,
    then moves forward again for another second, then turns left again and so on.


    I tested the sensors using IrRangeSensorTest1 and they worked fine
    (although the lowest distance printed in the debugger window was 7).
    My batteries are fully charged (5xAA, 6V).
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-04-17 12:22
    I have drawn a circuit diagram, based on the text in chapter 7, section "frequency trick".

    So it appears the pwm signals are NOT the servo signals. They are used to modulate the LED.
    I have drawn only one channel.

    regards peter
  • White PawnWhite Pawn Posts: 5
    edited 2007-04-17 18:20
    So, I can use any other pin?
    I tried using pins 1 and 11, but still can't make it work.

    As I already mentioned, I'm a total amateur when it comes to electronics,
    so I have no idea if I got your diagram right.

    It's still acting weird. Now it moves forward and detects obstacles (i.e. my hand; with a delay of a couple of seconds),
    but acts weird afterwards (pivots left, then right, then left again, then continues moving forward).

    Here's what my circuit looks like now:
    503 x 640 - 100K
Sign In or Register to comment.