2 #include <visp3/core/vpConfig.h> 3 #ifdef VISP_HAVE_MODULE_AR 4 #include <visp3/ar/vpAROgre.h> 6 #include <visp3/robot/vpSimulatorCamera.h> 7 #include <visp3/visual_features/vpFeatureBuilder.h> 8 #include <visp3/vs/vpServo.h> 23 #if defined(VISP_HAVE_OGRE) 28 vpCameraParameters cam(840, 840, background.getWidth() / 2, background.getHeight() / 2);
35 ogre.setCameraParameters(cam);
36 ogre.addResource(
"./");
37 ogre.init(background,
false,
true);
41 std::vector<std::string> name(4);
42 for (
unsigned int i = 0; i < 4; i++) {
46 ogre.load(name[i],
"Sphere.mesh");
47 ogre.setScale(name[i], 0.02f, 0.02f,
50 ogre.setPosition(name[i],
vpTranslationVector(point[i].get_oX(), point[i].get_oY(), point[i].get_oZ()));
54 Ogre::Light *light = ogre.getSceneManager()->createLight();
55 light->setDiffuseColour(1, 1, 1);
56 light->setSpecularColour(1, 1, 1);
57 light->setPosition((Ogre::Real)cdMo[0][3], (Ogre::Real)cdMo[1][3], (Ogre::Real)(-cdMo[2][3]));
58 light->setType(Ogre::Light::LT_POINT);
67 for (
int i = 0; i < 4; i++) {
81 for (
unsigned int iter = 0; iter < 150; iter++) {
84 for (
int i = 0; i < 4; i++) {
88 #if defined(VISP_HAVE_OGRE) 90 ogre.display(background, cMo);
98 std::cout <<
"Catch an exception: " << e << std::endl;
100 std::cout <<
"Catch an exception " << std::endl;
VISP_EXPORT int wait(double t0, double t)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
double getSamplingTime() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines the simplest robot: a free flying camera.
void setShowConfigDialog(const bool showConfigDialog)
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
error that can be emited by ViSP classes.
void track(const vpHomogeneousMatrix &cMo)
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
Implementation of an augmented reality viewer using Ogre3D 3rd party.
Class that defines what is a point.
virtual void setSamplingTime(const double &delta_t)
vpColVector computeControlLaw()
Generic class defining intrinsic camera parameters.
vpHomogeneousMatrix getPosition() const
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
void setWorldCoordinates(const double oX, const double oY, const double oZ)
Implementation of column vector and the associated operations.
vpHomogeneousMatrix inverse() const
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void setServo(const vpServoType &servo_type)
Class that consider the case of a translation vector.