| 38 | |
| 39 | |
| 40 | class FreeFloatingRobotDampingPolicy(Policy): |
| 41 | def __init__(self, model: pin.Model, damping_factor: float): |
| 42 | self.actuation = np.zeros((model.nv, model.nv - 6)) |
| 43 | self.actuation[6:, :] = np.eye(model.nv - 6) |
| 44 | self.damping_factor = damping_factor |
| 45 | |
| 46 | def act( |
| 47 | self, simulator: simple.Simulator, q: np.ndarray, v: np.ndarray, dt |
| 48 | ) -> np.ndarray: |
| 49 | # Note: simulator and model should coincide |
| 50 | tau_act = -self.damping_factor * v[6:] |
| 51 | return self.actuation @ tau_act |
| 52 | |
| 53 | |
| 54 | class RobotArmDampingPolicy(Policy): |
nothing calls this directly
no outgoing calls
no test coverage detected