You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this was introduced to make sure the targets were showing on the right plots, but is seems this part of the code is not used. It should be either removed or repaired)
@staticmethod
def minimize_controls(penalty: PenaltyOption, controller: PenaltyController, key: str):
"""
Minimize the joint torque part of the control variables.
By default this function is quadratic, meaning that it minimizes towards the target.
Targets (default=np.zeros()) and indices (default=all_idx) can be specified.
Parameters
----------
penalty: PenaltyOption
The actual penalty to declare
controller: PenaltyController
The penalty node elements
key: str
The name of the controls to minimize
"""
penalty.quadratic = True if penalty.quadratic is None else penalty.quadratic
if key in controller.get_nlp.variable_mappings:
target_mapping = controller.get_nlp.variable_mappings[key]
else:
target_mapping = BiMapping(
to_first=list(range(controller.get_nlp.controls[key].cx_start.shape[0])),
to_second=list(range(controller.get_nlp.controls[key].cx_start.shape[0])),
) # TODO: why if condition, target_mapping not used (Pariterre?)
if penalty.integration_rule == QuadratureRule.RECTANGLE_LEFT:
# TODO: for trapezoidal integration (This should not be done here but in _set_penalty_function)
penalty.add_target_to_plot(controller=controller, combine_to=f"{key}_controls")
penalty.multi_thread = True if penalty.multi_thread is None else penalty.multi_thread
# TODO: We should scale the target here!
return controller.controls[key].cx_start
The text was updated successfully, but these errors were encountered:
this was introduced to make sure the targets were showing on the right plots, but is seems this part of the code is not used. It should be either removed or repaired)
The text was updated successfully, but these errors were encountered: