2 #include <visp3/core/vpConfig.h>
3 #include <visp3/gui/vpDisplayFactory.h>
4 #include <visp3/gui/vpProjectionDisplay.h>
5 #include <visp3/robot/vpSimulatorCamera.h>
6 #include <visp3/robot/vpWireFrameSimulator.h>
7 #include <visp3/visual_features/vpFeatureBuilder.h>
8 #include <visp3/vs/vpServo.h>
9 #include <visp3/vs/vpServoDisplay.h>
11 #ifdef ENABLE_VISP_NAMESPACE
18 static std::vector<vpImagePoint> traj[4];
20 for (
unsigned int i = 0; i < 4; i++) {
22 point[i].project(cMo);
24 traj[i].push_back(cog);
26 for (
unsigned int i = 0; i < 4; i++) {
27 for (
unsigned int j = 1; j < traj[i].size(); j++) {
35 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
36 std::shared_ptr<vpDisplay> displayInt;
37 std::shared_ptr<vpDisplay> displayExt;
46 std::vector<vpPoint> point(4);
47 point[0].setWorldCoordinates(-0.1, -0.1, 0);
48 point[1].setWorldCoordinates(0.1, -0.1, 0);
49 point[2].setWorldCoordinates(0.1, 0.1, 0);
50 point[3].setWorldCoordinates(-0.1, 0.1, 0);
58 for (
unsigned int i = 0; i < 4; i++) {
68 robot.setSamplingTime(0.040);
69 robot.getPosition(wMc);
74 #if defined(VISP_HAVE_DISPLAY)
75 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
83 std::cout <<
"No image viewer is available..." << std::endl;
98 robot.getPosition(wMc);
100 for (
unsigned int i = 0; i < 4; i++) {
115 display_trajectory(Iint, point, cMo, cam);
126 std::cout <<
"Catch an exception: " << e << std::endl;
128 #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
129 if (displayInt !=
nullptr) {
132 if (displayExt !=
nullptr) {
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
static const vpColor green
Class that defines generic functionalities for display.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static void flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t)
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
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double rad(double deg)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) VP_OVERRIDE
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
void addFeature(vpBasicFeature &s_cur, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
void setServo(const vpServoType &servo_type)
vpColVector computeControlLaw()
Class that defines the simplest robot: a free flying camera.
Implementation of a wire frame simulator. Compared to the vpSimulator class, it does not require thir...
void setCameraPositionRelObj(const vpHomogeneousMatrix &cMo_)
void getInternalImage(vpImage< unsigned char > &I)
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
void setExternalCameraPosition(const vpHomogeneousMatrix &cam_Mf)
void setDesiredCameraPosition(const vpHomogeneousMatrix &cdMo_)
void setInternalCameraParameters(const vpCameraParameters &cam)
void setExternalCameraParameters(const vpCameraParameters &cam)
void getExternalImage(vpImage< unsigned char > &I)
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 int wait(double t0, double t)