@@ -68,6 +68,7 @@ def solve_inertial_param_sdp(
68
68
identify_viscous_friction : bool = True ,
69
69
identify_dynamic_dry_friction : bool = True ,
70
70
payload_only = False ,
71
+ known_max_mass : Optional [float ] = None ,
71
72
solver_kPrintToConsole : bool = False ,
72
73
) -> Tuple [
73
74
MathematicalProgram , MathematicalProgramResult , np .ndarray , np .ndarray , np .ndarray
@@ -102,6 +103,8 @@ def solve_inertial_param_sdp(
102
103
payload_only (bool, optional): Whether to only include the 10 inertial
103
104
parameters of the last link. These are the parameters that we care about
104
105
for payload identification.
106
+ known_max_mass (float, optional): The known maximum mass of the robot. This is
107
+ used as an upper bound on the sum of the identified masses.
105
108
solver_kPrintToConsole (bool, optional): Whether to print solver output.
106
109
107
110
Returns:
@@ -291,6 +294,11 @@ def solve_inertial_param_sdp(
291
294
for dynamic_dry_friction in dynamic_dry_frictions :
292
295
prog .AddConstraint (dynamic_dry_friction >= 0 )
293
296
297
+ # Maximum total mass constraint
298
+ if known_max_mass is not None :
299
+ masses = np .array ([var .m for var in variables ])
300
+ prog .AddConstraint (masses .sum () <= known_max_mass )
301
+
294
302
options = None
295
303
if solver_kPrintToConsole :
296
304
options = SolverOptions ()
0 commit comments