MCPcopy Create free account
hub / github.com/Simple-Robotics/Simple / test_freeflyer_limits

Function test_freeflyer_limits

tests/python/test_simulator_instance.py:323–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321
322
323def 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
348def test_composite_limits():

Callers

nothing calls this directly

Calls 2

getNumberOfContactsMethod · 0.80

Tested by

no test coverage detected