42 #include <visp/vpConfig.h>
46 #if defined(_WIN32) || defined(VISP_HAVE_PTHREAD)
47 #include <visp/vpRobotWireFrameSimulator.h>
48 #include <visp/vpSimulatorViper850.h>
55 I(), tcur(0), tprev(0), robotArms(NULL), size_fMi(8), fMi(NULL), artCoord(), artVel(), velocity(),
57 #elif defined(VISP_HAVE_PTHREAD)
60 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(),
61 displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true),
63 #if defined(VISP_HAVE_DISPLAY)
66 displayType(MODEL_3D), displayAllowed(true), constantSamplingTimeMode(false),
67 setVelocityCalled(false), verbose_(false)
73 #if defined(VISP_HAVE_DISPLAY)
87 I(), tcur(0), tprev(0), robotArms(NULL), size_fMi(8), fMi(NULL), artCoord(), artVel(), velocity(),
89 #elif defined(VISP_HAVE_PTHREAD)
92 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(),
93 displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true),
95 #if defined(VISP_HAVE_DISPLAY)
98 displayType(MODEL_3D), displayAllowed(do_display), constantSamplingTimeMode(false),
99 setVelocityCalled(false), verbose_(false)
106 #if defined(VISP_HAVE_DISPLAY)
137 free_Bound_scene (&(this->
camera));
141 free_Bound_scene (&(this->
camera));
160 free_Bound_scene (&(this->
camera));
164 free_Bound_scene (&(this->
camera));
181 free_Bound_scene (&(this->
camera));
185 free_Bound_scene (&(this->
camera));
202 free_Bound_scene (&(this->
camera));
206 free_Bound_scene (&(this->
camera));
243 float o44c[4][4],o44cd[4][4],x,y,z;
244 Matrix
id = IDENTITY_MATRIX;
251 vp2jlc_matrix(cMo.inverse(),o44c);
256 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
257 x = o44c[2][0] + o44c[3][0];
258 y = o44c[2][1] + o44c[3][1];
259 z = o44c[2][2] + o44c[3][2];
260 add_vwstack (
"start",
"vrp", x,y,z);
261 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
262 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
263 add_vwstack (
"start",
"window", -u, u, -v, v);
267 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
268 x = o44cd[2][0] + o44cd[3][0];
269 y = o44cd[2][1] + o44cd[3][1];
270 z = o44cd[2][2] + o44cd[3][2];
271 add_vwstack (
"start",
"vrp", x,y,z);
272 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
273 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
274 add_vwstack (
"start",
"window", -u, u, -v, v);
316 float o44c[4][4],o44cd[4][4],x,y,z;
317 Matrix
id = IDENTITY_MATRIX;
324 vp2jlc_matrix(cMo.inverse(),o44c);
329 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
330 x = o44c[2][0] + o44c[3][0];
331 y = o44c[2][1] + o44c[3][1];
332 z = o44c[2][2] + o44c[3][2];
333 add_vwstack (
"start",
"vrp", x,y,z);
334 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
335 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
336 add_vwstack (
"start",
"window", -u, u, -v, v);
342 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
343 x = o44cd[2][0] + o44cd[3][0];
344 y = o44cd[2][1] + o44cd[3][1];
345 z = o44cd[2][2] + o44cd[3][2];
346 add_vwstack (
"start",
"vrp", x,y,z);
347 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
348 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
349 add_vwstack (
"start",
"window", -u, u, -v, v);
virtual void get_fMi(vpHomogeneousMatrix *fMit)=0
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
unsigned int getWidth() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
A cylindrical tool is attached to the camera.
vpRobotWireFrameSimulator()
static int wait(double t0, double t)
static Type maximum(const Type &a, const Type &b)
This class aims to be a basis used to create all the robot simulators.
void set_displayBusy(const bool &status)
void setSamplingTime(const double &delta_t)
void getInternalView(vpImage< vpRGBa > &I)
vpHomogeneousMatrix get_cMo()
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
bool displayDesiredObject
void resize(const unsigned int h, const unsigned int w)
set the size of the image without initializing it.
static Type minimum(const Type &a, const Type &b)
Implementation of a wire frame simulator. Compared to the vpSimulator class, it does not require thir...
virtual ~vpRobotWireFrameSimulator()
vpSceneDesiredObject desiredObject
void display_scene(Matrix mat, Bound_scene &sc, const vpImage< vpRGBa > &I, const vpColor &color)
vpHomogeneousMatrix inverse() const
unsigned int getHeight() const
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const char *title=NULL)
void resize(const unsigned int i, const bool flagNullify=true)