Skip to content

Commit feb8359

Browse files
committed
Clean range
1 parent a029a5d commit feb8359

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

biped_walking_controller/plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def plot_feet_and_com(
145145
ax.set_ylabel(coord_labels[coord_idx.index(j)])
146146
ax.grid(True)
147147

148+
axes[1].set_ylim((-0.02, 0.06))
148149
axes[-1].set_xlabel("t [s]")
149150

150151
# One combined legend outside

biped_walking_controller/preview_control.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import abc
21
import typing
3-
from abc import abstractmethod
42
from dataclasses import dataclass
5-
from enum import Enum
63

74
import numpy as np
85
from scipy.linalg import solve_discrete_are
96

7+
from biped_walking_controller.state_machine import WalkingState, Foot
8+
109

1110
def linear_interpolation(t: np.ndarray, pos_begin: np.ndarray, pos_end: np.ndarray) -> np.ndarray:
1211
return (1 - t)[:, None] * pos_begin + t[:, None] * pos_end
@@ -263,6 +262,7 @@ def update_control(ctrl_mat: PreviewControllerMatrices, current_zmp, zmp_ref, x,
263262

264263
return u, x_next, y_next
265264

265+
266266
def build_zmp_horizon(
267267
com_initial_target,
268268
t_horizon: float,

examples/example_5_walking_controller.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ def main():
5555
t_ss = 0.8 # Single support phase time window
5656
t_ds = 0.3 # Double support phase time window
5757
t_init = 2.0 # Initialization phase (transition from still position to first step)
58-
t_end = 0.4
58+
t_end = 2.0
5959
n_steps = 5 # Number of steps executed by the robot
6060
l_stride = 0.1 # Length of the stride
61-
max_height_foot = 0.01 # Maximal height of the swing foot
61+
max_height_foot = 0.03 # Maximal height of the swing foot
6262

6363
# Preview controller parameters
6464
t_preview = 1.6 # Time horizon used for the preview controller
@@ -381,11 +381,11 @@ def main():
381381

382382
lf_ref_pos[k] = lf_pose
383383
lf_pin_pos[k] = talos.data.oMf[talos.left_foot_id].translation
384-
lf_pb_pos[k], _ = simulator.get_robot_frame_pos("leg_left_6_link")
384+
# lf_pb_pos[k], _ = simulator.get_robot_frame_pos("leg_left_6_link")
385385

386386
rf_ref_pos[k] = rf_pose
387387
rf_pin_pos[k] = talos.data.oMf[talos.right_foot_id].translation
388-
rf_pb_pos[k], _ = simulator.get_robot_frame_pos("leg_right_6_link")
388+
# rf_pb_pos[k], _ = simulator.get_robot_frame_pos("leg_right_6_link")
389389

390390
rf_forces[k], lf_forces[k] = simulator.get_contact_forces()
391391

0 commit comments

Comments
 (0)