2015-06-21 20:24:36 +00:00
# ifndef SHARED_MEMORY_COMMANDS_H
# define SHARED_MEMORY_COMMANDS_H
//this is a very experimental draft of commands. We will iterate on this API (commands, arguments etc)
2015-09-17 06:09:10 +00:00
# include "SharedMemoryPublic.h"
2015-07-15 22:23:40 +00:00
# ifdef __GNUC__
# include <stdint.h>
typedef int32_t smInt32_t ;
typedef int64_t smInt64_t ;
typedef uint32_t smUint32_t ;
typedef uint64_t smUint64_t ;
# elif defined(_MSC_VER)
typedef __int32 smInt32_t ;
typedef __int64 smInt64_t ;
typedef unsigned __int32 smUint32_t ;
typedef unsigned __int64 smUint64_t ;
# else
typedef int smInt32_t ;
typedef long long int smInt64_t ;
typedef unsigned int smUint32_t ;
typedef unsigned long long int smUint64_t ;
# endif
2016-11-05 00:44:16 +00:00
# define SHARED_MEMORY_MAX_STREAM_CHUNK_SIZE (512*1024)
2015-06-21 20:24:36 +00:00
# define SHARED_MEMORY_SERVER_TEST_C
2016-08-18 02:35:52 +00:00
# define MAX_DEGREE_OF_FREEDOM 128
2015-08-02 21:00:43 +00:00
# define MAX_NUM_SENSORS 256
2015-06-21 20:24:36 +00:00
# define MAX_URDF_FILENAME_LENGTH 1024
2016-06-04 02:03:56 +00:00
# define MAX_SDF_FILENAME_LENGTH 1024
2015-08-20 05:51:16 +00:00
# define MAX_FILENAME_LENGTH MAX_URDF_FILENAME_LENGTH
2016-04-24 00:29:46 +00:00
# define MAX_NUM_LINKS MAX_DEGREE_OF_FREEDOM
2016-07-14 07:05:57 +00:00
# define MAX_SDF_BODIES 500
2015-06-21 20:24:36 +00:00
2015-11-23 04:50:32 +00:00
struct TmpFloat3
{
float m_x ;
float m_y ;
float m_z ;
} ;
# ifdef _WIN32
__inline
# else
inline
# endif
TmpFloat3 CreateTmpFloat3 ( float x , float y , float z )
{
TmpFloat3 tmp ;
tmp . m_x = x ;
tmp . m_y = y ;
tmp . m_z = z ;
return tmp ;
}
2016-06-04 02:03:56 +00:00
enum EnumSdfArgsUpdateFlags
{
SDF_ARGS_FILE_NAME = 1 ,
} ;
struct SdfArgs
{
char m_sdfFileName [ MAX_URDF_FILENAME_LENGTH ] ;
2016-08-17 00:56:30 +00:00
int m_useMultiBody ;
2016-06-04 02:03:56 +00:00
} ;
2016-11-12 02:07:42 +00:00
struct FileArgs
{
char m_fileName [ MAX_URDF_FILENAME_LENGTH ] ;
} ;
2015-07-31 06:22:44 +00:00
enum EnumUrdfArgsUpdateFlags
{
URDF_ARGS_FILE_NAME = 1 ,
URDF_ARGS_INITIAL_POSITION = 2 ,
URDF_ARGS_INITIAL_ORIENTATION = 4 ,
URDF_ARGS_USE_MULTIBODY = 8 ,
URDF_ARGS_USE_FIXED_BASE = 16 ,
} ;
2015-06-21 20:24:36 +00:00
struct UrdfArgs
{
2015-07-23 18:51:25 +00:00
char m_urdfFileName [ MAX_URDF_FILENAME_LENGTH ] ;
double m_initialPosition [ 3 ] ;
double m_initialOrientation [ 4 ] ;
int m_useMultiBody ;
int m_useFixedBase ;
2015-06-21 20:24:36 +00:00
} ;
2016-12-31 22:43:15 +00:00
struct MjcfArgs
{
char m_mjcfFileName [ MAX_URDF_FILENAME_LENGTH ] ;
int m_useMultiBody ;
} ;
2015-07-09 21:04:58 +00:00
struct BulletDataStreamArgs
{
2015-08-20 05:51:16 +00:00
char m_bulletFileName [ MAX_FILENAME_LENGTH ] ;
2015-07-21 06:35:29 +00:00
int m_bodyUniqueId ;
2015-07-09 21:04:58 +00:00
} ;
2015-06-22 22:30:57 +00:00
struct SetJointFeedbackArgs
{
int m_bodyUniqueId ;
int m_linkId ;
2015-07-23 18:51:25 +00:00
int m_isEnabled ;
2015-06-22 22:30:57 +00:00
} ;
2015-10-14 05:23:28 +00:00
enum EnumInitPoseFlags
{
INIT_POSE_HAS_INITIAL_POSITION = 1 ,
INIT_POSE_HAS_INITIAL_ORIENTATION = 2 ,
2016-11-28 23:11:34 +00:00
INIT_POSE_HAS_JOINT_STATE = 4 ,
INIT_POSE_HAS_BASE_LINEAR_VELOCITY = 8 ,
INIT_POSE_HAS_BASE_ANGULAR_VELOCITY = 16 ,
2015-10-14 05:23:28 +00:00
} ;
2015-09-17 06:09:10 +00:00
2015-07-14 15:34:02 +00:00
2015-07-22 04:46:28 +00:00
///InitPoseArgs is mainly to initialize (teleport) the robot in a particular position
///No motors or controls are needed to initialize the pose. It is similar to
///moving a robot to a starting place, while it is switched off. It is only called
///at the start of a robot control session. All velocities and control forces are cleared to zero.
struct InitPoseArgs
{
int m_bodyUniqueId ;
2016-06-24 14:31:17 +00:00
int m_hasInitialStateQ [ MAX_DEGREE_OF_FREEDOM ] ;
2015-07-22 04:46:28 +00:00
double m_initialStateQ [ MAX_DEGREE_OF_FREEDOM ] ;
2016-11-28 23:11:34 +00:00
int m_hasInitialStateQdot [ MAX_DEGREE_OF_FREEDOM ] ;
double m_initialStateQdot [ MAX_DEGREE_OF_FREEDOM ] ;
2015-07-22 04:46:28 +00:00
} ;
2015-08-20 05:51:16 +00:00
struct RequestDebugLinesArgs
{
int m_debugMode ;
2015-09-03 21:18:22 +00:00
int m_startingLineIndex ;
2015-08-20 05:51:16 +00:00
} ;
2016-05-31 17:23:04 +00:00
struct RequestPixelDataArgs
{
2016-06-01 18:04:10 +00:00
float m_viewMatrix [ 16 ] ;
float m_projectionMatrix [ 16 ] ;
int m_startPixelIndex ;
2016-06-07 23:11:58 +00:00
int m_pixelWidth ;
int m_pixelHeight ;
2016-11-17 23:15:52 +00:00
float m_lightDirection [ 3 ] ;
2016-11-20 20:52:12 +00:00
float m_lightColor [ 3 ] ;
2016-11-29 21:19:35 +00:00
float m_lightDistance ;
2016-12-06 23:21:35 +00:00
float m_lightAmbientCoeff ;
float m_lightDiffuseCoeff ;
float m_lightSpecularCoeff ;
2016-11-29 22:10:07 +00:00
int m_hasShadow ;
2016-05-31 17:23:04 +00:00
} ;
2016-06-01 18:04:10 +00:00
enum EnumRequestPixelDataUpdateFlags
{
REQUEST_PIXEL_ARGS_HAS_CAMERA_MATRICES = 1 ,
2016-11-20 20:52:12 +00:00
REQUEST_PIXEL_ARGS_SET_PIXEL_WIDTH_HEIGHT = 2 ,
REQUEST_PIXEL_ARGS_SET_LIGHT_DIRECTION = 4 ,
REQUEST_PIXEL_ARGS_SET_LIGHT_COLOR = 8 ,
2016-11-29 21:19:35 +00:00
REQUEST_PIXEL_ARGS_SET_LIGHT_DISTANCE = 16 ,
REQUEST_PIXEL_ARGS_SET_SHADOW = 32 ,
2016-12-06 23:21:35 +00:00
REQUEST_PIXEL_ARGS_SET_AMBIENT_COEFF = 64 ,
REQUEST_PIXEL_ARGS_SET_DIFFUSE_COEFF = 128 ,
REQUEST_PIXEL_ARGS_SET_SPECULAR_COEFF = 256 ,
2016-07-13 01:16:13 +00:00
//don't exceed (1<<15), because this enum is shared with EnumRenderer in SharedMemoryPublic.h
2016-06-07 23:11:58 +00:00
2016-06-01 18:04:10 +00:00
} ;
2016-11-10 05:01:04 +00:00
enum EnumRequestContactDataUpdateFlags
{
CMD_REQUEST_CONTACT_POINT_HAS_QUERY_MODE = 1 ,
CMD_REQUEST_CONTACT_POINT_HAS_CLOSEST_DISTANCE_THRESHOLD = 2 ,
2016-11-20 01:13:56 +00:00
CMD_REQUEST_CONTACT_POINT_HAS_LINK_INDEX_A_FILTER = 4 ,
CMD_REQUEST_CONTACT_POINT_HAS_LINK_INDEX_B_FILTER = 8 ,
2016-11-10 05:01:04 +00:00
} ;
2016-12-27 03:40:09 +00:00
struct RequestRaycastIntersections
{
double m_rayFromPosition [ 3 ] ;
double m_rayToPosition [ 3 ] ;
} ;
struct SendRaycastHits
{
int m_numRaycastHits ;
b3RayHitInfo m_rayHits [ MAX_RAY_HITS ] ;
} ;
2016-09-01 20:30:07 +00:00
struct RequestContactDataArgs
{
int m_startingContactPointIndex ;
int m_objectAIndexFilter ;
int m_objectBIndexFilter ;
2016-11-20 01:13:56 +00:00
int m_linkIndexAIndexFilter ;
int m_linkIndexBIndexFilter ;
2016-11-10 05:01:04 +00:00
double m_closestDistanceThreshold ;
2016-11-10 19:22:22 +00:00
int m_mode ;
} ;
struct RequestOverlappingObjectsArgs
{
int m_startingOverlappingObjectIndex ;
2016-11-10 05:01:04 +00:00
double m_aabbQueryMin [ 3 ] ;
double m_aabbQueryMax [ 3 ] ;
2016-09-01 20:30:07 +00:00
} ;
2016-06-01 18:04:10 +00:00
2016-10-19 05:05:28 +00:00
struct RequestVisualShapeDataArgs
{
int m_bodyUniqueId ;
int m_startingVisualShapeIndex ;
} ;
2016-10-21 06:40:30 +00:00
struct UpdateVisualShapeDataArgs
{
int m_bodyUniqueId ;
2016-10-21 18:55:27 +00:00
int m_jointIndex ;
int m_shapeIndex ;
2016-10-21 06:40:30 +00:00
int m_textureUniqueId ;
} ;
struct LoadTextureArgs
{
char m_textureFileName [ MAX_FILENAME_LENGTH ] ;
} ;
2016-10-19 05:05:28 +00:00
struct SendVisualShapeDataArgs
{
int m_bodyUniqueId ;
int m_startingVisualShapeIndex ;
int m_numVisualShapesCopied ;
int m_numRemainingVisualShapes ;
} ;
2016-06-01 18:04:10 +00:00
2015-08-20 05:51:16 +00:00
struct SendDebugLinesArgs
{
2015-09-03 21:18:22 +00:00
int m_startingLineIndex ;
2015-08-20 05:51:16 +00:00
int m_numDebugLines ;
2015-09-03 21:18:22 +00:00
int m_numRemainingDebugLines ;
2015-08-20 05:51:16 +00:00
} ;
2016-05-31 17:23:04 +00:00
struct SendPixelDataArgs
{
int m_imageWidth ;
int m_imageHeight ;
int m_startingPixelIndex ;
int m_numPixelsCopied ;
int m_numRemainingPixels ;
} ;
2015-09-25 05:42:22 +00:00
struct PickBodyArgs
{
double m_rayFromWorld [ 3 ] ;
double m_rayToWorld [ 3 ] ;
} ;
2015-08-20 05:51:16 +00:00
2015-07-22 04:46:28 +00:00
///Controlling a robot involves sending the desired state to its joint motor controllers.
///The control mode determines the state variables used for motor control.
2015-06-21 20:24:36 +00:00
struct SendDesiredStateArgs
{
int m_bodyUniqueId ;
2015-07-14 15:34:02 +00:00
int m_controlMode ;
2015-07-15 22:23:40 +00:00
2015-08-20 05:51:16 +00:00
//PD parameters in case m_controlMode == CONTROL_MODE_POSITION_VELOCITY_PD
double m_Kp [ MAX_DEGREE_OF_FREEDOM ] ; //indexed by degree of freedom, 6 for base, and then the dofs for each link
double m_Kd [ MAX_DEGREE_OF_FREEDOM ] ; //indexed by degree of freedom, 6 for base, and then the dofs for each link
2016-06-24 14:31:17 +00:00
int m_hasDesiredStateFlags [ MAX_DEGREE_OF_FREEDOM ] ;
2015-07-15 22:23:40 +00:00
//desired state is only written by the client, read-only access by server is expected
2015-08-20 05:51:16 +00:00
//m_desiredStateQ is indexed by position variables,
//starting with 3 base position variables, 4 base orientation variables (quaternion), then link position variables
2015-07-15 22:23:40 +00:00
double m_desiredStateQ [ MAX_DEGREE_OF_FREEDOM ] ;
2016-06-24 14:31:17 +00:00
2015-08-20 05:51:16 +00:00
//m_desiredStateQdot is index by velocity degrees of freedom, 3 linear and 3 angular variables for the base and then link velocity variables
2015-07-15 22:23:40 +00:00
double m_desiredStateQdot [ MAX_DEGREE_OF_FREEDOM ] ;
//m_desiredStateForceTorque is either the actual applied force/torque (in CONTROL_MODE_TORQUE) or
2015-08-20 05:51:16 +00:00
//or the maximum applied force/torque for the PD/motor/constraint to reach the desired velocity in CONTROL_MODE_VELOCITY and CONTROL_MODE_POSITION_VELOCITY_PD mode
//indexed by degree of freedom, 6 dof base, and then dofs for each link
2015-07-15 22:23:40 +00:00
double m_desiredStateForceTorque [ MAX_DEGREE_OF_FREEDOM ] ;
2016-03-17 23:11:53 +00:00
2015-06-21 20:24:36 +00:00
} ;
2016-06-04 02:03:56 +00:00
enum EnumSimDesiredStateUpdateFlags
{
SIM_DESIRED_STATE_HAS_Q = 1 ,
SIM_DESIRED_STATE_HAS_QDOT = 2 ,
SIM_DESIRED_STATE_HAS_KD = 4 ,
SIM_DESIRED_STATE_HAS_KP = 8 ,
SIM_DESIRED_STATE_HAS_MAX_FORCE = 16 ,
} ;
2015-07-22 04:46:28 +00:00
2015-07-31 06:22:44 +00:00
enum EnumSimParamUpdateFlags
2015-07-22 04:46:28 +00:00
{
SIM_PARAM_UPDATE_DELTA_TIME = 1 ,
SIM_PARAM_UPDATE_GRAVITY = 2 ,
SIM_PARAM_UPDATE_NUM_SOLVER_ITERATIONS = 4 ,
SIM_PARAM_UPDATE_NUM_SIMULATION_SUB_STEPS = 8 ,
2016-07-18 06:50:11 +00:00
SIM_PARAM_UPDATE_REAL_TIME_SIMULATION = 16 ,
2016-10-23 14:14:50 +00:00
SIM_PARAM_UPDATE_DEFAULT_CONTACT_ERP = 32 ,
2016-12-01 06:24:20 +00:00
SIM_PARAM_UPDATE_INTERNAL_SIMULATION_FLAGS = 64 ,
SIM_PARAM_UPDATE_USE_SPLIT_IMPULSE = 128 ,
SIM_PARAM_UPDATE_SPLIT_IMPULSE_PENETRATION_THRESHOLD = 256 ,
2015-07-22 04:46:28 +00:00
} ;
2016-11-01 23:45:10 +00:00
enum EnumLoadBunnyUpdateFlags
{
LOAD_BUNNY_UPDATE_SCALE = 1 ,
LOAD_BUNNY_UPDATE_MASS = 2 ,
LOAD_BUNNY_UPDATE_COLLISION_MARGIN = 4
} ;
2016-10-23 14:14:50 +00:00
enum EnumSimParamInternalSimFlags
{
SIM_PARAM_INTERNAL_CREATE_ROBOT_ASSETS = 1 ,
} ;
2015-07-22 04:46:28 +00:00
///Controlling a robot involves sending the desired state to its joint motor controllers.
///The control mode determines the state variables used for motor control.
struct SendPhysicsSimulationParameters
{
double m_deltaTime ;
double m_gravityAcceleration [ 3 ] ;
int m_numSimulationSubSteps ;
int m_numSolverIterations ;
2016-07-18 06:50:11 +00:00
bool m_allowRealTimeSimulation ;
2016-12-01 06:24:20 +00:00
int m_useSplitImpulse ;
double m_splitImpulsePenetrationThreshold ;
2016-10-23 14:14:50 +00:00
int m_internalSimFlags ;
2016-09-08 22:15:58 +00:00
double m_defaultContactERP ;
2015-07-22 04:46:28 +00:00
} ;
2016-11-01 23:45:10 +00:00
struct LoadBunnyArgs
{
double m_scale ;
double m_mass ;
double m_collisionMargin ;
} ;
2015-06-21 20:24:36 +00:00
struct RequestActualStateArgs
{
int m_bodyUniqueId ;
} ;
2015-06-22 22:30:57 +00:00
2015-06-21 20:24:36 +00:00
struct SendActualStateArgs
{
int m_bodyUniqueId ;
int m_numDegreeOfFreedomQ ;
int m_numDegreeOfFreedomU ;
2015-07-15 22:23:40 +00:00
2015-09-03 21:18:22 +00:00
double m_rootLocalInertialFrame [ 7 ] ;
2015-07-15 22:23:40 +00:00
//actual state is only written by the server, read-only access by client is expected
double m_actualStateQ [ MAX_DEGREE_OF_FREEDOM ] ;
double m_actualStateQdot [ MAX_DEGREE_OF_FREEDOM ] ;
2015-08-02 21:00:43 +00:00
//measured 6DOF force/torque sensors: force[x,y,z] and torque[x,y,z]
double m_jointReactionForces [ 6 * MAX_DEGREE_OF_FREEDOM ] ;
2016-04-09 01:17:17 +00:00
double m_jointMotorForce [ MAX_DEGREE_OF_FREEDOM ] ;
2016-04-29 21:45:15 +00:00
2016-04-24 00:29:46 +00:00
double m_linkState [ 7 * MAX_NUM_LINKS ] ;
2016-04-29 21:45:15 +00:00
double m_linkLocalInertialFrames [ 7 * MAX_NUM_LINKS ] ;
2015-06-21 20:24:36 +00:00
} ;
2015-09-03 21:18:22 +00:00
enum EnumSensorTypes
{
SENSOR_FORCE_TORQUE = 1 ,
2015-10-18 01:52:48 +00:00
SENSOR_IMU = 2 ,
2015-09-03 21:18:22 +00:00
} ;
2015-08-02 21:00:43 +00:00
struct CreateSensorArgs
{
int m_bodyUniqueId ;
int m_numJointSensorChanges ;
2015-09-03 21:18:22 +00:00
int m_sensorType [ MAX_DEGREE_OF_FREEDOM ] ;
///todo: clean up the duplication, make sure no-one else is using those members directly (use C-API header instead)
2015-08-02 21:00:43 +00:00
int m_jointIndex [ MAX_DEGREE_OF_FREEDOM ] ;
int m_enableJointForceSensor [ MAX_DEGREE_OF_FREEDOM ] ;
2015-09-03 21:18:22 +00:00
int m_linkIndex [ MAX_DEGREE_OF_FREEDOM ] ;
int m_enableSensor [ MAX_DEGREE_OF_FREEDOM ] ;
2015-08-02 21:00:43 +00:00
} ;
2015-06-21 20:24:36 +00:00
2015-07-23 18:51:25 +00:00
typedef struct SharedMemoryCommand SharedMemoryCommand_t ;
2015-06-22 22:30:57 +00:00
2015-08-02 21:00:43 +00:00
enum EnumBoxShapeFlags
{
BOX_SHAPE_HAS_INITIAL_POSITION = 1 ,
BOX_SHAPE_HAS_INITIAL_ORIENTATION = 2 ,
2015-10-27 21:55:46 +00:00
BOX_SHAPE_HAS_HALF_EXTENTS = 4 ,
BOX_SHAPE_HAS_MASS = 8 ,
BOX_SHAPE_HAS_COLLISION_SHAPE_TYPE = 16 ,
2015-11-07 01:11:15 +00:00
BOX_SHAPE_HAS_COLOR = 32 ,
2015-08-02 21:00:43 +00:00
} ;
///This command will be replaced to allow arbitrary collision shape types
struct CreateBoxShapeArgs
{
double m_halfExtentsX ;
double m_halfExtentsY ;
double m_halfExtentsZ ;
2015-10-27 21:55:46 +00:00
double m_mass ;
int m_collisionShapeType ; //see SharedMemoryPublic.h
2015-08-02 21:00:43 +00:00
double m_initialPosition [ 3 ] ;
double m_initialOrientation [ 4 ] ;
2015-11-07 01:11:15 +00:00
double m_colorRGBA [ 4 ] ;
2015-08-02 21:00:43 +00:00
} ;
2015-06-21 20:24:36 +00:00
2016-06-13 17:11:28 +00:00
struct SdfLoadedArgs
{
int m_numBodies ;
int m_bodyUniqueIds [ MAX_SDF_BODIES ] ;
///@todo(erwincoumans) load cameras, lights etc
//int m_numCameras;
//int m_numLights;
} ;
struct SdfRequestInfoArgs
{
2016-06-15 01:41:19 +00:00
int m_bodyUniqueId ;
2016-06-13 17:11:28 +00:00
} ;
2016-06-27 01:18:30 +00:00
///flags for b3ApplyExternalTorque and b3ApplyExternalForce
enum EnumExternalForcePrivateFlags
{
// EF_LINK_FRAME=1,
// EF_WORLD_FRAME=2,
EF_TORQUE = 4 ,
EF_FORCE = 8 ,
} ;
struct ExternalForceArgs
{
int m_numForcesAndTorques ;
int m_bodyUniqueIds [ MAX_SDF_BODIES ] ;
int m_linkIds [ MAX_SDF_BODIES ] ;
double m_forcesAndTorques [ 3 * MAX_SDF_BODIES ] ;
double m_positions [ 3 * MAX_SDF_BODIES ] ;
int m_forceFlags [ MAX_SDF_BODIES ] ;
} ;
2016-06-13 17:11:28 +00:00
enum EnumSdfRequestInfoFlags
{
SDF_REQUEST_INFO_BODY = 1 ,
//SDF_REQUEST_INFO_CAMERA=2,
} ;
2016-08-10 01:40:12 +00:00
struct CalculateInverseDynamicsArgs
{
int m_bodyUniqueId ;
double m_jointPositionsQ [ MAX_DEGREE_OF_FREEDOM ] ;
double m_jointVelocitiesQdot [ MAX_DEGREE_OF_FREEDOM ] ;
double m_jointAccelerations [ MAX_DEGREE_OF_FREEDOM ] ;
} ;
struct CalculateInverseDynamicsResultArgs
{
int m_bodyUniqueId ;
int m_dofCount ;
double m_jointForces [ MAX_DEGREE_OF_FREEDOM ] ;
} ;
2016-09-07 23:00:38 +00:00
struct CalculateJacobianArgs
{
int m_bodyUniqueId ;
int m_linkIndex ;
double m_localPosition [ 3 ] ;
double m_jointPositionsQ [ MAX_DEGREE_OF_FREEDOM ] ;
double m_jointVelocitiesQdot [ MAX_DEGREE_OF_FREEDOM ] ;
double m_jointAccelerations [ MAX_DEGREE_OF_FREEDOM ] ;
} ;
struct CalculateJacobianResultArgs
{
int m_dofCount ;
double m_linearJacobian [ 3 * MAX_DEGREE_OF_FREEDOM ] ;
double m_angularJacobian [ 3 * MAX_DEGREE_OF_FREEDOM ] ;
} ;
2016-09-13 22:37:46 +00:00
enum EnumCalculateInverseKinematicsFlags
{
2016-09-22 20:27:09 +00:00
IK_HAS_TARGET_POSITION = 1 ,
IK_HAS_TARGET_ORIENTATION = 2 ,
2016-09-30 07:05:00 +00:00
IK_HAS_NULL_SPACE_VELOCITY = 4 ,
//IK_HAS_CURRENT_JOINT_POSITIONS=8,//not used yet
2016-09-13 22:37:46 +00:00
} ;
2016-09-08 22:15:58 +00:00
struct CalculateInverseKinematicsArgs
{
int m_bodyUniqueId ;
2016-09-13 22:37:46 +00:00
// double m_jointPositionsQ[MAX_DEGREE_OF_FREEDOM];
2016-09-08 22:15:58 +00:00
double m_targetPosition [ 3 ] ;
2016-09-20 00:04:05 +00:00
double m_targetOrientation [ 4 ] ; //orientation represented as quaternion, x,y,z,w
2016-09-22 20:27:09 +00:00
int m_endEffectorLinkIndex ;
2016-09-30 07:05:00 +00:00
double m_lowerLimit [ MAX_DEGREE_OF_FREEDOM ] ;
double m_upperLimit [ MAX_DEGREE_OF_FREEDOM ] ;
double m_jointRange [ MAX_DEGREE_OF_FREEDOM ] ;
2016-09-30 08:03:40 +00:00
double m_restPose [ MAX_DEGREE_OF_FREEDOM ] ;
2016-09-08 22:15:58 +00:00
} ;
struct CalculateInverseKinematicsResultArgs
{
int m_bodyUniqueId ;
int m_dofCount ;
double m_jointPositions [ MAX_DEGREE_OF_FREEDOM ] ;
} ;
2016-11-14 22:08:05 +00:00
enum EnumUserConstraintFlags
{
USER_CONSTRAINT_ADD_CONSTRAINT = 1 ,
USER_CONSTRAINT_REMOVE_CONSTRAINT = 2 ,
USER_CONSTRAINT_CHANGE_CONSTRAINT = 4
} ;
struct UserConstraintArgs
2016-08-23 01:14:29 +00:00
{
int m_parentBodyIndex ;
int m_parentJointIndex ;
int m_childBodyIndex ;
int m_childJointIndex ;
double m_parentFrame [ 7 ] ;
double m_childFrame [ 7 ] ;
double m_jointAxis [ 3 ] ;
2016-08-26 17:35:10 +00:00
int m_jointType ;
2016-11-14 22:08:05 +00:00
int m_userConstraintUniqueId ;
2016-08-23 01:14:29 +00:00
} ;
2016-11-14 22:08:05 +00:00
struct UserConstraintResultArgs
{
int m_userConstraintUniqueId ;
} ;
2016-11-14 15:39:34 +00:00
enum EnumUserDebugDrawFlags
{
USER_DEBUG_HAS_LINE = 1 ,
USER_DEBUG_HAS_TEXT = 2 ,
USER_DEBUG_REMOVE_ONE_ITEM = 4 ,
2016-11-21 15:42:11 +00:00
USER_DEBUG_REMOVE_ALL = 8 ,
USER_DEBUG_SET_CUSTOM_OBJECT_COLOR = 16 ,
USER_DEBUG_REMOVE_CUSTOM_OBJECT_COLOR = 32 ,
2016-11-14 15:39:34 +00:00
} ;
struct UserDebugDrawArgs
{
double m_debugLineFromXYZ [ 3 ] ;
double m_debugLineToXYZ [ 3 ] ;
double m_debugLineColorRGB [ 3 ] ;
double m_lineWidth ;
double m_lifeTime ;
int m_removeItemUniqueId ;
char m_text [ MAX_FILENAME_LENGTH ] ;
double m_textPositionXYZ [ 3 ] ;
double m_textColorRGB [ 3 ] ;
double m_textSize ;
2016-11-21 15:42:11 +00:00
double m_objectDebugColorRGB [ 3 ] ;
int m_objectUniqueId ;
int m_linkIndex ;
2016-11-14 15:39:34 +00:00
} ;
struct UserDebugDrawResultArgs
{
int m_debugItemUniqueId ;
} ;
2017-01-06 01:41:58 +00:00
struct SendVREvents
{
int m_numVRControllerEvents ;
b3VRControllerEvent m_controllerEvents [ MAX_VR_CONTROLLERS ] ;
} ;
enum eVRCameraEnums
{
VR_CAMERA_ROOT_POSITION = 1 ,
VR_CAMERA_ROOT_ORIENTATION = 2 ,
VR_CAMERA_ROOT_TRACKING_OBJECT = 4
} ;
struct VRCameraState
{
double m_rootPosition [ 3 ] ;
double m_rootOrientation [ 4 ] ;
int m_trackingObjectUniqueId ;
} ;
2016-11-14 15:39:34 +00:00
2015-06-21 20:24:36 +00:00
struct SharedMemoryCommand
{
2015-07-23 18:51:25 +00:00
int m_type ;
smUint64_t m_timeStamp ;
2015-07-15 22:23:40 +00:00
int m_sequenceNumber ;
2015-07-31 06:22:44 +00:00
//m_updateFlags is a bit fields to tell which parameters need updating
//for example m_updateFlags = SIM_PARAM_UPDATE_DELTA_TIME | SIM_PARAM_UPDATE_NUM_SOLVER_ITERATIONS;
int m_updateFlags ;
2015-07-15 22:23:40 +00:00
2015-06-21 20:24:36 +00:00
union
{
2015-07-23 18:51:25 +00:00
struct UrdfArgs m_urdfArguments ;
2016-06-04 02:03:56 +00:00
struct SdfArgs m_sdfArguments ;
2016-12-31 22:43:15 +00:00
struct MjcfArgs m_mjcfArguments ;
2016-11-12 02:07:42 +00:00
struct FileArgs m_fileArguments ;
2016-06-13 17:11:28 +00:00
struct SdfRequestInfoArgs m_sdfRequestInfoArgs ;
2015-07-31 06:22:44 +00:00
struct InitPoseArgs m_initPoseArgs ;
struct SendPhysicsSimulationParameters m_physSimParamArgs ;
struct BulletDataStreamArgs m_dataStreamArguments ;
struct SendDesiredStateArgs m_sendDesiredStateCommandArgument ;
struct RequestActualStateArgs m_requestActualStateInformationCommandArgument ;
2015-08-02 21:00:43 +00:00
struct CreateSensorArgs m_createSensorArguments ;
struct CreateBoxShapeArgs m_createBoxShapeArguments ;
2015-08-20 05:51:16 +00:00
struct RequestDebugLinesArgs m_requestDebugLinesArguments ;
2016-05-31 17:23:04 +00:00
struct RequestPixelDataArgs m_requestPixelDataArguments ;
2015-09-25 05:42:22 +00:00
struct PickBodyArgs m_pickBodyArguments ;
2016-06-27 01:18:30 +00:00
struct ExternalForceArgs m_externalForceArguments ;
2016-08-10 01:40:12 +00:00
struct CalculateInverseDynamicsArgs m_calculateInverseDynamicsArguments ;
2016-09-07 23:00:38 +00:00
struct CalculateJacobianArgs m_calculateJacobianArguments ;
2016-11-14 22:08:05 +00:00
struct UserConstraintArgs m_userConstraintArguments ;
2016-09-01 20:30:07 +00:00
struct RequestContactDataArgs m_requestContactPointArguments ;
2016-11-10 19:22:22 +00:00
struct RequestOverlappingObjectsArgs m_requestOverlappingObjectsArgs ;
2016-10-19 05:05:28 +00:00
struct RequestVisualShapeDataArgs m_requestVisualShapeDataArguments ;
2016-10-21 06:40:30 +00:00
struct UpdateVisualShapeDataArgs m_updateVisualShapeDataArguments ;
struct LoadTextureArgs m_loadTextureArguments ;
2016-09-08 22:15:58 +00:00
struct CalculateInverseKinematicsArgs m_calculateInverseKinematicsArguments ;
2016-11-14 15:39:34 +00:00
struct UserDebugDrawArgs m_userDebugDrawArgs ;
2016-12-27 03:40:09 +00:00
struct RequestRaycastIntersections m_requestRaycastIntersections ;
2016-11-01 23:45:10 +00:00
struct LoadBunnyArgs m_loadBunnyArguments ;
2017-01-06 01:41:58 +00:00
struct VRCameraState m_vrCameraStateArguments ;
2015-06-21 20:24:36 +00:00
} ;
} ;
2015-10-27 22:46:13 +00:00
struct RigidBodyCreateArgs
{
int m_bodyUniqueId ;
} ;
2015-07-22 04:46:28 +00:00
2016-09-01 20:30:07 +00:00
struct SendContactDataArgs
{
int m_startingContactPointIndex ;
int m_numContactPointsCopied ;
int m_numRemainingContactPoints ;
} ;
2016-11-10 19:22:22 +00:00
struct SendOverlappingObjectsArgs
{
int m_startingOverlappingObjectIndex ;
int m_numOverlappingObjectsCopied ;
int m_numRemainingOverlappingObjects ;
} ;
2017-01-06 01:41:58 +00:00
2016-12-27 03:40:09 +00:00
2015-07-22 04:46:28 +00:00
struct SharedMemoryStatus
{
int m_type ;
smUint64_t m_timeStamp ;
int m_sequenceNumber ;
2016-11-04 20:15:10 +00:00
//m_streamBytes is only for internal purposes
int m_numDataStreamBytes ;
char * m_dataStream ;
2015-07-22 04:46:28 +00:00
union
{
2015-07-23 18:51:25 +00:00
struct BulletDataStreamArgs m_dataStreamArguments ;
2016-06-13 17:11:28 +00:00
struct SdfLoadedArgs m_sdfLoadedArgs ;
2015-07-23 18:51:25 +00:00
struct SendActualStateArgs m_sendActualStateArgs ;
2015-08-20 05:51:16 +00:00
struct SendDebugLinesArgs m_sendDebugLinesArgs ;
2016-05-31 17:23:04 +00:00
struct SendPixelDataArgs m_sendPixelDataArguments ;
2015-10-27 22:46:13 +00:00
struct RigidBodyCreateArgs m_rigidBodyCreateArgs ;
2016-08-10 01:40:12 +00:00
struct CalculateInverseDynamicsResultArgs m_inverseDynamicsResultArgs ;
2016-09-07 23:00:38 +00:00
struct CalculateJacobianResultArgs m_jacobianResultArgs ;
2016-09-01 20:30:07 +00:00
struct SendContactDataArgs m_sendContactPointArgs ;
2016-11-10 19:22:22 +00:00
struct SendOverlappingObjectsArgs m_sendOverlappingObjectsArgs ;
2016-09-08 22:15:58 +00:00
struct CalculateInverseKinematicsResultArgs m_inverseKinematicsResultArgs ;
2016-10-19 05:05:28 +00:00
struct SendVisualShapeDataArgs m_sendVisualShapeArgs ;
2016-11-14 15:39:34 +00:00
struct UserDebugDrawResultArgs m_userDebugDrawArgs ;
2016-11-14 22:08:05 +00:00
struct UserConstraintResultArgs m_userConstraintResultArgs ;
2016-12-27 03:40:09 +00:00
struct SendVREvents m_sendVREvents ;
struct SendRaycastHits m_raycastHits ;
2015-07-22 04:46:28 +00:00
} ;
} ;
2015-07-31 06:22:44 +00:00
typedef struct SharedMemoryStatus SharedMemoryStatus_t ;
2015-06-21 20:24:36 +00:00
2015-08-02 21:00:43 +00:00
2015-06-21 20:24:36 +00:00
# endif //SHARED_MEMORY_COMMANDS_H