39 #ifndef vpRobotWireFrameSimulator_HH 40 #define vpRobotWireFrameSimulator_HH 47 #include <visp3/core/vpConfig.h> 49 #if defined(VISP_HAVE_MODULE_GUI) && ((defined(_WIN32) && !defined(WINRT_8_0)) || defined(VISP_HAVE_PTHREAD)) 58 #elif defined(VISP_HAVE_PTHREAD) 62 #include <visp3/gui/vpDisplayD3D.h> 63 #include <visp3/gui/vpDisplayGDI.h> 64 #include <visp3/gui/vpDisplayGTK.h> 65 #include <visp3/gui/vpDisplayOpenCV.h> 66 #include <visp3/gui/vpDisplayX.h> 67 #include <visp3/robot/vpRobot.h> 68 #include <visp3/robot/vpRobotSimulator.h> 69 #include <visp3/robot/vpWireFrameSimulator.h> 125 HANDLE mutex_artCoord;
126 HANDLE mutex_velocity;
127 HANDLE mutex_display;
128 #elif defined(VISP_HAVE_PTHREAD) 152 #if defined VISP_HAVE_X11 154 #elif defined VISP_HAVE_GDI 156 #elif defined VISP_HAVE_OPENCV 158 #elif defined VISP_HAVE_D3D9 160 #elif defined VISP_HAVE_GTK 226 if ((std::fabs(px_ext - 1.) >
vpMath::maximum(px_ext, 1.) * std::numeric_limits<double>::epsilon()) &&
227 (std::fabs(py_ext - 1) >
vpMath::maximum(py_ext, 1.) * std::numeric_limits<double>::epsilon()))
259 void initScene(
const char *obj,
const char *desiredObject);
281 constantSamplingTimeMode = _constantSamplingTimeMode;
348 this->delta_t_ = delta_t;
375 static DWORD WINAPI launcher(LPVOID lpParam)
380 #elif defined(VISP_HAVE_PTHREAD) 393 virtual void updateArticularPosition() = 0;
395 virtual int isInJointLimit() = 0;
398 virtual void computeArticularVelocity() = 0;
402 virtual void initArms() = 0;
407 #if defined(WINRT_8_1) 408 WaitForSingleObjectEx(mutex_artCoord, INFINITE, FALSE);
410 WaitForSingleObject(mutex_artCoord, INFINITE);
413 artCoordTmp = artCoord;
414 ReleaseMutex(mutex_artCoord);
419 #if defined(WINRT_8_1) 420 WaitForSingleObjectEx(mutex_artCoord, INFINITE, FALSE);
422 WaitForSingleObject(mutex_artCoord, INFINITE);
425 ReleaseMutex(mutex_artCoord);
430 #if defined(WINRT_8_1) 431 WaitForSingleObjectEx(mutex_artVel, INFINITE, FALSE);
433 WaitForSingleObject(mutex_artVel, INFINITE);
436 ReleaseMutex(mutex_artVel);
441 #if defined(WINRT_8_1) 442 WaitForSingleObjectEx(mutex_artVel, INFINITE, FALSE);
444 WaitForSingleObject(mutex_artVel, INFINITE);
447 ReleaseMutex(mutex_artVel);
452 #if defined(WINRT_8_1) 453 WaitForSingleObjectEx(mutex_velocity, INFINITE, FALSE);
455 WaitForSingleObject(mutex_velocity, INFINITE);
458 ReleaseMutex(mutex_velocity);
463 #if defined(WINRT_8_1) 464 WaitForSingleObjectEx(mutex_velocity, INFINITE, FALSE);
466 WaitForSingleObject(mutex_velocity, INFINITE);
469 ReleaseMutex(mutex_velocity);
472 void set_displayBusy(
const bool &status)
474 #if defined(WINRT_8_1) 475 WaitForSingleObjectEx(mutex_display, INFINITE, FALSE);
477 WaitForSingleObject(mutex_display, INFINITE);
479 displayBusy = status;
480 ReleaseMutex(mutex_display);
482 bool get_displayBusy()
484 #if defined(WINRT_8_1) 485 WaitForSingleObjectEx(mutex_display, INFINITE, FALSE);
487 WaitForSingleObject(mutex_display, INFINITE);
489 bool status = displayBusy;
492 ReleaseMutex(mutex_display);
496 #elif defined(VISP_HAVE_PTHREAD) 499 pthread_mutex_lock(&mutex_artCoord);
501 artCoordTmp = artCoord;
502 pthread_mutex_unlock(&mutex_artCoord);
507 pthread_mutex_lock(&mutex_artCoord);
509 pthread_mutex_unlock(&mutex_artCoord);
514 pthread_mutex_lock(&mutex_artVel);
516 pthread_mutex_unlock(&mutex_artVel);
521 pthread_mutex_lock(&mutex_artVel);
523 pthread_mutex_unlock(&mutex_artVel);
528 pthread_mutex_lock(&mutex_velocity);
530 pthread_mutex_unlock(&mutex_velocity);
535 pthread_mutex_lock(&mutex_velocity);
537 pthread_mutex_unlock(&mutex_velocity);
542 pthread_mutex_lock(&mutex_display);
543 displayBusy = status;
544 pthread_mutex_unlock(&mutex_display);
548 pthread_mutex_lock(&mutex_display);
549 bool status = displayBusy;
552 pthread_mutex_unlock(&mutex_display);
void setCurrentViewColor(const vpColor &col)
void setDisplayRobotType(const vpDisplayRobotType dispType)
vpColVector get_artCoord()
vpHomogeneousMatrix getExternalCameraPosition() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
unsigned int jointLimitArt
static void * launcher(void *arg)
Display for windows using GDI (available on any windows 32 platform).
Class to define colors available for display functionnalities.
void set_fMo(const vpHomogeneousMatrix &fMo_)
void setDesiredViewColor(const vpColor &col)
bool constantSamplingTimeMode
bool singularityManagement
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
vpColVector get_velocity()
void setGraphicsThickness(unsigned int thickness)
void setExternalCameraPosition(const vpHomogeneousMatrix &cam_Mf)
void setDesiredCameraPosition(const vpHomogeneousMatrix &cdMo_)
void setCameraColor(const vpColor &col)
vpHomogeneousMatrix get_fMo() const
static Type maximum(const Type &a, const Type &b)
pthread_mutex_t mutex_artCoord
vpCameraParameters getExternalCameraParameters() const
pthread_mutex_t mutex_display
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed...
vpHomogeneousMatrix get_cMo() const
vpDisplayRobotType displayType
This class aims to be a basis used to create all the robot simulators.
vpCameraParameters cameraParam
void setDesiredCameraPosition(const vpHomogeneousMatrix &cdMo_)
void set_displayBusy(const bool &status)
void setExternalCameraPosition(const vpHomogeneousMatrix &camMf_)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
void setSamplingTime(const double &delta_t)
Generic class defining intrinsic camera parameters.
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
static Type minimum(const Type &a, const Type &b)
void set_velocity(const vpColVector &vel)
Implementation of a wire frame simulator. Compared to the vpSimulator class, it does not require thir...
This class aims to be a basis used to create all the simulators of robots.
vpHomogeneousMatrix * fMi
pthread_mutex_t mutex_fMi
void setVerbose(bool verbose)
unsigned int getHeight() const
Implementation of column vector and the associated operations.
void setSingularityManagement(bool sm)
void setConstantSamplingTimeMode(const bool _constantSamplingTimeMode)
void set_artCoord(const vpColVector &coord)
VISP_EXPORT double getMinTimeForUsleepCall()
void set_artVel(const vpColVector &vel)
unsigned int getWidth() const
pthread_mutex_t mutex_velocity
pthread_mutex_t mutex_artVel
vpHomogeneousMatrix getExternalCameraPosition() const