前幾篇我記錄過我四足機器人的電路連接圖,還有四足機器人零件的清單;
鏈接如下:
然後就是以下就是所有程序我都開源到這裏(適合所有12自由度的機械狗)
//靜態步態規劃
//主要思路就是:控制每條腿的足端的xyz座標
//x:是大狗前進方向
//y:是大狗擡腿方向
//z;是大狗左右方向
#include "Wire.h"
#include <Adafruit_PWMServoDriver.h>
#include "I2Cdev.h"
#include "MPU6050.h"
#include "String.h"
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
#define SERVOMIN 150 // this is the 'minimum' pulse length count (out of 4096)
//這是“最小”脈衝長度計數(在4096)中
#define SERVOMAX 600 // this is the 'maximum' pulse length count (out of 4096)
//這是“最大”脈衝長度計數(在4096中)
#define GES_REACTION_TIME 500 // You can adjust the reaction time according to the actual circumstance.
#define GES_ENTRY_TIME 800 // When you want to recognize the Forward/Backward gestures, you