do () action () times at () speed

Description

The block performs the selected action for the quadruped. The action runs for the specified times and at the specified speed.

Available Actions:

Available Speeds:

If you want to perform the action at a different speed, then you can use a variable to define the speed.

Example

Learn how to program a quadruped robot to perform predefined actions using PictoBlox.

Introduction

In this project, we will explain how to run predefined actions for Quadruped. By the end of the tutorial, learners will have gained knowledge and practical experience in programming a quadruped robot and controlling its movements using PictoBlox.

Quadruped Actions

There are seventeen predefined actions for Quadruped in PictoBlox which can be accessed through do () action () times at () speed block.

Code

Click on the green flag to run the motion sequence.

Controls for Action Block

Using the do () action () times at () speed block, we can control the number of times the action has to be executed.

Code

Logic

  1. To set up the quadruped, you can drag and drop pins for each leg and hip into the initialization block using set pins FR Hip () FL Hip () FR Leg () FL Leg() BR Hip () BL Hip () BR Leg () BL Leg () block.
  2. To make the quadruped perform a pre-defined action, you can use the drag and drop do () action () times at () speed block and specify the number of times to act and at what speed.
  3. You can also use the drag and drop wait()seconds block to make the quadruped wait for a specific number of seconds.
  4. To return the quadruped to its starting position, you can drag and drop the home position block.

Output

Read More
Learn how to create a dance sequence with Quadruped and Music using PictoBlox in this tutorial. With this tutorial.

Introduction

The example demonstrates how to create a dance sequence with Quadruped with Music.

Code for Stage Mode

When Quarky‘s left pushbutton is pressed, it will wait for 1 second and play a sound. After that, Quadruped will wave its right hand and move back to thehome position. Then Quarky will play different tones and Quadruped will do different actions. Finally, Quadruped will move back to thehome position.

Code for Upload Mode

You can also make the Quadruped dance work independent of PictoBlox using the Upload Mode. For that switch to upload mode and replace the when green flag clicked block with when Quarky starts up the block.

We will make the Quadruped start the dance sequence when the Left key is pressed.

Output

Explore: Try to create your dance sequence.
Read More
Incorporate a fun activity into your artificial intelligence learning journey by using Humanoid robots to learn about face detection.

Introduction

As we start learning artificial intelligence, let’s make it more engaging by incorporating a fun activity. One of the most popular topics in AI is face detection, and we can make it even more exciting by learning it with the help of Humanoid robots. Are you interested in learning it together?

Code

Logic

  1. Simply drag and drop the RHip(), LHip(), RFoot(), LFoot(), RHand(), LHand() block from the Humanoid extension.
  2. Start the program by initializing the sprite and face detection library parameters.
  3. Use the forever loop block to create a continuous loop.
  4. If the camera detects more than one face, the Humanoid will move forward with a specific time, speed, and dance move with do() motion() times at () speed() block.
  5. If no face is detected, the Humanoid will move backward at a specific time and speed using do() motion() times at () speed() block.

Output

Read More
All articles loaded
No more articles to load
Table of Contents