38 #include <visp3/core/vpConfig.h>
40 #if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD))
41 #include <visp3/robot/vpRobotWireFrameSimulator.h>
42 #include <visp3/robot/vpSimulatorViper850.h>
49 I(), tcur(0), tprev(0), robotArms(NULL), size_fMi(8), fMi(NULL), artCoord(), artVel(), velocity(),
51 #elif defined(VISP_HAVE_PTHREAD)
54 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(),
55 displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true),
57 #if defined(VISP_HAVE_DISPLAY)
60 displayType(MODEL_3D), displayAllowed(true), constantSamplingTimeMode(false),
61 setVelocityCalled(false), verbose_(false)
67 #if defined(VISP_HAVE_DISPLAY)
81 I(), tcur(0), tprev(0), robotArms(NULL), size_fMi(8), fMi(NULL), artCoord(), artVel(), velocity(),
83 #elif defined(VISP_HAVE_PTHREAD)
86 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(),
87 displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true),
89 #if defined(VISP_HAVE_DISPLAY)
92 displayType(MODEL_3D), displayAllowed(do_display), constantSamplingTimeMode(false),
93 setVelocityCalled(false), verbose_(false)
100 #if defined(VISP_HAVE_DISPLAY)
131 free_Bound_scene (&(this->
camera));
135 free_Bound_scene (&(this->
camera));
154 free_Bound_scene (&(this->
camera));
158 free_Bound_scene (&(this->
camera));
175 free_Bound_scene (&(this->
camera));
179 free_Bound_scene (&(this->
camera));
196 free_Bound_scene (&(this->
camera));
200 free_Bound_scene (&(this->
camera));
237 float o44c[4][4],o44cd[4][4],x,y,z;
238 Matrix
id = IDENTITY_MATRIX;
245 vp2jlc_matrix(cMo.inverse(),o44c);
250 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
251 x = o44c[2][0] + o44c[3][0];
252 y = o44c[2][1] + o44c[3][1];
253 z = o44c[2][2] + o44c[3][2];
254 add_vwstack (
"start",
"vrp", x,y,z);
255 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
256 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
257 add_vwstack (
"start",
"window", -u, u, -v, v);
261 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
262 x = o44cd[2][0] + o44cd[3][0];
263 y = o44cd[2][1] + o44cd[3][1];
264 z = o44cd[2][2] + o44cd[3][2];
265 add_vwstack (
"start",
"vrp", x,y,z);
266 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
267 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
268 add_vwstack (
"start",
"window", -u, u, -v, v);
310 float o44c[4][4],o44cd[4][4],x,y,z;
311 Matrix
id = IDENTITY_MATRIX;
318 vp2jlc_matrix(cMo.inverse(),o44c);
323 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
324 x = o44c[2][0] + o44c[3][0];
325 y = o44c[2][1] + o44c[3][1];
326 z = o44c[2][2] + o44c[3][2];
327 add_vwstack (
"start",
"vrp", x,y,z);
328 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
329 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
330 add_vwstack (
"start",
"window", -u, u, -v, v);
336 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
337 x = o44cd[2][0] + o44cd[3][0];
338 y = o44cd[2][1] + o44cd[3][1];
339 z = o44cd[2][2] + o44cd[3][2];
340 add_vwstack (
"start",
"vrp", x,y,z);
341 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
342 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
343 add_vwstack (
"start",
"window", -u, u, -v, v);
369 #elif !defined(VISP_BUILD_SHARED_LIBS)
371 void dummy_vpRobotWireFrameSimulator() {};
virtual void get_fMi(vpHomogeneousMatrix *fMit)=0
VISP_EXPORT int wait(double t0, double t)
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
unsigned int getWidth() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
A cylindrical tool is attached to the camera.
vpRobotWireFrameSimulator()
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)