Vorpal Robotics Wiki
Log in

Vorpal Hexapod Scratch Block Reference

From Vorpal Robotics Wiki

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: rock from side to side
      • wave totter: rock from front to back
      • wave ripple: sit on the floor and lift legs one by one in sequence
      • wave swirl left: lean slightly in one direction and then leaning progresses in a counter-clockwise circle
      • wave swirl right: lean slightly in one direction and then leaning progresses in a clockwise circle
    • 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: puts front legs out in front of the robot
      • 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: returns the robot to a normal standing position
      • 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: This block allows you to store a new move onto one of the buttons on the gamepad.
  • When to use it: When you want to be able to use a move you have created in Scratch without being connected to the Internet or having Scratch open
    • First, create a sequence of moves you would like to store.
    • Next, place the Record Start block at the beginning of this sequence. Fill in the options and menus as described below.
    • Place the Record End block at the end of the sequence you would like to store. The Record End block has no options or menus.
    • Run your program (at least) once.
    • That's it! You now have a brand new move stored on the gamepad!
  • 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 in. The options are the top twelve mode buttons:
      • Walk 1: stores your move in mode W1
      • Walk 2: stores your move in mode W2
      • Walk 3: stores your move in mode W3
      • Walk 4: stores your move in mode W4
      • Dance 1: stores your move in mode D1
      • Dance 2: stores your move in mode D2
      • Dance 3: stores your move in mode D3
      • Dance 4: stores your move in mode D4
      • Fight 1: stores your move in mode F1
      • Fight 2: stores your move in mode F2
      • Fight 3: stores your move in mode F3
      • Fight 4: stores your move in mode F4
    • DPAD button: This is the second pulldown menu on the block. It selects the DPAD button that your new recorded move will be stored on. The options are:
      • nothing pressed: Your move will execute when you are in the mode that you selected from the Mode button pulldown menu and you are not pressing any DPAD buttons.
      • forward: Your move will execute when you are in the mode that you selected from the Mode button pulldown menu and you are pressing the forward DPAD button (the one at the top of the diamond that the four centered DPAD buttons make).
      • backward: Your move will execute when you are in the mode that you selected from the Mode button pulldown menu and you are pressing the bottom DPAD button.
      • left: Your move will execute when you are in the mode that you selected from the Mode button pulldown menu and you are pressing the left DPAD button.
      • right: Your move will execute when you are in the mode that you selected from the Mode button pulldown menu and you are pressing the right DPAD button.
      • special: Your move will execute when you are in the mode that you selected from the Mode button pulldown menu and you are pressing the very top DPAD button (the one that is separate and above the diamond of the other 4 DPAD buttons).
  • Other Notes:
    • To access your new move:
      • Click the mode button you stored it in for 0.5 seconds or more.
      • Press the DPAD button you stored it on.
    • To return to the default action performed by the button:
      • Click the mode button for less than 0.5 seconds.

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 called a "reporter," not an "action block." 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 action blocks in the Vorpal extension, so you are not able to click the Sensor block into place between the Walk block and the Fight block.

cmucam5

  • What it does: This block stores the values from a cmucam5
  • When to use it: When you wish to obtain readings from a cmucam5 and use them in your program
  • Options and Menus:
    • Property Options: This is the pulldown menu on the block. You can choose from the following properties of the largest object seen by the cmucam5:
      • x: stores the x coordinate of the largest object identified in the field of view of the camera
      • y: stores the y coordinate of the largest object identified in the field of view of the camera
      • width: stores the width of the largest object identified in the field of view of the camera
      • height: stores the height of the largest object identified in the field of view of the camera
      • object id: stores the object id of the largest object identified in the field of view of the camera
  • Other Notes: This block is meant to be used with logic, for example an if statement. It is called a "reporter," not an "action block." 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 cmucam5 block does not have the puzzle piece indents in its top and bottom that are found on the action blocks in the Vorpal extension, so you 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 0 and 5)
      • middle: selects the two middle legs (legs 1 and 4)
      • back: selects the two back legs (legs 2 and 3)
      • tripod1: selects legs 0, 2, and 4
      • tripod2: selects legs 1, 3, and 5
      • 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 10 to 170 degrees. When looking at the robot from above, 10 degrees is all the way clockwise, and 170 degrees is all the way counter-clockwise. This range is smaller than 0 to 180 degrees because the leg positioning restricts the hips from being able to move in a full semicircle. 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, 10 degrees is all the way clockwise, and 170 degrees is all the way counter-clockwise. For legs 3, 4, and 5, when looking at the robot from above, 10 degrees is all the way counter-clockwise, and 170 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.
    • 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: 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.


