()
| 321 | |
| 322 | |
| 323 | def test_freeflyer_limits(): |
| 324 | model = pin.Model() |
| 325 | geom_model = pin.GeometryModel() |
| 326 | a = 0.1 |
| 327 | m = 3.8 |
| 328 | freeflyer = pin.JointModelFreeFlyer() |
| 329 | joint = model.addJoint(0, freeflyer, pin.SE3.Identity(), "ball") |
| 330 | model.appendBodyToJoint(joint, pin.Inertia.FromSphere(m, a / 2), pin.SE3.Identity()) |
| 331 | ball_shape = Sphere(a / 2) |
| 332 | geom_ball = pin.GeometryObject("ball", joint, joint, pin.SE3.Identity(), ball_shape) |
| 333 | geom_ball.meshColor = np.array([1.0, 0.2, 0.2, 1.0]) |
| 334 | ball_id = geom_model.addGeometryObject(geom_ball) |
| 335 | q0 = pin.neutral(model) |
| 336 | model.lowerPositionLimit = q0.copy() |
| 337 | model.upperPositionLimit = q0.copy() |
| 338 | sim = simple.Simulator(model, geom_model) |
| 339 | v = np.zeros(model.nv) |
| 340 | tau = np.zeros(model.nv) |
| 341 | dt = 1e-3 |
| 342 | sim.step(q0, v, tau, dt) |
| 343 | assert sim.constraints_problem.getNumberOfContacts() == 0 |
| 344 | assert sim.constraints_problem.constraints_problem_size() == 2 * (model.nq - 4) |
| 345 | assert np.linalg.norm(sim.vnew) < 1e-6 |
| 346 | |
| 347 | |
| 348 | def test_composite_limits(): |
nothing calls this directly
no test coverage detected