Calum Johnston / Hexapod_Library

Dependencies:   Gait Hexapod_Leg PCA9685 Tripod

Files at this revision

API Documentation at this revision

Comitter:
el13cj
Date:
Wed May 11 15:47:09 2016 +0000
Parent:
2:e83b4acfcb36
Commit message:
Ready

Changed in this revision

Angles/angles_6.h Show annotated file Show diff for this revision Revisions of this file
Angles/angles_7.h Show annotated file Show diff for this revision Revisions of this file
Angles/angles_8.h Show annotated file Show diff for this revision Revisions of this file
Angles/angles_9.h Show annotated file Show diff for this revision Revisions of this file
Angles/angles_demo.h Show annotated file Show diff for this revision Revisions of this file
Hexapod.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Angles/angles_6.h	Wed May 11 13:31:45 2016 +0000
+++ b/Angles/angles_6.h	Wed May 11 15:47:09 2016 +0000
@@ -2,21 +2,21 @@
 #define HEXAPOD_LEG_ANGLES_6_H
 #include "structs.h"
 
-leg_x_angles all_leg_angles[6][5] = 
+leg_x_angles all_leg_angles[6][6] = 
 {
 
 
-{{-45.05,6.96,-96.50},  {-51.23,3.11,-92.55},   {-51.23,22.00,-109.89}, {-37.17,29.09,-109.89}, {-37.17,9.03,-92.55}},  //3
+{{0, 0, -90},   {-45.05,6.96,-96.50},  {-51.23,3.11,-92.55},   {-51.23,22.00,-109.89}, {-37.17,29.09,-109.89}, {-37.17,9.03,-92.55}},  //3
 
-{{0.00,9.71,-96.50},    {-22.83,9.03,-92.55},   {-22.83,29.09,-109.89}, {22.83,29.09,-109.89},  {22.83,9.03,-92.55}},   //2
+{{0, 0, -90},   {0.00,9.71,-96.50},    {-22.83,9.03,-92.55},   {-22.83,29.09,-109.89}, {22.83,29.09,-109.89},  {22.83,9.03,-92.55}},   //2
 
-{{45.05,6.96,-96.50},   {37.17,9.03,-92.55},    {37.17,29.09,-109.89},  {51.23,22.00,-109.89},  {51.23,3.11,-92.55}},   //1
+{{0, 0, -90},   {45.05,6.96,-96.50},   {37.17,9.03,-92.55},    {37.17,29.09,-109.89},  {51.23,22.00,-109.89},  {51.23,3.11,-92.55}},   //1
 
-{{-44.95,6.96,-96.50},  {-52.83,9.03,-92.55},   {-52.83,29.09,-109.89}, {-38.77,22.00,-109.89}, {-38.77,3.11,-92.55}}, //4
+{{0, 0, -90},   {-44.95,6.96,-96.50},  {-52.83,9.03,-92.55},   {-52.83,29.09,-109.89}, {-38.77,22.00,-109.89}, {-38.77,3.11,-92.55}}, //4
 
-{{0.00,9.71,-96.50},    {22.83,9.03,-92.55},    {22.83,29.09,-109.89},  {-22.83,29.09,-109.89}, {-22.83,9.03,-92.55}},  //5
+{{0, 0, -90},   {0.00,9.71,-96.50},    {22.83,9.03,-92.55},    {22.83,29.09,-109.89},  {-22.83,29.09,-109.89}, {-22.83,9.03,-92.55}},  //5
 
-{{44.95,6.96,-96.50},   {38.77,3.11,-92.55},    {38.77,22.00,-109.89},  {52.83,29.09,-109.89}, {52.83,9.03,-92.55}}  //6
+{{0, 0, -90},   {44.95,6.96,-96.50},   {38.77,3.11,-92.55},    {38.77,22.00,-109.89},  {52.83,29.09,-109.89}, {52.83,9.03,-92.55}}  //6
 
 };
 
--- a/Angles/angles_7.h	Wed May 11 13:31:45 2016 +0000
+++ b/Angles/angles_7.h	Wed May 11 15:47:09 2016 +0000
@@ -1,21 +1,21 @@
-#ifndef HEXAPOD_LEG_ANGLES_6_H
-#define HEXAPOD_LEG_ANGLES_6_H
+#ifndef HEXAPOD_LEG_ANGLES_7_H
+#define HEXAPOD_LEG_ANGLES_7_H
 #include "structs.h"
 
