From 3e70dd0b73a9b9888fc44dc6d1cf1dccf801586f Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 26 Jan 2024 18:53:00 +0100 Subject: [PATCH] Updated black version --- .../humanoid_kinodynamic/planner.py | 20 ++++++++++--------- .../humanoid_kinodynamic/variables.py | 12 +++++------ .../humanoid_pose_finder/planner.py | 18 ++++++++--------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/hippopt/turnkey_planners/humanoid_kinodynamic/planner.py b/src/hippopt/turnkey_planners/humanoid_kinodynamic/planner.py index 43a36ba7..d72db04e 100644 --- a/src/hippopt/turnkey_planners/humanoid_kinodynamic/planner.py +++ b/src/hippopt/turnkey_planners/humanoid_kinodynamic/planner.py @@ -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", @@ -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 diff --git a/src/hippopt/turnkey_planners/humanoid_kinodynamic/variables.py b/src/hippopt/turnkey_planners/humanoid_kinodynamic/variables.py index 54ba3330..a0978f61 100644 --- a/src/hippopt/turnkey_planners/humanoid_kinodynamic/variables.py +++ b/src/hippopt/turnkey_planners/humanoid_kinodynamic/variables.py @@ -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 @@ -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, diff --git a/src/hippopt/turnkey_planners/humanoid_pose_finder/planner.py b/src/hippopt/turnkey_planners/humanoid_pose_finder/planner.py index 3918d273..b6cdd972 100644 --- a/src/hippopt/turnkey_planners/humanoid_pose_finder/planner.py +++ b/src/hippopt/turnkey_planners/humanoid_pose_finder/planner.py @@ -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, @@ -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