Skip to content

Commit

Permalink
Updated black version
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Jan 26, 2024
1 parent f85c7b9 commit 860c84f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
20 changes: 11 additions & 9 deletions src/hippopt/turnkey_planners/humanoid_kinodynamic/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,11 @@ def _add_robot_dynamics(self, all_contact_points: list, function_inputs: dict):
)
problem.add_dynamics(
hp.dot(sym.system.centroidal_momentum) == centroidal_dynamics, # noqa
x0=problem.initial(sym.initial_state.centroidal_momentum)
if self.settings.periodicity_expression_type is hp.ExpressionType.skip
else None, # noqa
x0=(
problem.initial(sym.initial_state.centroidal_momentum)
if self.settings.periodicity_expression_type is hp.ExpressionType.skip
else None
), # noqa
dt=sym.dt,
integrator=default_integrator,
name="centroidal_momentum_dynamics",
Expand All @@ -536,12 +538,12 @@ def _add_contact_kinematic_consistency(
# Creation of contact kinematics consistency functions
descriptor = point.descriptor
if descriptor.foot_frame not in point_kinematics_functions:
point_kinematics_functions[
descriptor.foot_frame
] = hp_rp.point_position_from_kinematics(
kindyn_object=self.kin_dyn_object,
frame_name=descriptor.foot_frame,
**function_inputs,
point_kinematics_functions[descriptor.foot_frame] = (
hp_rp.point_position_from_kinematics(
kindyn_object=self.kin_dyn_object,
frame_name=descriptor.foot_frame,
**function_inputs,
)
)

# Consistency between the contact position and the kinematics
Expand Down
12 changes: 6 additions & 6 deletions src/hippopt/turnkey_planners/humanoid_kinodynamic/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ def from_feet_contact_points(self, input_points: hp_rp.FeetContactPoints) -> Non

@dataclasses.dataclass
class ExtendedHumanoid(hp.OptimizationObject):
contact_points: hp.CompositeType[
FeetContactPointsExtended
] = hp.default_composite_field(factory=FeetContactPointsExtended)
contact_points: hp.CompositeType[FeetContactPointsExtended] = (
hp.default_composite_field(factory=FeetContactPointsExtended)
)

kinematics: hp.CompositeType[hp_rp.FloatingBaseSystem] = hp.default_composite_field(
cls=hp.Variable, factory=hp_rp.FloatingBaseSystem
Expand Down Expand Up @@ -295,9 +295,9 @@ class Variables(hp.OptimizationObject):
)

settings: dataclasses.InitVar[Settings] = dataclasses.field(default=None)
kin_dyn_object: dataclasses.InitVar[
adam.casadi.KinDynComputations
] = dataclasses.field(default=None)
kin_dyn_object: dataclasses.InitVar[adam.casadi.KinDynComputations] = (
dataclasses.field(default=None)
)

def __post_init__(
self,
Expand Down
18 changes: 9 additions & 9 deletions src/hippopt/turnkey_planners/humanoid_pose_finder/planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ class Variables(hp.OptimizationObject):
minimum_joint_positions: hp.StorageType = hp.default_storage_field(hp.Parameter)

settings: dataclasses.InitVar[Settings] = dataclasses.field(default=None)
kin_dyn_object: dataclasses.InitVar[
adam.casadi.KinDynComputations
] = dataclasses.field(default=None)
kin_dyn_object: dataclasses.InitVar[adam.casadi.KinDynComputations] = (
dataclasses.field(default=None)
)

def __post_init__(
self,
Expand Down Expand Up @@ -455,12 +455,12 @@ def _add_contact_kinematic_consistency(
# Creation of contact kinematics consistency functions
descriptor = point.descriptor
if descriptor.foot_frame not in point_kinematics_functions:
point_kinematics_functions[
descriptor.foot_frame
] = hp_rp.point_position_from_kinematics(
kindyn_object=self.kin_dyn_object,
frame_name=descriptor.foot_frame,
**function_inputs,
point_kinematics_functions[descriptor.foot_frame] = (
hp_rp.point_position_from_kinematics(
kindyn_object=self.kin_dyn_object,
frame_name=descriptor.foot_frame,
**function_inputs,
)
)

# Consistency between the contact position and the kinematics
Expand Down

0 comments on commit 860c84f

Please sign in to comment.