Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
Added __str__ functions to capture pb/sols
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Apr 20, 2018
1 parent 6e2fe69 commit 55e134e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions capture_walking/capture_problem.py
Expand Up @@ -78,6 +78,19 @@ def __init__(self, lambda_min, lambda_max, nb_steps):
self.s_sq = s_sq
self.target_height = None

def __str__(self):
s = "delta = %s;\n" % str(list(self.delta))
s += "g = %.32f;\n" % gravity_const
s += "init_omega_max = %.32f;\n" % self.init_omega_max
s += "init_omega_min = %.32f;\n" % self.init_omega_min
s += "init_zbar = %.32f;\n" % self.init_zbar
s += "init_zbar_deriv = %.32f;\n" % self.init_zbar_deriv
s += "lambda_max = %.32f;\n" % self.lambda_max
s += "lambda_min = %.32f;\n" % self.lambda_min
s += "s = %s;\n" % str(list(self.s))
s += "target_height = %.32f;" % self.target_height
return s

def precompute(self):
"""
Precompute QR decompositions for all nullspace-projected Jacobians used
Expand Down
3 changes: 3 additions & 0 deletions capture_walking/capture_solution.py
Expand Up @@ -53,6 +53,9 @@ def __init__(self, phi_1_n, capture_pb, optimal_found=None):
self.s = capture_pb.s
self.switch_times = None

def __str__(self):
return "phi = %s;" % str(list(self.phi))

@property
def var_cost(self):
"""
Expand Down

0 comments on commit 55e134e

Please sign in to comment.