-leg_x_angles all_leg_angles[6][5] = 
+leg_x_angles all_leg_angles[6][6] = 
 {
 
-{{44.95,6.96,-96.50},   {38.77,3.11,-92.55},    {38.77,22.00,-109.89},  {52.83,29.09,-109.89},  {52.83,9.03,-92.55}},  //6
+{{0, 0, -90},   {44.95,6.96,-96.50},   {38.77,3.11,-92.55},    {38.77,22.00,-109.89},  {52.83,29.09,-109.89},  {52.83,9.03,-92.55}},  //6
 
-{{-45.05,6.96,-96.50},  {-51.23,3.11,-92.55},   {-51.23,22.00,-109.89}, {-37.17,29.09,-109.89}, {-37.17,9.03,-92.55}},  //3
-
-{{0.00,9.71,-96.50},    {-22.83,9.03,-92.55},   {-22.83,29.09,-109.89}, {22.83,29.09,-109.89},  {22.83,9.03,-92.55}},   //2
+{{0, 0, -90},   {-45.05,6.96,-96.50},  {-51.23,3.11,-92.55},   {-51.23,22.00,-109.89}, {-37.17,29.09,-109.89}, {-37.17,9.03,-92.55}},  //3
 
-{{45.05,6.96,-96.50},   {37.17,9.03,-92.55},    {37.17,29.09,-109.89},  {51.23,22.00,-109.89},  {51.23,3.11,-92.55}},   //1
+{{0, 0, -90},   {0.00,9.71,-96.50},    {-22.83,9.03,-92.55},   {-22.83,29.09,-109.89}, {22.83,29.09,-109.89},  {22.83,9.03,-92.55}},   //2
+    
+{{0, 0, -90},   {45.05,6.96,-96.50},   {37.17,9.03,-92.55},    {37.17,29.09,-109.89},  {51.23,22.00,-109.89},  {51.23,3.11,-92.55}},   //1
 
-{{-44.95,6.96,-96.50},  {-52.83,9.03,-92.55},   {-52.83,29.09,-109.89}, {-38.77,22.00,-109.89}, {-38.77,3.11,-92.55}},  //4
+{{0, 0, -90},   {-44.95,6.96,-96.50},  {-52.83,9.03,-92.55},   {-52.83,29.09,-109.89}, {-38.77,22.00,-109.89}, {-38.77,3.11,-92.55}},  //4
 
-{{0.00,9.71,-96.50},    {22.83,9.03,-92.55},    {22.83,29.09,-109.89},  {-22.83,29.09,-109.89}, {-22.83,9.03,-92.55}}  //5
+{{0, 0, -90},   {0.00,9.71,-96.50},    {22.83,9.03,-92.55},    {22.83,29.09,-109.89},  {-22.83,29.09,-109.89}, {-22.83,9.03,-92.55}}  //5
 
 
 };
--- a/Angles/angles_8.h	Wed May 11 13:31:45 2016 +0000
+++ b/Angles/angles_8.h	Wed May 11 15:47:09 2016 +0000
@@ -1,25 +1,25 @@
-#ifndef HEXAPOD_LEG_ANGLES_6_H
-#define HEXAPOD_LEG_ANGLES_6_H
+#ifndef HEXAPOD_LEG_ANGLES_8_H
+#define HEXAPOD_LEG_ANGLES_8_H
 #include "structs.h"
 
 ///MOST CURRENT VERSION
 
 
-leg_x_angles all_leg_angles[6][5] = 
+leg_x_angles all_leg_angles[6][6] = 
 {
 
 
-{{-45.05,6.96,-96.50},  {-51.23,3.11,-92.55},   {-51.23,22.00,-109.89}, {-37.17,29.09,-109.89}, {-37.17,9.03,-92.55}},  //3
+{{0, 0, -90},   {-45.05,6.96,-96.50},  {-51.23,3.11,-92.55},   {-51.23,22.00,-109.89}, {-37.17,29.09,-109.89}, {-37.17,9.03,-92.55}},  //3
 
-{{0.00,9.71,-96.50},    {-22.83,9.03,-92.55},   {-22.83,29.09,-109.89}, {22.83,29.09,-109.89},  {22.83,9.03,-92.55}},   //2
+{{0, 0, -90},   {0.00,9.71,-96.50},    {-22.83,9.03,-92.55},   {-22.83,29.09,-109.89}, {22.83,29.09,-109.89},  {22.83,9.03,-92.55}},   //2
 
-{{45.05,6.96,-96.50},   {37.17,9.03,-92.55},    {37.17,29.09,-109.89},  {51.23,22.00,-109.89},  {51.23,3.11,-92.55}},   //1
+{{0, 0, -90},   {45.05,6.96,-96.50},   {37.17,9.03,-92.55},    {37.17,29.09,-109.89},  {51.23,22.00,-109.89},  {51.23,3.11,-92.55}},   //1
 
-{{-44.95,6.96,-96.50},  {-38.77,3.11,-92.55},   {-38.77,22.00,-109.89}, {-52.83,29.09,-109.89}, {-52.83,9.03,-92.55}}, //4
+{{0, 0, -90},   {-44.95,6.96,-96.50},  {-38.77,3.11,-92.55},   {-38.77,22.00,-109.89}, {-52.83,29.09,-109.89}, {-52.83,9.03,-92.55}}, //4
 
-{{0.00,9.71,-96.50},    {22.83,9.03,-92.55},    {22.83,29.09,-109.89},  {-22.83,29.09,-109.89}, {-22.83,9.03,-92.55}},  //5
+{{0, 0, -90},   {0.00,9.71,-96.50},    {22.83,9.03,-92.55},    {22.83,29.09,-109.89},  {-22.83,29.09,-109.89}, {-22.83,9.03,-92.55}},  //5
 
-{{44.95,6.96,-96.50},   {52.83,9.03,-92.55},    {52.83,29.09,-109.89},  {38.77,22.00,-109.89},  {38.77,3.11,-92.55}}  //6
+{{0, 0, -90},   {44.95,6.96,-96.50},   {52.83,9.03,-92.55},    {52.83,29.09,-109.89},  {38.77,22.00,-109.89},  {38.77,3.11,-92.55}}  //6
 
 };
 
