Vorpal Robotics Wiki
Log in

Difference between revisions of "Vorpal Hexapod Scratch Block Reference"

From Vorpal Robotics Wiki
Line 114: Line 114:
 
* '''When to use it:'''  
 
* '''When to use it:'''  
 
* '''Options and Menus:'''  
 
* '''Options and Menus:'''  
 +
**''Mode button:'' This is the first pulldown menu on the block.  It selects the mode that your new recorded move will be stored on.  The options are the top twelve mode buttons:
 +
***Walk 1: stores your move on mode W1
 +
***Walk 2: stores your move on mode W2
 +
***Walk 3: stores your move on mode W3
 +
***Walk 4: stores your move on mode W4
 +
***Dance 1: stores your move on mode D1
 +
***Dance 2: stores your move on mode D2
 +
***Dance 3: stores your move on mode D3
 +
***Dance 4: stores your move on mode D4
 +
***Fight 1: stores your move on mode F1
 +
***Fight 2: stores your move on mode F2
 +
***Fight 3: stores your move on mode F3
 +
***Fight 4: stores your move on mode F4
 
* '''Other Notes:'''
 
* '''Other Notes:'''
  

Revision as of 18:46, 4 September 2017

NOTE: THIS PAGE IS UNDER CONSTRUCTION

Introduction

This page gives you a quick explanation of every Scratch block in the Vorpal Scratch Extension. In each section, the images on the right show you how the block looks in Scratch. Note that all the Vorpal Extension blocks will be listed under the "Other Blocks" section of Scratch.


Wait for Connection

Wait for Connection
  • What it does: This block resets the serial port connecting Scratch to the Vorpal Gamepad and waits for a connection to be established. This process typically only takes one or two seconds, so you will see a slight delay when starting your program.
  • When to use it: The Wait for Connection block should be executed exactly one time and it should come before any other Vorpal Scratch Extension blocks in your program. Typically it is placed immediately after whatever action starts your program (such as clicking on the green flag). It is possible to write programs without using this block, but we've found the connection is much more reliable if you do use it, so we recommend placing this block at the beginning of every program.
  • Options and Menus: This block has no options or menus, so it is very easy to use!
  • Other Notes: You should not place this block in a loop or otherwise cause it to be executed more than once in any program, because that would cause undesirable delays and also could flush incoming sensor data that arrives while the connection is being reset.

Walk

Walk
Walk style options
Walk direction options
  • What it does: This block triggers actions that are identical to the Vorpal Gamepad "W" (Walk) line of mode buttons.
  • When to use it: When you wish to move the robot in a way that is identical to the gamepad "W" mode buttons. Note that to create custom variations of walk commands that only differ in the amount of movement of hips and knees or timing factors, use the TRIPOD GAIT block instead.
  • Options and Menus:
    • Walking Style: This is the first (leftmost) pulldown menu on the block. The walking styles correspond to the W1, W2, W3, and W4 gamepad buttons. For example, selecting "scamper" from the walking style menu results in the same walking motion as triggered by the W4 mode button on the gamepad. The styles are:
      • normal: medium speed normal tripod walking gait.
      • high knees: slow because it raises hips as high as possible, good for getting over obstacles.
      • small steps: takes tiny little steps, allowing you to finely adjust Vorpal's position.
      • scamper: moves as quickly as possible by overlapping hip and knee motions and barely raising the knees. This makes it somewhat unstable and it may drift left or right on slippery surfaces, but if you want to get somewhere as quickly as possible this is the mode to use.
    • Walking Direction: This is the second menu on the block. These selections allow you to simulate DPAD button presses to move Vorpal in different directions. Note that the special value "Stop" is equivalent to no DPAD buttons being pressed. This allows you to make the robot stand in the same manner as it does during walk modes where no DPAD button is pressed.
      • forward: walk forward (in the direction of the accessory port)
      • backward: walk backward (in the direction of the dial knob)
      • left: turn in place counter-clockwise (when viewed from above)
      • right: turn in place clockwise (when viewed from above)
      • stomp/honk: stomp the feet without moving anywhere, and beep the horn. Often used to voice displeasure.
      • stop: just stand there with the knees and hips at the neutral position for walking
    • Seconds: This is the number of seconds to execute this block before moving on to the next block. It is recommended that this value be no lower than 0.15 seconds, since the radio protocol only transmits actions once every 0.1 seconds and servo motors cannot respond any faster than that anyway.
  • Other Notes: The walk block will automatically time sequence the legs, so it is a very easy way to make Vorpal walk around if the gamepad styles of walking suit your needs.

Dance

