add backward move

This commit is contained in:
Zhengyu Peng
2021-12-09 09:40:50 -05:00
parent cf6fc30a19
commit 0a83d5e7fb
2 changed files with 26 additions and 1 deletions

View File

@ -11,7 +11,7 @@ from leg import Leg
import numpy as np
import time
import json
from path_generator import forward_path
from path_generator import forward_path, backward_path
SIN30 = 0.5
@ -93,6 +93,11 @@ class Hexapod:
for mm in range(0, 30):
self.move(full_path, 0.005)
full_path = backward_path()
for mm in range(0, 30):
self.move(full_path, 0.005)
def move(self, path, interval):
for p_idx in range(0, np.shape(path)[0]):
dest = path[p_idx, :, :]+self.standby_coordinate