39 #ifndef vpRobotWireFrameSimulator_HH
40 #define vpRobotWireFrameSimulator_HH
42 #include <visp3/core/vpConfig.h>
44 #if defined(VISP_HAVE_MODULE_GUI) && defined(VISP_HAVE_THREADS)
52 #include <visp3/gui/vpDisplayD3D.h>
53 #include <visp3/gui/vpDisplayGDI.h>
54 #include <visp3/gui/vpDisplayGTK.h>
55 #include <visp3/gui/vpDisplayOpenCV.h>
56 #include <visp3/gui/vpDisplayX.h>
57 #include <visp3/robot/vpRobot.h>
58 #include <visp3/robot/vpRobotSimulator.h>
59 #include <visp3/robot/vpWireFrameSimulator.h>
84 typedef enum { MODEL_3D, MODEL_DH } vpDisplayRobotType;
93 Bound_scene *robotArms;
96 unsigned int size_fMi;
112 std::thread *m_thread;
114 std::mutex m_mutex_fMi;
115 std::mutex m_mutex_eMc;
116 std::mutex m_mutex_artVel;
117 std::mutex m_mutex_artCoord;
118 std::mutex m_mutex_velocity;
119 std::mutex m_mutex_display;
120 std::mutex m_mutex_robotStop;
121 std::mutex m_mutex_frame;
122 std::mutex m_mutex_setVelocityCalled;
123 std::mutex m_mutex_scene;
132 unsigned int jointLimitArt;
134 bool singularityManagement;
139 #if defined(VISP_HAVE_X11)
141 #elif defined(VISP_HAVE_GDI)
143 #elif defined(HAVE_OPENCV_HIGHGUI)
145 #elif defined(VISP_HAVE_D3D9)
147 #elif defined(VISP_HAVE_GTK)
151 vpDisplayRobotType displayType;
158 bool constantSamplingTimeMode;
162 bool setVelocityCalled;
167 vpRobotWireFrameSimulator();
168 VP_EXPLICIT vpRobotWireFrameSimulator(
bool display);
181 if ((std::fabs(px_ext - 1.) >
vpMath::maximum(px_ext, 1.) * std::numeric_limits<double>::epsilon()) &&
182 (std::fabs(py_ext - 1) >
vpMath::maximum(py_ext, 1.) * std::numeric_limits<double>::epsilon()))
213 void initScene(
const vpSceneObject &obj,
const vpSceneDesiredObject &desiredObject);
214 void initScene(
const char *obj,
const char *desiredObject);
215 void initScene(
const vpSceneObject &obj);
234 inline void setConstantSamplingTimeMode(
const bool _constantSamplingTimeMode)
236 constantSamplingTimeMode = _constantSamplingTimeMode;
272 inline void setDisplayRobotType(
const vpDisplayRobotType dispType) { displayType = dispType; }
303 this->delta_t_ = delta_t;
309 void setSingularityManagement(
bool sm) { singularityManagement = sm; }
314 void setVerbose(
bool verbose) { this->verbose_ = verbose; }
331 static void launcher(vpRobotWireFrameSimulator &simulator)
333 simulator.updateArticularPosition();
340 virtual void updateArticularPosition() = 0;
342 virtual int isInJointLimit() = 0;
345 virtual void computeArticularVelocity() = 0;
348 void initDisplay() { ; }
349 virtual void initArms() = 0;
353 m_mutex_artCoord.lock();
355 artCoordTmp = artCoord;
356 m_mutex_artCoord.unlock();
361 m_mutex_artCoord.lock();
363 m_mutex_artCoord.unlock();
368 m_mutex_artVel.lock();
370 m_mutex_artVel.unlock();
375 m_mutex_artVel.lock();
377 m_mutex_artVel.unlock();
382 m_mutex_velocity.lock();
384 m_mutex_velocity.unlock();
389 m_mutex_velocity.lock();
391 m_mutex_velocity.unlock();
394 void set_displayBusy(
const bool &status)
396 m_mutex_display.lock();
397 displayBusy = status;
398 m_mutex_display.unlock();
400 bool get_displayBusy()
402 m_mutex_display.lock();
403 bool status = displayBusy;
406 m_mutex_display.unlock();
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed....
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Implementation of an homogeneous matrix and operations on such kind of matrices.
unsigned int getWidth() const
unsigned int getHeight() const
static Type maximum(const Type &a, const Type &b)
static Type minimum(const Type &a, const Type &b)
This class aims to be a basis used to create all the robot simulators.
virtual void setSamplingTime(const double &delta_t)
void setVerbose(bool verbose)
Implementation of a wire frame simulator. Compared to the vpSimulator class, it does not require thir...
vpHomogeneousMatrix getExternalCameraPosition() const
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
void setCurrentViewColor(const vpColor &col)
vpHomogeneousMatrix get_cMo() const
vpCameraParameters getExternalCameraParameters(const vpImage< unsigned char > &I) const
void setCameraColor(const vpColor &col)
void setDesiredViewColor(const vpColor &col)
void setExternalCameraPosition(const vpHomogeneousMatrix &cam_Mf)
void set_fMo(const vpHomogeneousMatrix &fMo_)
vpHomogeneousMatrix get_fMo() const
void setDesiredCameraPosition(const vpHomogeneousMatrix &cdMo_)
void setGraphicsThickness(unsigned int thickness)
VISP_EXPORT double getMinTimeForUsleepCall()