Dance
Dance Styles
  • What it does: This block triggers actions that are identical to the Vorpal Gamepad "D" (Dance) line of mode buttons.
  • When to use it: When you wish to move the robot in a way that is identical to the gamepad "D" mode buttons.
  • Options and Menus:
    • Dancing Style: This is the pulldown menu on the block. The dancing styles correspond to the dance moves that can be executed using gamepad buttons. The styles are:
      • twist: while standing, move hips back and forth
      • twist on floor: while holding all legs up in the air, move hips back and forth
      • twist legs up: while holding three legs (every other leg) up in the air, move hips back and forth
      • twist other legs up: while holding the opposite three legs up in the air, move hips back and forth
      • dab: pick up one leg and twist to the side, as in the popular dance move
      • ballet flutter: go up "en pointe" (on tiptoes) like a ballerina and flutter all legs back and forth while staying in place
      • ballet left: go up "en pointe" (on tiptoes) like a ballerina and flutter all legs back and forth while moving to the left
      • ballet right: go up "en pointe" (on tiptoes) like a ballerina and flutter all legs back and forth while moving to the right
      • ballet forward: go up "en pointe" (on tiptoes) like a ballerina and flutter all legs back and forth while moving forward
      • ballet backward: go up "en pointe" (on tiptoes) like a ballerina and flutter all legs back and forth while moving backward
      • wave teeter:
      • wave totter:
      • wave ripple:
      • wave swirl left:
      • wave swirl right:
    • Seconds: This is the number of seconds to execute this block before moving on to the next block. It is recommended that this value be no lower than 0.15 seconds, since the radio protocol only transmits actions once every 0.1 seconds and servo motors cannot respond any faster than that anyway.
  • Other Notes: This is a very easy way to make a fun and engaging routine for Vorpal without needing to individually program each leg. It can also be used to create a "victory dance" at the end of a program!

Fight With Arms

Fight with Arms
Fight arm style options
Fight with Arms movement options
  • What it does: This block triggers actions that are identical to the first and second mode buttons in the Vorpal Gamepad "F" (Fight) line.
  • When to use it: When you wish to move the robot in a way that is identical to the first and second gamepad "F" mode buttons.
  • Options and Menus:
    • Arm Style: This is the first (leftmost) pulldown menu on the block. The arm styles correspond to the F1 and F2 gamepad buttons. The styles are:
      • single arms: This results in the same fighting motion as triggered by the F1 mode button on the gamepad. Each of the front arms will move individually.
      • unison arms: This results in the same fighting motion as triggered by the F2 mode button on the gamepad. The front arms will move in unison.
    • Movement: This is the second menu on the block. These selections allow you to simulate DPAD button presses to move Vorpal in different directions. The movements will be executed with either one or both front arms, depending on your selection in the previous menu.
      • defend:
      • lefthook: punch to the left
      • righthook: punch to the right
      • uppercut: punch upwards
      • downsweep: sweep arms downwards
      • auto ninja: executes a series of preprogrammed moves designed to dazzle the opponent
    • Seconds: This is the number of seconds to execute this block before moving on to the next block. It is recommended that this value be no lower than 0.15 seconds, since the radio protocol only transmits actions once every 0.1 seconds and servo motors cannot respond any faster than that anyway.

Fight Adjust

Fight Adjust
Fight Styles
  • What it does: This block triggers actions that are identical to the third and fourth mode buttons in the Vorpal Gamepad "F" (Fight) line.
  • When to use it: When you wish to move the robot in a way that is identical to the third and fourth gamepad "F" mode buttons.
  • Options and Menus:
    • Fight Style: This is the pulldown menu on the block. The styles correspond to the movements that can be executed using the F3 and F4 gamepad buttons with DPAD buttons. The styles are:
      • square up:
      • thrust forward: thrusts body forward by moving hips
      • thrust backward: thrusts body backward by moving hips
      • lean left: moves legs to lower left side of the body towards the ground
      • lean right: moves legs to lower right side of the body towards the ground
      • lean forward: moves legs to lower front of the body towards the ground
      • lean back upward: moves legs to lower back of the body towards the ground while raising the front of the body up higher into the air
      • twist hips right: twists hips to the right without changing the position of the knees
      • twist hips left: twists hips to the left without changing the position of the knees
    • Seconds: This is the number of seconds to execute this block before moving on to the next block. It is recommended that this value be no lower than 0.15 seconds, since the radio protocol only transmits actions once every 0.1 seconds and servo motors cannot respond any faster than that anyway.
  • Other Notes: The movements that can be executed using this block are useful for picking up an object, such as in Capture the Flag.

Record and Record End

