test

Dependencies:   mbed ros_lib_kinetic nhk19mr2_can_info splitData SerialHalfDuplex_HM

Revision:
39:87dcdff27797
Parent:
35:b4e1b8f25cd7
Child:
42:982064594ba6
diff -r e664b1c12da9 -r 87dcdff27797 Walk/change_walk.cpp
--- a/Walk/change_walk.cpp	Mon Mar 04 10:51:46 2019 +0000
+++ b/Walk/change_walk.cpp	Mon Mar 04 23:41:48 2019 +0000
@@ -1,18 +1,14 @@
 #include "change_walk.h"
 void SetOneLegStandParam(Walk &walk, int legnum, float x_m, float y_m, float time_s)
 {
-    Orbit triangle(TRIANGLE);
-    triangle.SetTriangleParam(x_m, y_m, 0, 0, 0, time_s, 0, 0);
-    walk.orbit[legnum].Copy(triangle);
+    Orbit freeline(FREELINES);
+    LineParam line[]{
+        {.time_s = 0, .x_m = x_m, .y_m = y_m},
+        {.time_s = time_s, .x_m = x_m, .y_m = y_m},
+    };
+    freeline.SetFreeLinesParam(line, sizeof(line)/sizeof(line[0]));
+    walk.orbit[legnum].Copy(freeline);
 }
-
-void SetAllLegsTriangleParam(Walk &walk, float offset_x_m[4], float offset_y_m[4],
-                             float stride_m[4], float height_m, float buffer_height_m,
-                             float stridetime_s, float toptime_s, float buffer_time_s)
-{
-
-}
-
 void SetOneLegTriangleParam(Walk &walk, int legnum, float offset_x_m, float offset_y_m, float stride_m, float height_m, float buffer_height_m,
                             float stridetime_s, float toptime_s, float buffer_time_s)
 {
@@ -21,6 +17,15 @@
                               stridetime_s, toptime_s, buffer_time_s);
     walk.orbit[legnum].Copy(triangle);
 }
+
+void SetOneLegFourPointParam(Walk &walk, int legnum, float offset_x_m, float offset_y_m, float stride_m, float height_m, float buffer_height_m,
+                            float stridetime_s, float toptime_s, float buffer_time_s)
+{
+    Orbit four(FOURPOINT);
+    four.SetFourPointParam(offset_x_m, offset_y_m, stride_m, height_m, buffer_height_m,
+                              stridetime_s, toptime_s, buffer_time_s);
+    walk.orbit[legnum].Copy(four);
+}
 void SetOneLegFreeLinesParam(Walk &walk, int legnum, LineParam lineparams[], int point_num)
 {
     Orbit freeline(FREELINES);