Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions open_duck_reference_motion_generator/placo_walk_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
warnings.filterwarnings("ignore")

DT = 0.01
REPLAN_DT = 0.1
REFINE = 10


Expand Down Expand Up @@ -105,7 +106,7 @@ def __init__(
)

self.supports = placo.FootstepsPlanner.make_supports(
self.footsteps, True, self.parameters.has_double_support(), True
self.footsteps, 0.0, True, self.parameters.has_double_support(), True
)

# Creating the pattern generator and making an initial plan
Expand Down Expand Up @@ -138,7 +139,7 @@ def load_parameters(self, data):
params.double_support_ratio = data.get('double_support_ratio', params.double_support_ratio)
params.startend_double_support_ratio = data.get('startend_double_support_ratio', params.startend_double_support_ratio)
params.planned_timesteps = data.get('planned_timesteps', params.planned_timesteps)
params.replan_timesteps = data.get('replan_timesteps', params.replan_timesteps)
# params.replan_timesteps = data.get('replan_timesteps', params.replan_timesteps)
params.walk_com_height = data.get('walk_com_height', params.walk_com_height)
params.walk_foot_height = data.get('walk_foot_height', params.walk_foot_height)
params.walk_trunk_pitch = np.deg2rad(data.get('walk_trunk_pitch', np.rad2deg(params.walk_trunk_pitch)))
Expand Down Expand Up @@ -185,7 +186,7 @@ def reset(self):
)

self.supports = placo.FootstepsPlanner.make_supports(
self.footsteps, True, self.parameters.has_double_support(), True
self.footsteps, 0.0, True, self.parameters.has_double_support(), True
)
self.trajectory = self.walk.plan(self.supports, self.robot.com_world(), 0.0)

Expand Down Expand Up @@ -266,16 +267,16 @@ def tick(self, dt, left_contact=True, right_contact=True):
# If enough time elapsed and we can replan, do the replanning
if (
self.t - self.last_replan
> self.parameters.replan_timesteps * self.parameters.dt()
> REPLAN_DT
and self.walk.can_replan_supports(self.trajectory, self.t)
):
self.last_replan = self.t

# Replanning footsteps from current trajectory
self.supports = self.walk.replan_supports(
self.repetitive_footsteps_planner, self.trajectory, self.t
self.repetitive_footsteps_planner, self.trajectory, self.t, self.last_replan
)

self.last_replan = self.t

# Replanning CoM trajectory, yielding a new trajectory we can switch to
self.trajectory = self.walk.replan(self.supports, self.trajectory, self.t)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies = [
"flask>=3.1.0",
"framesviewer>=1.0.2",
"matplotlib>=3.10.0",
"placo==0.6.3",
"placo==0.8.10",
"pygame>=2.6.1",
"scikit-learn>=1.6.1",
"scipy>=1.15.2",
Expand Down