64 const std::string& type ) :
65 Model( world, parent, type ),
129 char* paddles = NULL;
133 if( paddles && strcmp( paddles,
"closed" ) == 0 )
139 if( paddles && strcmp( paddles,
"open" ) == 0 )
145 if( lift && strcmp( lift,
"up" ) == 0 )
151 if( lift && strcmp( lift,
"down" ) == 0 )
266 printf(
"unknown gripper command %d\n",
cmd );
362 for(
unsigned int index=0; index < 2; index++ )
484 double puckw = hitgeom.
size.
y;
507 glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
540 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
virtual void PushColor(Color col)
bool autosnatch
if true, cycle the gripper through open-close-up-down automatically
ModelGripper(World *world, Model *parent, const std::string &type)
int subs
the number of subscriptions to this model
The Stage library uses its own namespace.
Block * AddBlockRect(meters_t x, meters_t y, meters_t dx, meters_t dy, meters_t dz)
void SetPose(const Pose &pose)
double lift_position
0.0 = full down, 1.0 full up
int ReadTuple(const int entity, const char *name, const unsigned int first, const unsigned int num, const char *format,...)
RaytraceResult Raytrace(const Pose &pose, const meters_t range, const ray_test_func_t func, const void *arg, const bool ztest=true)
meters_t z
location in 3 axes
void WriteTuple(const int entity, const char *name, const unsigned int first, const unsigned int count, const char *format,...)
void RegisterOption(Option *opt)
void draw_centered_rect(float x, float y, float dx, float dy)
Size paddle_size
paddle dimensions
Pose GetGlobalPose() const
Model * beam[2]
points to a model detected by the beams
virtual void DataVisualize(Camera *cam)
void SetCenterY(double y)
static bool gripper_raytrace_match(Model *hit, Model *finder, const void *dummy)
int SetParent(Model *newparent)
void SetZ(double min, double max)
Model * contact[2]
pointers to a model detected by the contacts
double close_limit
How far the gripper can close. If < 1.0, the gripper has its mouth full.
class Stg::Model::Visibility vis
double break_beam_inset[2]
distance from the end of the paddle
int ReadInt(int entity, const char *name, int value)
void SetGeom(const Geom &src)
radians_t a
rotation about the z axis.
uint64_t GetUpdateCount() const
double paddle_position
0.0 = full open, 1.0 full closed
Model * mod
the model struck by this beam