Refactor nativeccd interface.
- Update mj_ccd interface for multi-contacts, - Support GJK cutoff distance, and - Remove mjc_fixNormal from nativeccd (causes bug with cylindar box collisions). PiperOrigin-RevId: 696185362 Change-Id: I4828b7ee1bde078268220172a4937cd553f6187e
This commit is contained in:
committed by
Copybara-Service
parent
c68ee8055e
commit
0e8cca93e1
@@ -16,7 +16,9 @@
|
||||
#define MUJOCO_SRC_ENGINE_ENGINE_COLLISION_GJK_H_
|
||||
|
||||
#include <mujoco/mjexport.h>
|
||||
#include <mujoco/mjmodel.h>
|
||||
#include <mujoco/mjtnum.h>
|
||||
|
||||
#include "engine/engine_collision_convex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -27,30 +29,32 @@ extern "C" {
|
||||
struct _mjCCDConfig {
|
||||
int max_iterations; // the maximum number of iterations for GJK and EPA
|
||||
mjtNum tolerance; // tolerance used by GJK and EPA
|
||||
int contacts; // set to true to recover contact (pendetration) info
|
||||
int distances; // set to true to recover distance info
|
||||
int max_contacts; // set to max number of contact points to recover
|
||||
mjtNum dist_cutoff; // set to max geom distance to recover
|
||||
};
|
||||
typedef struct _mjCCDConfig mjCCDConfig;
|
||||
|
||||
// data produced from running GJK and EPA
|
||||
struct _mjCCDStatus {
|
||||
mjtNum x1[3]; // witness point for geom 1
|
||||
mjtNum x2[3]; // witness point for geom 2
|
||||
// geom distance information
|
||||
mjtNum dist; // distance between geoms
|
||||
mjtNum x1[3 * mjMAXCONPAIR]; // witness points for geom 1
|
||||
mjtNum x2[3 * mjMAXCONPAIR]; // witness points for geom 2
|
||||
int nx; // number of witness points
|
||||
|
||||
// configurations used
|
||||
int max_iterations; // the maximum number of iterations for GJK and EPA
|
||||
mjtNum tolerance; // tolerance used by GJK and EPA
|
||||
int has_contacts; // set to true if attempted to recover contact (pendetration) info
|
||||
int has_distances; // set to true if attempted to recover distance info
|
||||
int max_iterations; // the maximum number of iterations for GJK and EPA
|
||||
mjtNum tolerance; // tolerance used by GJK and EPA
|
||||
int max_contacts; // set to max number of contact points to recover
|
||||
mjtNum dist_cutoff; // set to max geom distance to recover
|
||||
|
||||
// statistics for debugging purposes
|
||||
mjtNum gjk_dist; // the distance returned by GJK
|
||||
int gjk_iterations; // number of iterations that GJK ran
|
||||
int epa_iterations; // number of iterations that EPA ran (negative if EPA did not run)
|
||||
mjtNum simplex1[12]; // the simplex that GJK returned for obj1
|
||||
mjtNum simplex2[12]; // the simplex that GJK returned for obj2
|
||||
mjtNum simplex[12]; // the simplex that GJK returned for the Minkowski difference
|
||||
int nsimplex; // size of simplex 1 & 2
|
||||
int gjk_iterations; // number of iterations that GJK ran
|
||||
int epa_iterations; // number of iterations that EPA ran (negative if EPA did not run)
|
||||
mjtNum simplex1[12]; // the simplex that GJK returned for obj1
|
||||
mjtNum simplex2[12]; // the simplex that GJK returned for obj2
|
||||
mjtNum simplex[12]; // the simplex that GJK returned for the Minkowski difference
|
||||
int nsimplex; // size of simplex 1 & 2
|
||||
};
|
||||
typedef struct _mjCCDStatus mjCCDStatus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user