test
Dependencies: mbed ros_lib_kinetic nhk19mr2_can_info splitData SerialHalfDuplex_HM
Walk/change_walk.cpp@44:4aac39b8670b, 2019-03-07 (annotated)
- Committer:
- shimizuta
- Date:
- Thu Mar 07 06:36:34 2019 +0000
- Revision:
- 44:4aac39b8670b
- Parent:
- 42:982064594ba6
- Child:
- 45:0654364226c9
over come finished
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimizuta | 44:4aac39b8670b | 1 | /*walk設定用関数. |
shimizuta | 44:4aac39b8670b | 2 | param walk:結果を入れる箱 |
shimizuta | 44:4aac39b8670b | 3 | 各パラメータの意味はOrbitクラスの基底クラスまで遡る必要があるので注意。 |
shimizuta | 44:4aac39b8670b | 4 | */ |
shimizuta | 35:b4e1b8f25cd7 | 5 | #include "change_walk.h" |
shimizuta | 35:b4e1b8f25cd7 | 6 | void SetOneLegStandParam(Walk &walk, int legnum, float x_m, float y_m, float time_s) |
shimizuta | 35:b4e1b8f25cd7 | 7 | { |
shimizuta | 39:87dcdff27797 | 8 | Orbit freeline(FREELINES); |
shimizuta | 39:87dcdff27797 | 9 | LineParam line[]{ |
shimizuta | 42:982064594ba6 | 10 | {.time_s = 0, .x_m = x_m, .y_m = y_m, .is_point_to_point = 0}, |
shimizuta | 42:982064594ba6 | 11 | {.time_s = time_s, .x_m = x_m, .y_m = y_m, .is_point_to_point = 0}, |
shimizuta | 39:87dcdff27797 | 12 | }; |
shimizuta | 44:4aac39b8670b | 13 | freeline.SetFreeLinesParam(line, sizeof(line) / sizeof(line[0])); |
shimizuta | 39:87dcdff27797 | 14 | walk.orbit[legnum].Copy(freeline); |
shimizuta | 35:b4e1b8f25cd7 | 15 | } |
shimizuta | 35:b4e1b8f25cd7 | 16 | void SetOneLegTriangleParam(Walk &walk, int legnum, float offset_x_m, float offset_y_m, float stride_m, float height_m, float buffer_height_m, |
shimizuta | 35:b4e1b8f25cd7 | 17 | float stridetime_s, float toptime_s, float buffer_time_s) |
shimizuta | 35:b4e1b8f25cd7 | 18 | { |
shimizuta | 35:b4e1b8f25cd7 | 19 | Orbit triangle(TRIANGLE); |
shimizuta | 35:b4e1b8f25cd7 | 20 | triangle.SetTriangleParam(offset_x_m, offset_y_m, stride_m, height_m, buffer_height_m, |
shimizuta | 35:b4e1b8f25cd7 | 21 | stridetime_s, toptime_s, buffer_time_s); |
shimizuta | 35:b4e1b8f25cd7 | 22 | walk.orbit[legnum].Copy(triangle); |
shimizuta | 35:b4e1b8f25cd7 | 23 | } |
shimizuta | 39:87dcdff27797 | 24 | |
shimizuta | 39:87dcdff27797 | 25 | void SetOneLegFourPointParam(Walk &walk, int legnum, float offset_x_m, float offset_y_m, float stride_m, float height_m, float buffer_height_m, |
shimizuta | 44:4aac39b8670b | 26 | float stridetime_s, float toptime_s, float buffer_time_s) |
shimizuta | 39:87dcdff27797 | 27 | { |
shimizuta | 39:87dcdff27797 | 28 | Orbit four(FOURPOINT); |
shimizuta | 39:87dcdff27797 | 29 | four.SetFourPointParam(offset_x_m, offset_y_m, stride_m, height_m, buffer_height_m, |
shimizuta | 44:4aac39b8670b | 30 | stridetime_s, toptime_s, buffer_time_s); |
shimizuta | 39:87dcdff27797 | 31 | walk.orbit[legnum].Copy(four); |
shimizuta | 39:87dcdff27797 | 32 | } |
shimizuta | 35:b4e1b8f25cd7 | 33 | void SetOneLegFreeLinesParam(Walk &walk, int legnum, LineParam lineparams[], int point_num) |
shimizuta | 35:b4e1b8f25cd7 | 34 | { |
shimizuta | 35:b4e1b8f25cd7 | 35 | Orbit freeline(FREELINES); |
shimizuta | 35:b4e1b8f25cd7 | 36 | freeline.SetFreeLinesParam(lineparams, point_num); |
shimizuta | 35:b4e1b8f25cd7 | 37 | walk.orbit[legnum].Copy(freeline); |
shimizuta | 35:b4e1b8f25cd7 | 38 | } |