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(),
56 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(),
57 displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true),
59 #if defined(VISP_HAVE_DISPLAY)
62 displayType(MODEL_3D), displayAllowed(true), constantSamplingTimeMode(false),
63 setVelocityCalled(false), verbose_(false)
69 #if defined(VISP_HAVE_DISPLAY)
83 I(), tcur(0), tprev(0), robotArms(NULL), size_fMi(8), fMi(NULL), artCoord(), artVel(), velocity(),
84 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(),
85 displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true),
87 #if defined(VISP_HAVE_DISPLAY)
90 displayType(MODEL_3D), displayAllowed(do_display), constantSamplingTimeMode(false),
91 setVelocityCalled(false), verbose_(false)
98 #if defined(VISP_HAVE_DISPLAY)
129 free_Bound_scene (&(this->
camera));
133 free_Bound_scene (&(this->
camera));
152 free_Bound_scene (&(this->
camera));
156 free_Bound_scene (&(this->
camera));
173 free_Bound_scene (&(this->
camera));
177 free_Bound_scene (&(this->
camera));
194 free_Bound_scene (&(this->
camera));
198 free_Bound_scene (&(this->
camera));
235 float o44c[4][4],o44cd[4][4],x,y,z;
236 Matrix
id = IDENTITY_MATRIX;
243 vp2jlc_matrix(cMo.inverse(),o44c);
248 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
249 x = o44c[2][0] + o44c[3][0];
250 y = o44c[2][1] + o44c[3][1];
251 z = o44c[2][2] + o44c[3][2];
252 add_vwstack (
"start",
"vrp", x,y,z);
253 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
254 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
255 add_vwstack (
"start",
"window", -u, u, -v, v);
259 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
260 x = o44cd[2][0] + o44cd[3][0];
261 y = o44cd[2][1] + o44cd[3][1];
262 z = o44cd[2][2] + o44cd[3][2];
263 add_vwstack (
"start",
"vrp", x,y,z);
264 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
265 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
266 add_vwstack (
"start",
"window", -u, u, -v, v);
308 float o44c[4][4],o44cd[4][4],x,y,z;
309 Matrix
id = IDENTITY_MATRIX;
316 vp2jlc_matrix(cMo.inverse(),o44c);
321 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
322 x = o44c[2][0] + o44c[3][0];
323 y = o44c[2][1] + o44c[3][1];
324 z = o44c[2][2] + o44c[3][2];
325 add_vwstack (
"start",
"vrp", x,y,z);
326 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
327 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
328 add_vwstack (
"start",
"window", -u, u, -v, v);
334 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
335 x = o44cd[2][0] + o44cd[3][0];
336 y = o44cd[2][1] + o44cd[3][1];
337 z = o44cd[2][2] + o44cd[3][2];
338 add_vwstack (
"start",
"vrp", x,y,z);
339 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
340 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
341 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
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)