39 #include <visp3/core/vpConfig.h> 41 #if defined(VISP_HAVE_MODULE_GUI) && ((defined(_WIN32) && !defined(WINRT_8_0)) || defined(VISP_HAVE_PTHREAD)) 42 #include <visp3/robot/vpRobotWireFrameSimulator.h> 43 #include <visp3/robot/vpSimulatorViper850.h> 45 #include "../wireframe-simulator/vpBound.h" 46 #include "../wireframe-simulator/vpScene.h" 47 #include "../wireframe-simulator/vpVwstack.h" 54 artCoord(), artVel(), velocity(),
56 #elif defined(VISP_HAVE_PTHREAD)
59 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(), displayBusy(false),
60 robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true), cameraParam(),
61 #if defined(VISP_HAVE_DISPLAY)
64 displayType(MODEL_3D), displayAllowed(true), constantSamplingTimeMode(false), setVelocityCalled(false),
71 #if defined(VISP_HAVE_DISPLAY) 87 #elif defined(VISP_HAVE_PTHREAD)
93 #if defined(VISP_HAVE_DISPLAY)
104 #if defined(VISP_HAVE_DISPLAY) 135 free_Bound_scene(&(this->
camera));
139 free_Bound_scene(&(this->
camera));
158 free_Bound_scene(&(this->
camera));
162 free_Bound_scene(&(this->
camera));
182 free_Bound_scene(&(this->
camera));
186 free_Bound_scene(&(this->
camera));
204 free_Bound_scene(&(this->
camera));
208 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);
257 add_vwstack(
"start",
"cop", o44c[3][0], o44c[3][1], o44c[3][2]);
258 x = o44c[2][0] + o44c[3][0];
259 y = o44c[2][1] + o44c[3][1];
260 z = o44c[2][2] + o44c[3][2];
261 add_vwstack(
"start",
"vrp", x, y, z);
262 add_vwstack(
"start",
"vpn", o44c[2][0], o44c[2][1], o44c[2][2]);
263 add_vwstack(
"start",
"vup", o44c[1][0], o44c[1][1], o44c[1][2]);
264 add_vwstack(
"start",
"window", -u, u, -v, v);
268 add_vwstack(
"start",
"cop", o44cd[3][0], o44cd[3][1], o44cd[3][2]);
269 x = o44cd[2][0] + o44cd[3][0];
270 y = o44cd[2][1] + o44cd[3][1];
271 z = o44cd[2][2] + o44cd[3][2];
272 add_vwstack(
"start",
"vrp", x, y, z);
273 add_vwstack(
"start",
"vpn", o44cd[2][0], o44cd[2][1], o44cd[2][2]);
274 add_vwstack(
"start",
"vup", o44cd[1][0], o44cd[1][1], o44cd[1][2]);
275 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);
330 add_vwstack(
"start",
"cop", o44c[3][0], o44c[3][1], o44c[3][2]);
331 x = o44c[2][0] + o44c[3][0];
332 y = o44c[2][1] + o44c[3][1];
333 z = o44c[2][2] + o44c[3][2];
334 add_vwstack(
"start",
"vrp", x, y, z);
335 add_vwstack(
"start",
"vpn", o44c[2][0], o44c[2][1], o44c[2][2]);
336 add_vwstack(
"start",
"vup", o44c[1][0], o44c[1][1], o44c[1][2]);
337 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);
375 #elif !defined(VISP_BUILD_SHARED_LIBS) 378 void dummy_vpRobotWireFrameSimulator(){};
virtual void get_fMi(vpHomogeneousMatrix *fMit)=0
void init(vpImage< unsigned char > &I, int win_x=-1, int win_y=-1, const std::string &win_title="")
VISP_EXPORT int wait(double t0, double t)
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
void resize(unsigned int h, unsigned int w)
resize the image : Image initialization
Implementation of an homogeneous matrix and operations on such kind of matrices.
unsigned int jointLimitArt
A cylindrical tool is attached to the camera.
bool constantSamplingTimeMode
bool singularityManagement
vpHomogeneousMatrix inverse() const
vpRobotWireFrameSimulator()
static Type maximum(const Type &a, const Type &b)
pthread_mutex_t mutex_artCoord
pthread_mutex_t mutex_display
vpDisplayRobotType displayType
This class aims to be a basis used to create all the robot simulators.
vpCameraParameters cameraParam
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
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
vpHomogeneousMatrix * fMi
pthread_mutex_t mutex_fMi
void resize(unsigned int i, bool flagNullify=true)
void display_scene(Matrix mat, Bound_scene &sc, const vpImage< vpRGBa > &I, const vpColor &color)
unsigned int getHeight() const
unsigned int getWidth() const
pthread_mutex_t mutex_velocity
pthread_mutex_t mutex_artVel