--- a/Angles/angles_9.h	Wed May 11 13:31:45 2016 +0000
+++ b/Angles/angles_9.h	Wed May 11 15:47:09 2016 +0000
@@ -1,5 +1,5 @@
-#ifndef HEXAPOD_LEG_ANGLES_6_H
-#define HEXAPOD_LEG_ANGLES_6_H
+#ifndef HEXAPOD_LEG_ANGLES_9_H
+#define HEXAPOD_LEG_ANGLES_9_H
 #include "structs.h"
 
 ///MOST CURRENT VERSION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Angles/angles_demo.h	Wed May 11 15:47:09 2016 +0000
@@ -0,0 +1,28 @@
+#ifndef HEXAPOD_LEG_ANGLES_DEMO_H
+#define HEXAPOD_LEG_ANGLES_DEMO_H
+#include "structs.h"
+
+///MOST CURRENT VERSION
+
+
+leg_x_angles all_leg_angles[6][6] = 
+{
+
+
+{{0, 0, -90},   {-45.05,6.96,-96.50},   {-61.23,3.11,-92.55},   {-61.23,22.00,-109.89}, {-27.17,29.09,-109.89}, {-27.17,9.03,-92.55}}, //3
+
+{{0, 0, -90},   {0.00,9.71,-96.50},     {-22.83,9.03,-92.55},   {-22.83,29.09,-109.89}, {22.83,29.09,-109.89},  {22.83,9.03,-92.55}},  //2
+
+{{0, 0, -90},   {45.05,6.96,-96.50},    {27.17,9.03,-92.55},    {27.17,29.09,-109.89},  {61.23,22.00,-109.89},  {61.23,3.11,-92.55}},  //1
+
+{{0, 0, -90},   {-44.95,6.96,-96.50},   {-28.77,3.11,-92.55},   {-28.77,22.00,-109.89}, {-62.83,29.09,-109.89}, {-62.83,9.03,-92.55}}, //4
+
+{{0, 0, -90},   {0.00,9.71,-96.50},     {22.83,9.03,-92.55},    {22.83,29.09,-109.89},  {-22.83,29.09,-109.89}, {-22.83,9.03,-92.55}}, //5
+
+{{0, 0, -90},   {44.95,6.96,-96.50},    {62.83,9.03,-92.55},    {62.83,29.09,-109.89},  {28.77,22.00,-109.89},  {28.77,3.11,-92.55}}   //6
+
+};
+
+
+#endif
+
--- a/Hexapod.cpp	Wed May 11 13:31:45 2016 +0000
+++ b/Hexapod.cpp	Wed May 11 15:47:09 2016 +0000
@@ -3,12 +3,7 @@
 #define I2C_ADDR_1 0x82
 #define I2C_ADDR_2 0x84
 
-
-
-
-
 Hexapod::Hexapod(I2C i2c) :
-
     
     board_1(I2C_ADDR_1, i2c, 50),
     board_2(I2C_ADDR_2, i2c, 50),    
@@ -35,7 +30,6 @@
     
 }
 
-
 void Hexapod::init(void)
 {
     
@@ -51,8 +45,6 @@
     
 }
 
-
-
 void Hexapod::stand(void)
 {
     leg_1.set_joint_angles(0, 0, -90);