• Home
  • Examples
  • Crawling Motion with Quadruped Using Individual Servo Control

Crawling Motion with Quadruped Using Individual Servo Control

Example Description
Learn how to create a crawling motion with a quadruped robot using individual servo control.

Introduction

The project demonstrates how to make the crawling motion with Quadruped using individual servo control.

Logic

For this project, we are using the moveall(servo angles = [90,90,90,90,90,90,90,90], time = 1000) code that sets the servo motors of the quadruped to the specified angles at the specified speed.

quad.moveall([90,90,90,90,90,90,90,90],Speed)

There are four positions of the robot we are going to make to create the crawling motion:

  1. Position 1

    quad.moveall([60,120,0,180,60,120,180,0],Speed)

  2. Position 2

    quad.moveall([30,150,60,120,60,120,120,60],Speed)

  3. Position 3

    quad.moveall([120,60,60,120,120,60,120,60],Speed)

     

  4. Position 4

    quad.moveall([120,60,0,180,150,30,180,0],Speed)

     

Code

sprite = Sprite('Tobi')
quarky = Quarky()

quad=Quadruped(4,1,8,5,3,2,7,6)

Speed = 250
while True:
	quad.moveall([60,120,0,180,60,120,180,0],Speed)
	quad.moveall([30,150,60,120,60,120,120,60],Speed)
	quad.moveall([120,60,60,120,120,60,120,60],Speed)
	quad.moveall([120,60,0,180,150,30,180,0],Speed)

Logic

  1. The quadruped named quad is given a series of commands to move in different directions and patterns at a certain speed (Speed).
  2. The moveall method is used to move all of the legs of the quadruped in unison, and it takes a list of eight angles as its input argument.
  3. These angles correspond to the joints in the quadruped’s legs and dictate how they should move. The first four angles control the front left, front right, back left, and back right legs, respectively, and the second four angles control the same legs in the opposite order.
  4. First call to moveall moves the quadruped’s legs to make it walk forward, while the second call makes it turn to the left.
  5. The other calls make it perform other movements, such as turning to the right and walking backwards.

Output

Table of Contents