ami-iit / bipedal-locomotion-framework

Suite of libraries for achieving bipedal locomotion on humanoid robots

Home Page:https://ami-iit.github.io/bipedal-locomotion-framework/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add minimization of joint torques to TSID

traversaro opened this issue · comments

Similar to Equation 17 of https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=7759126, even if in our case probably we can just add a $\lambda |\tau|^2$ term to the cost to avoid to have an implementation too complex.

cc @ami-iit/isaac

One possibility is to use the VariableRegularizationTask as follows:

self.left_foot_regularization_task = blf.tsid.VariableRegularizationTask()
self.left_foot_regularization_task_name = "left_foot_regularization_task"
self.left_foot_regularization_task_priority = 1
self.left_foot_regularization_task_weight = 1e-1*np.ones(6)
self.left_foot_regularization_task_param_handler = blf.parameters_handler.StdParametersHandler()
self.left_foot_regularization_task_param_handler.set_parameter_string(name='variable_name', value= self.variable_name_left_contact)
self.left_foot_regularization_task_param_handler.set_parameter_int(name='variable_size', value= 6)
self.left_foot_regularization_task.initialize(param_handler = self.left_foot_regularization_task_param_handler)

where the variable_name should be replaced by the variable name that needs to regularised also within the optimisation problems variable handler, that could be, joint_torques in this case.

One possibility is to use the VariableRegularizationTask as follows:

self.left_foot_regularization_task = blf.tsid.VariableRegularizationTask()
self.left_foot_regularization_task_name = "left_foot_regularization_task"
self.left_foot_regularization_task_priority = 1
self.left_foot_regularization_task_weight = 1e-1*np.ones(6)
self.left_foot_regularization_task_param_handler = blf.parameters_handler.StdParametersHandler()
self.left_foot_regularization_task_param_handler.set_parameter_string(name='variable_name', value= self.variable_name_left_contact)
self.left_foot_regularization_task_param_handler.set_parameter_int(name='variable_size', value= 6)
self.left_foot_regularization_task.initialize(param_handler = self.left_foot_regularization_task_param_handler)

where the variable_name should be replaced by the variable name that needs to regularised also within the optimisation problems variable handler, that could be, joint_torques in this case.

Thank you @akhilsathuluri, I'll try this task! :)

Given the comments I guess we can close.