placo::dynamics#
- class placo.AvoidSelfCollisionsDynamicsConstraint#
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- name: str#
Object name.
- priority: any#
Object priority.
- self_collisions_margin: float#
Margin for self collisions [m].
- self_collisions_trigger: float#
Distance that triggers the constraint [m].
- class placo.Contact#
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- mu: float#
Coefficient of friction (if relevant)
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.
- class placo.Contact6D(frame_task: DynamicsFrameTask, unilateral: bool)#
see DynamicsSolver::add_fixed_planar_contact and DynamicsSolver::add_unilateral_planar_contact
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- length: float#
Rectangular contact length along local x-axis.
- mu: float#
Coefficient of friction (if relevant)
- orientation_task() DynamicsOrientationTask #
Associated orientation task.
- position_task() DynamicsPositionTask #
Associated position task.
- unilateral: bool#
true for unilateral contact with the ground
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- width: float#
Rectangular contact width along local y-axis.
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.
- zmp() ndarray #
Returns the contact ZMP in the local frame.
- Returns:
zmp
- class placo.DynamicsCoMTask(arg2: ndarray)#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- ddtarget_world: ndarray#
Target acceleration in the world.
- derror: ndarray#
Current velocity error vector.
- dtarget_world: ndarray#
Target velocity to reach in robot frame.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- mask: AxisesMask#
Axises mask.
- name: str#
Object name.
- priority: any#
Object priority.
- target_world: ndarray#
Target to reach in world frame.
- class placo.DynamicsConstraint#
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- name: str#
Object name.
- priority: any#
Object priority.
- class placo.DynamicsFrameTask#
- T_world_frame: any#
- configure(name: str, priority: str = 'soft', position_weight: float = 1.0, orientation_weight: float = 1.0) None #
Configures the frame task.
- Parameters:
name – task name
priority – task priority
position_weight – weight for the position task
orientation_weight – weight for the orientation task
- orientation() DynamicsOrientationTask #
- position() DynamicsPositionTask #
- class placo.DynamicsGearTask#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- add_gear(target: str, source: str, ratio: float) None #
Adds a gear constraint, you can add multiple source for the same target, they will be summed.
- Parameters:
target – target joint
source – source joint
ratio – ratio
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- derror: ndarray#
Current velocity error vector.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- name: str#
Object name.
- priority: any#
Object priority.
- set_gear(target: str, source: str, ratio: float) None #
Sets a gear constraint.
- Parameters:
target – target joint
source – source joint
ratio – ratio
- class placo.DynamicsJointsTask#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- derror: ndarray#
Current velocity error vector.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- name: str#
Object name.
- priority: any#
Object priority.
- set_joint(joint: str, target: float, velocity: float = 0.0, acceleration: float = 0.0) None #
Sets the target for a given joint.
- Parameters:
joint – joint name
target – target position
velocity – target velocity
acceleration – target acceleration
- set_joints(arg2: dict) None #
- set_joints_velocities(arg2: dict) None #
- class placo.DynamicsOrientationTask(arg2: int, arg3: ndarray)#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- R_world_frame: ndarray#
Target orientation.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- derror: ndarray#
Current velocity error vector.
- domega_world: ndarray#
Target angular acceleration.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- mask: AxisesMask#
Mask.
- name: str#
Object name.
- omega_world: ndarray#
Target angular velocity.
- priority: any#
Object priority.
- class placo.DynamicsPositionTask(arg2: int, arg3: ndarray)#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- derror: ndarray#
Current velocity error vector.
- dtarget_world: ndarray#
Target velocity in the world.
- error: ndarray#
Current error vector.
- frame_index: any#
Frame.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- mask: AxisesMask#
Mask.
- name: str#
Object name.
- priority: any#
Object priority.
- target_world: ndarray#
Target position in the world.
- class placo.DynamicsReactionRatioConstraint(arg2: Contact, arg3: float)#
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- name: str#
Object name.
- priority: any#
Object priority.
- reaction_ratio: float#
Reaction ratio to be enforced.
- class placo.DynamicsRelativeFrameTask#
- T_a_b: any#
- configure(name: str, priority: str = 'soft', position_weight: float = 1.0, orientation_weight: float = 1.0) None #
Configures the relative frame task.
- Parameters:
name – task name
priority – task priority
position_weight – weight for the position task
orientation_weight – weight for the orientation task
- orientation() DynamicsRelativeOrientationTask #
Orientation task.
- position() DynamicsRelativePositionTask #
Position task.
- class placo.DynamicsRelativeOrientationTask(arg2: int, arg3: int, arg4: ndarray)#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- R_a_b: ndarray#
Target relative orientation.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- derror: ndarray#
Current velocity error vector.
- domega_a_b: ndarray#
Target relative angular velocity.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- mask: AxisesMask#
Mask.
- name: str#
Object name.
- omega_a_b: ndarray#
Target relative angular velocity.
- priority: any#
Object priority.
- class placo.DynamicsRelativePositionTask(arg2: int, arg3: int, arg4: ndarray)#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- ddtarget: ndarray#
Target relative velocity.
- derror: ndarray#
Current velocity error vector.
- dtarget: ndarray#
Target relative velocity.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- mask: AxisesMask#
Mask.
- name: str#
Object name.
- priority: any#
Object priority.
- target: ndarray#
Target relative position.
- class placo.DynamicsSolver(robot: RobotWrapper)#
- add_avoid_self_collisions_constraint() AvoidSelfCollisionsDynamicsConstraint #
Adds a constraint to the solver.
- Returns:
constraint
- add_com_task(target_world: ndarray) DynamicsCoMTask #
Adds a center of mass (in the world) task.
- Parameters:
target_world – target (in the world)
- Returns:
center of mass task
- add_constraint(constraint: any) any #
Adds a constraint to the solver.
- Parameters:
constraint – constraint
- Returns:
reference to internal constraint
- add_external_wrench_contact(frame_name: str) ExternalWrenchContact #
Adds an external wrench.
- Parameters:
frame_name – frame
- Returns:
external wrench contact
- add_fixed_contact(frame_task: DynamicsFrameTask) Contact6D #
Adds a fixed contact.
- Parameters:
frame_task – the associated frame task
- Returns:
fixed contact
- add_frame_task(frame_name: str, T_world_frame: ndarray) DynamicsFrameTask #
Adds a frame task, which is a pseudo-task packaging position and orientation, resulting in a decoupled task.
- Parameters:
frame_index – target frame
T_world_frame – target transformation in the world
- Returns:
frame task
- add_gear_task() DynamicsGearTask #
Adds a gear task, allowing replication of a joint. This can be used to implement timing belt, if coupled with an internal force.
- Returns:
gear task
- add_joints_task() DynamicsJointsTask #
Adds a joints task.
- Returns:
joints task
- add_orientation_task(frame_name: str, R_world_frame: ndarray) DynamicsOrientationTask #
Adds an orientation (in the world) task.
- Parameters:
frame_index – target frame
R_world_frame – target world orientation
- Returns:
orientation task
- add_planar_contact(frame_task: DynamicsFrameTask) Contact6D #
Adds a planar contact, which is unilateral in the sense of the local body z-axis.
- Parameters:
frame_task – associated frame task
- Returns:
planar contact
- add_point_contact(position_task: DynamicsPositionTask) PointContact #
Adds a point contact.
- Parameters:
position_task – the associated position task
- Returns:
point contact
- add_position_task(frame_name: str, target_world: ndarray) DynamicsPositionTask #
Adds a position (in the world) task.
- Parameters:
frame_index – target frame
target_world – target position in the world
- Returns:
position task
- add_puppet_contact() PuppetContact #
Adds a puppet contact, this will add some free contact forces for the whole system, allowing it to be controlled freely.
- Returns:
puppet contact
- add_reaction_ratio_constraint(contact: Contact, reaction_ratio: float) DynamicsReactionRatioConstraint #
Adds a constraint enforce reaction ratio.
- Parameters:
contact – contact
reaction_ratio – reaction ratio to enforce
- Returns:
reaction ratio constraint
- add_relative_fixed_contact(frame_task: DynamicsRelativeFrameTask) Relative6DContact #
Adds a relative fixed contact, can be used for fixed closed loops.
- Parameters:
frame_task – the associated relative frame task
- Returns:
relative fixed contact
- add_relative_frame_task(frame_a_name: str, frame_b_name: str, T_a_b: ndarray) DynamicsRelativeFrameTask #
Adds a relative frame task, which is a pseudo-task packaging relative position and orientation tasks.
- Parameters:
frame_a_index – frame a
frame_b_index – frame b
T_a_b – target transformation value for b frame in a
- Returns:
relative frame task
- add_relative_orientation_task(frame_a_name: str, frame_b_name: str, R_a_b: ndarray) DynamicsRelativeOrientationTask #
Adds a relative orientation task.
- Parameters:
frame_a_index – frame a
frame_b_index – frame b
R_a_b – target value for the orientation of b frame in a
- Returns:
relative orientation task
- add_relative_point_contact(position_task: DynamicsRelativePositionTask) RelativePointContact #
Adds a relative point contact, which can be typically used for internal forces like loop-closing.
- Parameters:
position_task – associated relative position task
- Returns:
relative point contact
- add_relative_position_task(frame_a_name: str, frame_b_name: str, target_world: ndarray) DynamicsRelativePositionTask #
Adds a relative position task.
- Parameters:
frame_a_index – frame a
frame_b_index – frame b
target – target value for AB vector, expressed in A
- Returns:
relative position task
- add_task(task: any) any #
Adds a task to the solver.
- Parameters:
task – task
- Returns:
reference to internal task
- add_task_contact(task: DynamicsTask) TaskContact #
Adds contact forces associated with any given task.
- Parameters:
task – task
- Returns:
task contact
- add_torque_task() DynamicsTorqueTask #
Adds a torque task.
- Returns:
torque task
- add_unilateral_point_contact(position_task: DynamicsPositionTask) PointContact #
Adds an unilateral point contact, in the sense of the world z-axis.
- Parameters:
position_task – the associated position task
- Returns:
unilateral point contact
- clear() None #
Clears the internal tasks.
- count_contacts() int #
- dt: float#
Solver dt (seconds)
- dump_status() None #
Shows the tasks status.
- enable_joint_limits(enable: bool) None #
Enables/disables joint limits inequalities.
- enable_torque_limits(enable: bool) None #
Enables/disables torque limits inequalities.
- enable_velocity_limits(enable: bool) None #
Enables/disables joint velocity inequalities.
- enable_velocity_vs_torque_limits(enable: bool) None #
Enables the velocity vs torque inequalities.
- friction: float#
Global friction that is added to all the joints.
- gravity_only: bool#
Use gravity only (no coriolis, no centrifugal)
- mask_fbase(masked: bool) None #
Decides if the floating base should be masked.
- qdd_safe: float#
The value of qdd safe.
- remove_constraint(constraint: DynamicsConstraint) None #
Removes a constraint from the solver.
- Parameters:
constraint – constraint
- remove_task(task: DynamicsFrameTask) None #
Removes a frame task from the solver.
- Parameters:
task – frame task
- reset_joint(joint_name: str) None #
Resets a given joint so that its torque is no longer overriden.
- Parameters:
joint_name – the joint
- robot: RobotWrapper#
- set_passive(joint_name: str, kp: float = 0.0, kd: float = 0.0) None #
Sets a DoF as passive, the corresponding tau will be fixed in the equation of motion it can be purely passive joint or a spring-like behaviour.
- Parameters:
joint_name – the joint
is_passive – true if the should the joint be passive
kp – kp gain if the joint is a spring (0 by default)
kd – kd gain if the joint is a spring (0 by default)
- set_tau(joint_name: str, tau: float) None #
Sets a custom torque to be applied by a given joint.
- Parameters:
joint_name – the joint
tau – torque
- solve(integrate: bool = False) DynamicsSolverResult #
- class placo.DynamicsSolverResult#
- qdd: ndarray#
- success: bool#
- tau: ndarray#
- tau_dict(arg2: RobotWrapper) dict #
- class placo.DynamicsTask#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- derror: ndarray#
Current velocity error vector.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- name: str#
Object name.
- priority: any#
Object priority.
- class placo.DynamicsTorqueTask#
- A: ndarray#
A matrix in Ax = b, where x is the accelerations.
- b: ndarray#
b vector in Ax = b, where x is the accelerations
- configure(name: str, priority: any, weight: float = 1.0) None #
Configures the object.
- Parameters:
name – task name
priority – task priority (hard, soft or scaled)
weight – task weight
- critically_damped: bool#
If this is true, kd will be computed from kp to have a critically damped system.
- derror: ndarray#
Current velocity error vector.
- error: ndarray#
Current error vector.
- kd: float#
D gain for position control.
- kp: float#
K gain for position control.
- name: str#
Object name.
- priority: any#
Object priority.
- set_torque(joint: str, torque: float) None #
Sets the target for a given joint.
- Parameters:
joint – joint name
torque – target torque
- class placo.ExternalWrenchContact(frame_index: any)#
see DynamicsSolver::add_external_wrench_contact
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- frame_index: any#
- mu: float#
Coefficient of friction (if relevant)
- w_ext: ndarray#
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.
- class placo.PointContact(position_task: DynamicsPositionTask, unilateral: bool)#
see DynamicsSolver::add_point_contact and DynamicsSolver::add_unilateral_point_contact
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- mu: float#
Coefficient of friction (if relevant)
- position_task() DynamicsPositionTask #
associated position task
- unilateral: bool#
true for unilateral contact with the ground
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.
- class placo.PuppetContact#
see DynamicsSolver::add_puppet_contact
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- mu: float#
Coefficient of friction (if relevant)
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.
- class placo.Relative6DContact(frame_task: DynamicsRelativeFrameTask)#
see DynamicsSolver::add_relative_fixed_contact
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- mu: float#
Coefficient of friction (if relevant)
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.
- class placo.RelativePointContact(position_task: DynamicsRelativePositionTask)#
see DynamicsSolver::add_relative_point_contact
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- mu: float#
Coefficient of friction (if relevant)
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.
- class placo.TaskContact(task: DynamicsTask)#
see DynamicsSolver::add_task_contact
- active: bool#
true if the contact is active (ignored by the solver else, this allow to enable/disable a contact without removing it from the solver)
- mu: float#
Coefficient of friction (if relevant)
- weight_forces: float#
Weight of forces for the optimization (if relevant)
- weight_moments: float#
Weight of moments for optimization (if relevant)
- wrench: ndarray#
Wrench populated after the DynamicsSolver::solve call.