Set Hips

  • What it does: This block allows you to arbitrarily choose the positioning of each hip on each leg of your Vorpal.
  • When to use it: When you wish to create a hip movement that is distinctly different from those that you can trigger using the gamepad
  • Options and Menus:
    • Hip Selection: This is the first pulldown menu on the block. It is used to choose which hip(s) will move in response to the Set Hips block. The options are:
      • all: selects all six hips
      • left: selects the three hips on the left side (hips 3, 4, and 5)
      • right: selects the three hips on the right side (hips 0, 1, and 2)
      • front: selects the two front hips (hips 0 and 5)
      • middle: selects the two middle hips (hips 1 and 4)
      • back: selects the two back hips (hips 2 and 3)
      • tripod1: selects hips 0, 2, and 4
      • tripod2: selects hips 1, 3, and 5
      • 0: selects hip 0
      • 1: selects hip 1
      • 2: selects hip 2
      • 3: selects hip 3
      • 4: selects hip 4
      • 5: selects hip 5
    • Position: This is the first number you can enter on the block. It will position the hip servos of the hip(s) you selected. You can enter any number from 10 to 170 degrees. When looking at the robot from above, 10 degrees is all the way clockwise, and 170 degrees is all the way counter-clockwise. This range is smaller than 0 to 180 degrees because the leg positioning restricts the hips from being able to move in a full semicircle. Note: this will change if you select the mirror hips option - see Hip Style below.
    • 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, 10 degrees is all the way clockwise, and 170 degrees is all the way counter-clockwise. For legs 3, 4, and 5, when looking at the robot from above, 10 degrees is all the way counter-clockwise, and 170 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.
    • 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: It is possible to burn out servos using this block. If you tell the hips to move in a way that causes the legs 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.

Set Knees

  • What it does: This block allows you to arbitrarily choose the positioning of each knee on each leg of your Vorpal.
  • When to use it: When you wish to create a knee movement that is distinctly different from those that you can trigger using the gamepad
  • Options and Menus:
    • Hip Selection: This is the first pulldown menu on the block. It is used to choose which knee(s) will move in response to the Set Knees block. The options are:
      • all: selects all six knees
      • left: selects the three knees on the left side (knees 3, 4, and 5)
      • right: selects the three knees on the right side (knees 0, 1, and 2)
      • front: selects the two front knees (knees 0 and 5)
      • middle: selects the two middle knees (knees 1 and 4)
      • back: selects the two back knees (knees 2 and 3)
      • tripod1: selects knees 0, 2, and 4
      • tripod2: selects knees 1, 3, and 5
      • 0: selects knee 0
      • 1: selects knee 1
      • 2: selects knee 2
      • 3: selects knee 3
      • 4: selects knee 4
      • 5: selects knee 5
    • Position: This is the second number you can select on the block. It will position the knee servos of the knee(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.
    • 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: It is possible to burn out servos using this block. If you tell the knees to move in a way that causes the legs 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.

Stand

  • What it does: This block returns Vorpal to one of four standing positions.
  • When to use it: When you wish to stop the robot's motion and have it stand or sit down; when you want to fold up the robot to store it.
  • Options and Menus:
    • Standing Style: This is the pulldown menu on the block. It allows you to select which standing style you want Vorpal to do. The styles are:
      • normal: stands Vorpal up
      • tiptoes: stands Vorpal up on tiptoes (like in Dance ballet mode)
      • sit down: sits Vorpal on the floor with legs up in the air
      • fold: sits Vorpal on the floor with legs folded in
    • 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 fold option is useful for when you want to store Vorpal.


Vorpal Hexapod Quick Links: