38 #include <visp3/core/vpConfig.h> 40 #if defined(VISP_HAVE_MODULE_GUI) && ((defined(_WIN32) && !defined(WINRT_8_0)) || defined(VISP_HAVE_PTHREAD)) 41 #include <visp3/robot/vpRobotWireFrameSimulator.h> 42 #include <visp3/robot/vpSimulatorViper850.h> 44 #include "../wireframe-simulator/vpBound.h" 45 #include "../wireframe-simulator/vpVwstack.h" 46 #include "../wireframe-simulator/vpScene.h" 53 I(), tcur(0), tprev(0), robotArms(NULL), size_fMi(8), fMi(NULL), artCoord(), artVel(), velocity(),
55 #elif defined(VISP_HAVE_PTHREAD)
58 mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(),
59 displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true),
61 #if defined(VISP_HAVE_DISPLAY)
64 displayType(MODEL_3D), displayAllowed(true), constantSamplingTimeMode(false),
65 setVelocityCalled(false), verbose_(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));
179 free_Bound_scene (&(this->
camera));
183 free_Bound_scene (&(this->
camera));
200 free_Bound_scene (&(this->
camera));
204 free_Bound_scene (&(this->
camera));
241 float o44c[4][4],o44cd[4][4],x,y,z;
242 Matrix
id = IDENTITY_MATRIX;
249 vp2jlc_matrix(cMo.inverse(),o44c);
254 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
255 x = o44c[2][0] + o44c[3][0];
256 y = o44c[2][1] + o44c[3][1];
257 z = o44c[2][2] + o44c[3][2];
258 add_vwstack (
"start",
"vrp", x,y,z);
259 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
260 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
261 add_vwstack (
"start",
"window", -u, u, -v, v);
265 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
266 x = o44cd[2][0] + o44cd[3][0];
267 y = o44cd[2][1] + o44cd[3][1];
268 z = o44cd[2][2] + o44cd[3][2];
269 add_vwstack (
"start",
"vrp", x,y,z);
270 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
271 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
272 add_vwstack (
"start",
"window", -u, u, -v, v);
314 float o44c[4][4],o44cd[4][4],x,y,z;
315 Matrix
id = IDENTITY_MATRIX;
322 vp2jlc_matrix(cMo.inverse(),o44c);
327 add_vwstack (
"start",
"cop", o44c[3][0],o44c[3][1],o44c[3][2]);
328 x = o44c[2][0] + o44c[3][0];
329 y = o44c[2][1] + o44c[3][1];
330 z = o44c[2][2] + o44c[3][2];
331 add_vwstack (
"start",
"vrp", x,y,z);
332 add_vwstack (
"start",
"vpn", o44c[2][0],o44c[2][1],o44c[2][2]);
333 add_vwstack (
"start",
"vup", o44c[1][0],o44c[1][1],o44c[1][2]);
334 add_vwstack (
"start",
"window", -u, u, -v, v);
340 add_vwstack (
"start",
"cop", o44cd[3][0],o44cd[3][1],o44cd[3][2]);
341 x = o44cd[2][0] + o44cd[3][0];
342 y = o44cd[2][1] + o44cd[3][1];
343 z = o44cd[2][2] + o44cd[3][2];
344 add_vwstack (
"start",
"vrp", x,y,z);
345 add_vwstack (
"start",
"vpn", o44cd[2][0],o44cd[2][1],o44cd[2][2]);
346 add_vwstack (
"start",
"vup", o44cd[1][0],o44cd[1][1],o44cd[1][2]);
347 add_vwstack (
"start",
"window", -u, u, -v, v);
373 #elif !defined(VISP_BUILD_SHARED_LIBS) 375 void dummy_vpRobotWireFrameSimulator() {};
virtual void get_fMi(vpHomogeneousMatrix *fMit)=0
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="")
VISP_EXPORT int wait(double t0, double t)
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
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
Flag used to force the sampling time in the thread computing the robot's displacement to a constant v...
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
void resize(const unsigned int h, const unsigned int w)
resize the image : Image initialization
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
bool setVelocityCalled
Flag used to specify to the thread managing the robot displacements that the setVelocity() method has...
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
void resize(const unsigned int i, const bool flagNullify=true)