@Test// timeout = 30000 public void testDoGroundContact() { YoVariableRegistry registry = new YoVariableRegistry("CollisionGroundContactModelTest"); ArrayList<GroundContactPoint> gcPoints = new ArrayList<>(); GroundContactPoint gc = new GroundContactPoint("groundContactPoint", registry); gc.setPosition(new Point3D(0.852, 0.116, 0.099)); gcPoints.add(gc); CollisionGroundContactModel groundContactModel = new CollisionGroundContactModel(gcPoints, registry); groundContactModel.setGroundProfile3D(new RollingGroundProfile()); groundContactModel.doGroundContact(); Assert.assertTrue(gc.isInContact()); gc.setPosition(new Point3D(0.852, 0.116, 0.15)); groundContactModel.doGroundContact(); Assert.assertFalse(gc.isInContact()); } }
Vector3D velocity = new Vector3D(0.0, 0.0, -1.0); groundContactPoint.setPosition(position); groundContactPoint.setVelocity(velocity); if (velocity.getZ() > 0.0) velocity.setZ(-velocity.getZ()); groundContactPoint.setPosition(position); groundContactPoint.setVelocity(velocity); velocity.set(0.0, 0.0, 0.0); groundContactPoint.setPosition(position); groundContactPoint.setVelocity(velocity);
Vector3D velocity = new Vector3D(0.0, 0.0, 0.0); groundContactPoint.setPosition(position); groundContactPoint.setVelocity(velocity);
Vector3D queryVelocityOnFlat = EuclidCoreRandomTools.nextVector3DWithFixedLength(random, maxAbsoluteVelocity); groundContactPointOnFlat.setPosition(queryPointOnFlat); groundContactPointOnFlat.setVelocity(queryVelocityOnFlat); groundContactModelOnFlat.doGroundContact(); transform3D.transform(queryVelocityOnSlope); groundContactPointOnSlope.setPosition(queryPointOnSlope); groundContactPointOnSlope.setVelocity(queryVelocityOnSlope); groundContactModelOnSlope.doGroundContact();