46#include <visp3/core/vpConfig.h>
47#include <visp3/core/vpDebug.h>
49#if (defined(VISP_HAVE_COIN3D_AND_GUI) && defined(VISP_HAVE_DISPLAY))
51#include <visp3/ar/vpSimulator.h>
52#include <visp3/core/vpCameraParameters.h>
53#include <visp3/core/vpImage.h>
54#include <visp3/core/vpImageConvert.h>
55#include <visp3/core/vpTime.h>
57#include <visp3/gui/vpDisplayFactory.h>
61#include <visp3/blob/vpDot2.h>
62#include <visp3/core/vpHomogeneousMatrix.h>
63#include <visp3/core/vpIoTools.h>
64#include <visp3/core/vpMath.h>
65#include <visp3/robot/vpSimulatorCamera.h>
66#include <visp3/vision/vpPose.h>
67#include <visp3/visual_features/vpFeatureBuilder.h>
68#include <visp3/visual_features/vpFeaturePoint.h>
69#include <visp3/vs/vpServo.h>
70#include <visp3/vs/vpServoDisplay.h>
72#ifdef ENABLE_VISP_NAMESPACE
76static void *mainLoop(
void *_simu)
94 wMc = wMo *
cMo.inverse();
95 robot.setPosition(wMc);
117 for (
int i = 0;
i < 4;
i++)
118 point[i].project(cMo_d);
122 for (
int i = 0;
i < 4;
i++)
134#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
149 std::cout <<
"A click in the four dots clockwise. " << std::endl;
152 for (
int i = 0;
i < 4;
i++) {
155 std::cout <<
"A click in the dot " <<
i << std::endl;
180 for (
int i = 0;
i < 4;
i++)
181 task.addFeature(p[i], pd[i]);
200 for (
int i = 0;
i < 4;
i++) {
219 wMc = robot.getPosition();
233#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
234 if (disp !=
nullptr) {
261 std::string
filename =
"./4points.iv";
267 std::cout <<
"Load : " <<
filename << std::endl <<
"This file should be in the working directory" << std::endl;
278 std::cout <<
"Catch an exception: " <<
e << std::endl;
287 <<
"You do not have X11, GTK, or OpenCV, or GDI (Graphical Device Interface) functionalities to display images..."
289 std::cout <<
"Tip if you are on a unix-like system:" << std::endl;
290 std::cout <<
"- Install X11, configure again ViSP using cmake and build again this example" << std::endl;
291 std::cout <<
"Tip if you are on a windows-like system:" << std::endl;
292 std::cout <<
"- Install GDI, configure again ViSP using cmake and build again this example" << std::endl;
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class that defines generic functionalities for display.
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
void track(const vpImage< unsigned char > &I, bool canMakeTheWindowGrow=true)
void setGraphics(bool activate)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
error that can be emitted by ViSP classes.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
Definition of the vpImage class member functions.
static double rad(double deg)
Implementation of a matrix and operations on matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
void setWorldCoordinates(double oX, double oY, double oZ)
virtual void setSamplingTime(const double &delta_t)
static void display(const vpServo &s, const vpCameraParameters &cam, const vpImage< unsigned char > &I, vpColor currentColor=vpColor::green, vpColor desiredColor=vpColor::red, unsigned int thickness=1)
Class that defines the simplest robot: a free flying camera.
Implementation of a simulator based on Coin3d (www.coin3d.org).
unsigned int getInternalWidth() const
void load(const char *file_name)
load an iv file
void setInternalCameraParameters(vpCameraParameters &cam)
set internal camera parameters
virtual void mainLoop()
activate the mainloop
void getCameraParameters(vpCameraParameters &cam)
get the intrinsic parameters of the camera
void getInternalImage(vpImage< unsigned char > &I)
get an Image of the internal view
void initMainApplication()
perform some initialization in the main program thread
void initApplication(void *(*start_routine)(void *))
begin the main program
void setCameraPosition(vpHomogeneousMatrix &cMf)
set the camera position (from an homogeneous matrix)
void initExternalViewer(unsigned int nlig, unsigned int ncol)
initialize the external view
unsigned int getInternalHeight() const
virtual void initInternalViewer(unsigned int nlig, unsigned int ncol)
initialize the camera view
void closeMainApplication()
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.
VISP_EXPORT double measureTimeMs()
VISP_EXPORT int wait(double t0, double t)