• 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.


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 “Quad” instance represents the quadruped robot and is initialized with several parameters that specify the location of each of its four legs.
  2. The “moveall” method takes a list of eight angles as its input, with each angle representing the angle of a joint in one of the quadruped’s legs.
  3. The method then uses these angles to calculate the position of each leg and moves them accordingly.
  4. The variable “Speed” is used to specify the speed at which the quadruped should move during each step of the loop.

Output

 

Table of Contents