Record Start
Record Start mode button options
Record Start dpad button options
Record End
  • What it does:
  • When to use it:
  • Options and Menus:
    • Mode button: This is the first pulldown menu on the block. It selects the mode that your new recorded move will be stored on. The options are the top twelve mode buttons:
      • Walk 1: stores your move on mode W1
      • Walk 2: stores your move on mode W2
      • Walk 3: stores your move on mode W3
      • Walk 4: stores your move on mode W4
      • Dance 1: stores your move on mode D1
      • Dance 2: stores your move on mode D2
      • Dance 3: stores your move on mode D3
      • Dance 4: stores your move on mode D4
      • Fight 1: stores your move on mode F1
      • Fight 2: stores your move on mode F2
      • Fight 3: stores your move on mode F3
      • Fight 4: stores your move on mode F4
  • Other Notes:

Sensor

Sensor
Sensor options
  • What it does: This block stores the values of sensors you use on your Vorpal
  • When to use it: When you wish to obtain readings from a sensor and use them in your program
  • Options and Menus:
    • Sensor Options: This is the pulldown menu on the block. You can choose from the following sensors:
      • Ultrasonic distance: stores the values obtained by the ultrasonic distance sensor
      • Analog 3: stores the values of any sensor plugged into analog port 3
      • Analog 6: stores the values of any sensor plugged into analog port 6
      • Analog 8: stores the values of any sensor plugged into analog port 8
  • Other Notes: This block is meant to be used with logic, for example an if statement. It is shaped differently than the other blocks in the Vorpal extension because of this. When you are using Scratch, this block can be inserted anywhere that has the same oval shape. This will always be within a space on another block, not, for example, on its own between a Walk block and a Fight block. The Sensor block does not have the puzzle piece indents in its top and bottom that are found on the other blocks in the Vorpal extension, so are not able to click the Sensor block into place between the Walk block and the Fight block.

Set Legs

Set Legs
Set Legs leg options
Set Legs hip options
  • What it does: This block allows you to arbitrarily choose the positioning of each knee and hip on each leg of your Vorpal.
  • When to use it: When you wish to create a movement that is distinctly different from those that you can trigger using the gamepad
  • Options and Menus:
    • Leg Selection: This is the first pulldown menu on the block. It is used to choose which leg(s) will move in response to the Set Legs block. The options are:
      • all: selects all six legs
      • left: selects the three legs on the left side (legs 3, 4, and 5)
      • right: selects the three legs on the right side (legs 0, 1, and 2)
      • front: selects the two front legs (legs , , and )
      • middle: selects the two middle legs (legs , , and )
      • back: selects the two back legs (legs , , and )
      • tripod1: selects legs , , and
      • tripod2: selects legs , , and
      • 0: selects leg 0
      • 1: selects leg 1
      • 2: selects leg 2
      • 3: selects leg 3
      • 4: selects leg 4
      • 5: selects leg 5
    • Hip Degrees: This is the first number you can enter on the block. It will position the hip servos of the leg(s) you selected. You can enter any number from 0 to 180 degrees. When looking at the robot from above, 0 degrees is all the way clockwise, and 180 degrees is all the way counter-clockwise. Note: this will change if you select the mirror hips option - see Hip Style below.
    • Knee Degrees: This is the second number you can select on the block. It will position the knee servos of the leg(s) you selected. You can enter any number from 0 to 180 degrees. 0 degrees moves the knees all the way down (so Vorpal is standing up on "tippy toes"). 30 degrees is a normal standing stance. 90 degrees makes Vorpal sit on the floor. 180 degrees puts the legs all the way up in the air.
    • Hip Style: This is the second pulldown menu on the block. It alters the way the Hip Degrees entry moves the hips. The options are:
      • mirror hips: makes the left side hips (3, 4, and 5) move in the opposite way as is described in the Hip Degrees section. For legs 0, 1, and 2, when looking at the robot from above, 0 degrees is all the way clockwise, and 180 degrees is all the way counter-clockwise. For legs 3, 4, and 5, when looking at the robot from above, 0 degrees is all the way counter-clockwise, and 180 degrees is all the way clockwise. This is useful for walking type actions, where you want the left and right sides of the robot to move symmetrically.
      • raw hips: makes all the hips be controlled as described in the Hip Degrees section. When looking at the robot from above, 0 degrees is all the way clockwise, and 180 degrees is all the way counter-clockwise.
  • Other Notes: It is possible to burn out servos using this block. If you tell the legs to move in a way that causes them to fight against each other or another part of your Vorpal, the parts may get damaged. Therefore, we suggest that you change the degrees in small increments to be sure that you are doing what you intend to do and don't inadvertently move the legs so that they fight each other.


Vorpal Hexapod Quick Links: