do () motion () times at () speed

Description

The block performs the selected motion for the humanoid. The motion runs for the specified times and at the specified speed.

Available Motions:

Available Speeds:

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

Example

Learn about humanoid robots, their form and functionality, and how the program uses arrow keys to control humanoid movement in different directions and speed.

Introduction

A humanoid is a type of robot or artificial system that is designed to resemble a human being in its form and functionality. Humanoid robots are typically equipped with sensors, actuators, and artificial intelligence capabilities that enable them to interact with their environment and perform tasks that are similar to those of a human being. Humanoid robots are used in various fields, including robotics research, entertainment, healthcare, education, and customer service.

Logic

The Humanoid will move according to the following logic:

  1. When the “UP” key is pressed – Humanoid will move forward.
  2. When the “Down” key is pressed – Humanoid will move Backward.
  3. When the “Left” key is pressed – Humanoid will turn left.
  4. When the “Right” key is pressed – Humanoid will turn Right.

Code

The program uses the up, down, left, and right arrows to control the robot and make it move forward, backward, left, and right. Every time you press one of the arrows, Humanoid will move in the direction you choose.

  1. First, we initialize the humanoid extension by dragging and dropping it onto the block we want to use for the humanoid.
  2. Then, we initialize the IF-ELSE block from the control palette.
  3. Here, we use the logic that if the up arrow key is pressed, the humanoid will move forward one step at a specific speed.
  4. If the down arrow key is pressed, the humanoid will move backward one step at a specific speed.
  5. When the right arrow key is pressed, the humanoid will move in the right direction one step at a specific speed using do() motion () times at () speed.
  6. If no key is pressed, the humanoid will return to its home position.

Output

Read More
Learn how to use PictoBlox to control the predefined motions of the Quadruped robot.

Introduction

In this project, we will explain how to run predefined motions in PictoBlox for the Quadruped. The predefined motions allow users to make the robot move forward, backward, left, right, and much more.

Quadruped Motions

The are eight predefined motions for Quarky in PictoBlox which can be accessed through do () motion () times at () speed block. Using the do () motion () times at () speed block, we can control the number of times the motion has to be executed.

Testing Code


Click on the green flag to run the motion sequence.

Custome Speed Controls

We can also control the speed of the motion.

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

Output


We can program a quadruped robot to move in predefined motions, such as forward, backward, left, and right

Code

Logic

  1. To initialize the quadruped extension, we need to set the pins for the FR Hip, FL Hip, FR Leg, FL Leg, BR Hip, BL Hip, BR Leg, and BL Leg blocks.
  2. To keep the program running infinitely, we can use the forever block.
  3. To execute predefined motions with specific speeds, we can use the do () motion () times at () speed block.
  4. To wait for a specific amount of time, we can use the wait () seconds block.

Output

Read More
Learn how to code logic for video input detection .set the bounding box threshold, and detect signals to control Humanoid movements.

Introduction

A sign detector Humanoid robot is a robot that can recognize and interpret certain signs or signals, such as hand gestures or verbal commands, given by a human. The robot uses sensors, cameras, and machine learning algorithms to detect and understand the sign, and then performs a corresponding action based on the signal detected.

These robots are often used in manufacturing, healthcare, and customer service industries to assist with tasks that require human-like interaction and decision-making.

Code

Logic

  1. Initialise the video on stage and set the transparency as 0%
  2. Show the bounding box and set its threshold to 0.8.
  3. Get the input from the camera forever.
  4. If the signal is detected as ‘Go’ then it displays an ‘up arrow’, sounds go straight and the Humanoid will move 2 steps forward at high speed using do () motion () times at () speed block.
  5. If the signal is detected as ‘TurnRight’ then it displays a ‘right arrow’, sounds Turn right and Humanoid will take a right turn at high speed using do () motion () times at () speed block.
  6. If the signal is detected as ‘TurnLeft’ then it displays a ‘Left arrow’, sounds Turn Left and Humanoid will take a left turn at high speed using do () motion () times at () speed block.
  7. If it detects as stop the display will be cleared in the quirky and the humanoid will be at a home() posture.

Output

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