EasyAsuro Manual V1.0

download EasyAsuro Manual V1.0

of 18

Transcript of EasyAsuro Manual V1.0

  • 7/24/2019 EasyAsuro Manual V1.0

    1/18

    EasyASURO 1.0 tutorial

    What is EasyASURO? ...............................................................................................................2

    RoViPro.................................................................................................................................. 2

    AsuViMa ................................................................................................................................ 2

    Getting started ............................................................................................................................ 3Upload AsuViMa ................................................................................................................... 3

    Starting RoViPro .................................................................................................................... 3

    Programming panel ............................................................................................................3

    Visual instructions.............................................................................................................. 4

    Control buttons and indicator ............................................................................................. 4

    Simple programming example #1 ..........................................................................................5

    Saving program ...................................................................................................................... 7

    Uploading............................................................................................................................... 8

    More programming examples .............................................................................................. 10

    Programming example #2. ............................................................................................... 10

    Programming example #3. ............................................................................................... 11

    Programming example #4. ............................................................................................... 12

    Programming example #5a............................................................................................... 13

    Programming example #5b .............................................................................................. 14

    Programming example #6. ............................................................................................... 15

    Valid programming instructions............................................................................................... 17

    Bug reports ............................................................................................................................... 18

    2007 AREXX Engineering

    Made by : Henk van WinkoopDate : 2007-01-11 (V1b)

  • 7/24/2019 EasyAsuro Manual V1.0

    2/18

    What is EasyASURO?EasyASURO is a package to program the ASURO robot in a visual way without the need of

    knowing any programming language, only using your computer mouse.

    EasyASURO contains:

    - RoViPro, a Windows application to create ASURO programs

    - AsuViMa, a program that must be stored in the ASURO

    Additional equipment needed:

    - a comport with an RS232 cable connected to an infrared transmitter unit

    - or, a USB cable connected to a USB infrared transmitter unit

    The RS-232 IR-transmitter is supplied with the ASURO robot.

    RoViPro

    RoViPro is the abbreviation of Robot Visual Programming. It is an easy way to use a

    Windows application to create and upload user programs into ASURO by using mouse clicks

    only.

    It is designed for persons who are interested in robotics but are not completely familiar with C

    programming. RoViPro makes it possible to program the ASURO in a very easy way with a

    so called tile programming system. To make it even more attractive, RoViPro also has some

    funny sound effects onboard.

    AsuViMa

    AsuViMa stands for ASURO Virtual Machine. This is a kind of programming codeinterpreter and executor which must be uploaded into ASURO only once. This virtual

    machine interprets and executes the programming code that is generated by RoViPro.

  • 7/24/2019 EasyAsuro Manual V1.0

    3/18

    Getting started

    Upload AsuViMa

    First upload the AsuViMa1.0.hex file into the ASURO robot with the Flash tool. After

    uploading, switch ASURO off. This hex file can be found in folder C:\Program

    Files\EasyASURO\AsuViMa.

    Starting RoViProStarting RoViPro will show the one and only window:

    Figure 1

    Programming panel

    The space picture represents the programming panel on which the visual instructions can be

    dropped.

    The sound can be controlled (or switched off) with the sound panel on your computer.

  • 7/24/2019 EasyAsuro Manual V1.0

    4/18

    Visual instructions

    Visual instructions are placed on the drawing panel by mouse clicking on the instruction

    buttons.

    Figure 2 Visual instruction buttons

    - START instruction that marks the start of a program

    - STOP instruction that marks the end of a program

    - IF a test instruction always followed by THEN and ELSE

    - THEN program direction when IF test passes

    - ELSE program direction when IF test fails

    - LABEL a destination instruction used by GOTO

    - GOTO a jump instruction to any LABEL instruction

    - DELAY a program delay instruction- ACTOR instruction to define some ASURO action like driving forward

    - SENSOR instruction to test some ASURO state like a green system LED

    - Eng. Speed instruction to define the engines speed

    - Switch Int instruction to mark the beginning of a subprogram being executed

    when any ASURO front switch is pressed

    - RTI end instruction belonging to the Switch Int instruction

    Control buttons and indicator

    The first three objects are regular buttons, the rightmost object is also an indicator.

    Figure 3

    - Upload Upload the visual program to ASURO (without running it)

    - Run Run the uploaded program

    - Upld Run Upload and immediately run the uploaded program- No Comm When RoViPro receives a communication message from ASURO then

    the indicator will temporarily swap to Comm Okay

    If pressed, RoViPro will send a message to Asuro requesting Asuro to

    send back a message to confirm that Asuro is in reach of the RoViPro

    infrared transmitter.

  • 7/24/2019 EasyAsuro Manual V1.0

    5/18

    Simple programming example #1

    Just lets start with a simple program. Press the instruction buttons Start, Actorand Stop.

    Now three visual instructions will appear on the left hand top position on the programming

    panel.

    Figure 4 Simple program example

    Removing instructions

    If you made any mistake then a visual instruction can be deleted by right clicking on it with

    the mouse.

    Moving instructions

    Instructions can be moved around by holding down the left mouse button on it and dragging it

    around.

    The close up shows:

    Figure 5

  • 7/24/2019 EasyAsuro Manual V1.0

    6/18

    Now you need to leftmouseclick on the upper down-arrow behind the word [Driving] in the

    main item box..

    A pull down menu will appear:

    Figure 6

    Select the word [Driving] (which was already selected).

    Leftmouseclick on the down-arrow behind the word [Forward] in the sub item box.

    A pull down menu will appear:

    Figure 7

    Select any action you want ASURO to execute.

    Depending on the selected main item/sub item combination, some additional value item box

    will appear. Just find out by experimenting with it.

    Figure 8

    When [Driving] + [Forward] or [Reverse] is selected, the value item box appears where the

    driving distance can be filled out.

    Figure 9

  • 7/24/2019 EasyAsuro Manual V1.0

    7/18

    When [BackLEDs] or [System LED] is selected, the time it is supposed to light before the

    next instruction is executed can be filled out in the value item box.

    Figure 10

    This instruction will light the right backLED for 1.2 seconds before executing the next

    instruction.

    Saving program

    Create next program:

    Figure 11

    So now lets save the program.

    To save your first EasyASURO program select the main menu items: File-> Save As..

    Figure 11

    Dont worry if your main menu looks somewhat different from the above picture. New

    EasyASURO program releases may have a slightly different main menu.

    Find a suitable folder to store your program and fill in a program name behind the File name.

    In our case it is called: 01, My first EasyASURO program. Then click on Saveto have the

    program stored on the harddisk with the extension .viointo the folder named EasyASURO

    programs.

  • 7/24/2019 EasyAsuro Manual V1.0

    8/18

    Figure 12

    UploadingNow that your first program is saved, it can be reloaded at any time. But first we want to send

    this program to ASURO.

    If you havent done it yet, switch off your ASURO.

    Also be sure to have your computer speakers on.

    Find the control buttons:

    Figure 13

    Leftmouseclick on the Uploadcommand button.

    You will hear an audio Upload-signal,but nothing else occurs.

    Switch on the ASURO and wait a few seconds.

    The ASURO reports itself with an audible Standby-message.

    This message also does the red No Commindicator flash green for a few moments with the

    text Comm Okay.

    Figure 14

    ASURO is now detected by RoViPro. Leftmouseclick again on the Uploadcommand button.

  • 7/24/2019 EasyAsuro Manual V1.0

    9/18

    Again the Upload-signalwill be heard, followed by a Program-Completemessage and the

    No Commindicator will shortly turn green. The program is now uploaded into the ASURO.

    ASURO has correctly received this program and ASURO sends this Program-Complete

    message back to RoViPro.

    Did you see that the blue Runbutton is now enabled?

    Figure 15

    Because there now is a program in ASURO, it can be started by clicking on the Run button.

    But just wait a moment.

    First switch ASURO off again and press the No Commbutton. You will hear a please

    acknowledge message spoken. Switch ASURO on, wait a few seconds until ASURO has

    reported itself and then press the No Commbutton. ASURO will now respond with a linkestablished message.

    Lets have a short look at your first created program. It has three different items namely

    Driving, Forwardand 20. This means the ASURO will drive forward over a distance of 20

    centimetres and will then stop.

    Are you curious yet? Well hit the Uploadbutton and then hit the Runbutton.

    Did you see?!

    If ASURO does not drive well, be sure your ASURO has full batteries.

    Now several things occure at the same time:

    First an audio Run-Signalwill be heard, generated by RoViPro followed by a Working-

    messagethat is transmitted back by ASURO when ASURO receives a Runcommand. Then

    ASURO will drive forward immediately exactly 20 centimetres with a moderate default speed

    of exactly 10 centimetres per second. So ASURO will drive forward just two seconds. Just

    prior to stopping, ASURO will decrease its speed.

    Keep looking at the Runbutton, switch ASURO off and on again and wait a few seconds. If

    RoViPro receives the Standby-message from ASURO, the Runbutton will switch off because

    now there is no program in the ASURO.

    Instead of clicking the Uploadbutton and the Runbutton separately, you can execute both

    actions automatically by clicking the yellow Upld.Run(Upload and Run) button. This button

    creates its own audio UploadRun-signaland ASURO will answer with a Working-message.

  • 7/24/2019 EasyAsuro Manual V1.0

    10/18

    More programming examples

    All programming example files can be found in folder:

    C:\Program Files\EasyASURO\RoViPro\vio

    Programming example #2.

    Try to create the next program by yourself:

    Figure 16

    If you find it difficult to do, just load the example file: 02, If system LED turn left or

    right.vio

    Have your ASURO switched on and hit the Upld.Runbutton.

    Watch the system LED and ASUROs behaviour.

    Now what does this program do?

    Lets handle the program step by step:

    START Each program always starts with START

    ACTOR Will turn the system LED to green. Forget about this 10 cm, it only applies

    when using driving commands

    DELAY Wait 10 times 0.1 second, so wait totally 1 second

    IF Is the start of a question that is asked by the program to ASURO

    SENSOR The program checks if the system LED is green.THEN If the system LED is green, the program will follow this THEN branch.

    ELSE If the system LED is notgreen, the program will follow this ELSE branch.

    ACTOR This will be executed by ASURO (forget about the 10cm)

    STOP Each program end must be terminated by a STOP

    It sets the system LED to green, waits one second so you will be able to see it light green.

    Then it checks if the system LED is green. Of course it is green, so the THEN branch will be

    executed which turns the ASURO to the left.

    Now change the second instruction which is the ACTOR instruction and have it set to the redsystem LED. Again, press the Upld.Runbutton and see!

  • 7/24/2019 EasyAsuro Manual V1.0

    11/18

    So remember: the system LED can be used both as actor and as sensor.

    Programming example #3.

    Try to create the next program by yourself:

    Figure 17

    Example file: 03, green delay red delay.vio

    The LABEL and GOTO instruction default name is A. You can change/add another name

    by just typing it in the LABEL instruction and press the ENTER key. Then select that name in

    the GOTO instruction by clicking on the down-arrow icon.

    Have your ASURO switched on and hit the Upld.Runbutton.

    Watch the system LED.

    Now what does this program do?

    It starts with turning the system LED to green. Waits one second, turns the system LED to red,

    and again waits one second. Then this whole sequence is repeated endlessly.

    The START instruction is at the bottom right position. This is not a very easy to read program

    but it shows that it does not matter where you put the instructions as long as they are correctly

    chained to each other.

    Lets handle the program step by step:

    START The start of the program

    LABEL A destination for a GOTO instruction

    ACTOR Setting the system LED to green (forget about the 10cm)

    DELAY Wait one second

    ACTOR Setting the system LED to red (forget about the 10cm)

    GOTO The program jumps from the GOTO instruction to the LABEL instruction

    that has the same name as the GOTO instruction.

  • 7/24/2019 EasyAsuro Manual V1.0

    12/18

    Programming example #4.

    Try to create the next program by yourself:

    Figure 18

    Example file: 04, speed driving forward zero label goto.vio

    Set the ACTOR driving distance value to 0 cm. This will drive the ASURO continuouslywithout stopping.

    Have your ASURO switched on and hit the Upld.Runbutton.

    Now what does this program do?

    It starts defining the engine speed for both engines to be 20 centimetres per second. ASURO

    should be driving forward. Then the program keeps repeating the LABEL and GOTO

    instructions.

    If you replace the LABEL/GOTO instruction combination by a STOP instruction, then

    ASURO initially will drive forward endlessly however immediately the STOP instruction is

    executed. The STOP instruction always switches off all ASURO systems including itsengines so ASURO will stop immediately. Probably ASURO will hop forward for a few

    millimetres.

    Lets handle the program step by step:

    START The start of the program

    ENGINE- Preparing the left and right engine speed in centimetres per second,

    -SPEED without starting the engines

    ACTOR Start ASURO driving forward continuously (0 cm) with the predefined speed

    LABEL A destination for a GOTO instruction

    GOTO The program jumps from the GOTO instruction to the LABEL instruction

  • 7/24/2019 EasyAsuro Manual V1.0

    13/18

    Programming example #5a

    Try to create the next program by yourself:

    Figure 19

    Example file: 05a, driving forward, interrupt drive reverse.vio

    Put an object in front of ASURO, for example 5 centimetres away. This distance is not

    important.

    Point your ASURO towards the object, switch ASURO on and hit the Upld.Runbutton.

    Just watch your ASURO.

    What should it do?

    It should drive forward, hitting the object and driving backwards 10 centimetres. Then it

    repeats this forward/reverse sequence until you stop it.

    Now what does this program do?

    First, there are two different programs inside ASURO now. The program between the START

    and GOTO instruction, we will call the main program. The program between the SWITCH

    and RTI/STOP instructions is called the switch program.

    The main program starts with ASURO driving forward continuously.

    As soon as any front switch on ASURO is pressed, the main program will halt and the switch

    program will be executed. If the switch program has finished by its RTI or STOP instruction,

    then the main program resumes from where it was halted.

  • 7/24/2019 EasyAsuro Manual V1.0

    14/18

    Remember, the switch program is executed as soon as any switch is pressed. The switch

    program checks which switch is pressed. The SENSOR instruction is set to ANY. So any

    switch that is pressed will be assumed valid and therefore the program will follow the THEN

    instruction branch. This makes ASURO drive backwards 10 centimetres. The RTI instruction

    stops the switch program and makes the main program resume where the main program was

    halted.

    Lets handle part of the program that contains new instructions:

    SWITCH The start of the switch program

    RTI End of switch program (RTI means: ReTurn from Interrupt)

    For now we will not discuss this RTI instruction name. Just take it for granted.

    Programming example #5b

    Maybe you already noticed that ASURO is not exactly driving straight forward. Especially if

    you place the object further away. Because of the main program, the ACTOR instruction(driving, forward, 0) is executed continuously. This instruction initializes the engines. As it is

    continuously initialized, the engine speed/distance control mechanism receives no change to

    get active. If you want ASURO to drive straight forward, some programming tricks will be

    needed.

    Try to create the next program by yourself:

    Figure 20

    Example file: 05b, driving forward, interrupt drive reverse.vio

    Point your ASURO towards the object, switch ASURO on and hit the Upld.Runbutton.

    Just watch your ASURO.

    You can see that the main program starts ASURO and only once executes the ACTOR

    instruction.The switch program from the previous example will drive ASURO backwards 10 centimetres

    and then stop ASURO.

    The main program will now be resumed, but the main program will not pass the ACTOR

    instruction because the main program will only cycle through the LABEL and GOTO

    instruction repeatedly. ASURO will not restart driving forward.

  • 7/24/2019 EasyAsuro Manual V1.0

    15/18

    To make ASURO do drive forward, put an ACTOR (driving, forward,0) instruction prior to

    the switch program RTI instruction. So before executing the RTI instruction the switch

    program will restart ASURO driving forward.

    Now ASURO will drive straight forward.

    Inside the switch program, the ELSE instruction is never executed. As the instruction syntax

    requires a THEN and an ELSE instruction following an IF (plus SENSOR) instruction, it

    must be there in the program. The STOP instruction is just a valid example here. A RTI

    instruction would be more correct.

    If for instance the RTI instruction in the switch program is replaced by a STOP instruction,

    which is totally valid, then after driving reverse 10 centimetres and after driving forward

    again, the ASURO program will simply stop driving because the STOP instruction is shutting

    down all systems.

    Remember: a switch program must always be accompanied by a main program. So a stand-

    alone switch program only is not allowed.

    Programming example #6.

    Try to create the next program by yourself:

    Figure 21

    Have your ASURO switched on and hit the Upld.Runbutton.

    Now press the ASURO front switches one by one and listen

    This SENSOR instruction (Switches, Test) sends a message with the pressed key to the

    RoViPro application which speaks out the received switch number.

    The remaining switch program THEN/ELSE branches are only needed to not conflict with the

    general instructions syntax.

  • 7/24/2019 EasyAsuro Manual V1.0

    16/18

    Well, you now know enough to make simple (or more complex) ASURO programs. Just

    experiment with all ACTOR/SENSOR items that are in the dropdown lists of these

    instructions.

    Communication remark:

    If one of the Upload, Runor Upld.Runcontrol buttons is pressed and NO acknowledgemessage is received back from ASURO, then its possible that ASURO still received the

    correct control message but the infrared transmitter of ASURO just points away from the

    RoViPro infrared receiver. So RoViPro misses the acknowledge message from ASURO but

    ASURO will execute the received control message from RoViPro.

  • 7/24/2019 EasyAsuro Manual V1.0

    17/18

    Valid programming instructionsBelow is a list of valid instruction sequences.

    IF THN ELS

    IF

    THN

    ELS

    STA

    STA

    GTO LBL

    GTO

    LBL

    STO

    STO

    OK OK

    OK

    OK OK

    OK

    OK OKOKOK

    OK OK OK OK

    OK OK OK OK

    OK OK OK OK

    DLY

    DLY

    OK

    OK

    OK

    OK

    OK

    OKOK OK OK OK OK

    ACT SNS

    OK

    OK

    OK

    OK

    ACT

    SNS

    OK

    OK OK

    OK OK OK OK OK OK OK

    RTI

    RTI

    OK

    OK

    OK

    OK

    OK

    SWI

    SWI

    OK

    SPD

    SPD

    OK

    OK

    OK

    OK

    OK

    OK

    OK

    OKOK OK OK OK OK OK OK

    NEXT

    PREV.

    Figure 22 Valid instruction sequence

    In the Valid instruction sequence picture each instruction is abbreviated to a 3-letter word.

    For example the THEN instruction is abbreviated to THN.

    At the left side of the picture, in the second column, all existing instructions are listed in an

    arbitrary sequence. In the first column is the abbreviation PREV which means: previous

    instruction. The same sequence of instructions is on the second horizontal row. The first

    horizontal row carries the word NEXT which means: next instruction. So lets take an

    example that will make it clear.In the second column find the ACT instruction. At the first horizontal position behind it is a

    blank position representing the vertical STA instruction. This means that an ACT (Actor)

    instruction can never be followed by a STA (Start) instruction. On the second position behind

    ACT there is an OK cell representing the vertical STO instruction. This means that an ACT

    instruction may be followed by a STO (Stop) instruction.

  • 7/24/2019 EasyAsuro Manual V1.0

    18/18

    Bug reports

    As this software is only a beta version, bugs will certainly pop up.

    Bug reports can be sent to [email protected]

    Upgrades and additional information will be offered on our website www.arexx.com

    2007 AREXX Engineering, Zwolle The Netherlands