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);
97 std::cout <<
"Catch an exception: " << e << std::endl;
99 std::cout <<
"Catch an exception " << std::endl;
VISP_EXPORT int wait(double t0, double t)
void setWorldCoordinates(double oX, double oY, double oZ)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines the simplest robot: a free flying camera.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
error that can be emited by ViSP classes.
void track(const vpHomogeneousMatrix &cMo)
vpHomogeneousMatrix inverse() const
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.
vpHomogeneousMatrix getPosition() const
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
virtual void setSamplingTime(const double &delta_t)
vpColVector computeControlLaw()
Generic class defining intrinsic camera parameters.
void setShowConfigDialog(bool showConfigDialog)
double getSamplingTime() const
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
Implementation of column vector and the associated operations.
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.