3 #include <visp/vpAROgre.h>
4 #include <visp/vpFeatureBuilder.h>
5 #include <visp/vpServo.h>
6 #include <visp/vpSimulatorCamera.h>
21 #if defined(VISP_HAVE_OGRE)
33 ogre.setCameraParameters(cam);
34 ogre.addResource(
"./");
35 ogre.init(background,
false,
true);
39 std::vector<std::string> name(4);
40 for (
int i=0; i<4; i++) {
41 std::ostringstream s; s <<
"Sphere" << i; name[i] = s.str();
42 ogre.load(name[i],
"Sphere.mesh");
43 ogre.setScale(name[i], 0.02f, 0.02f, 0.02f);
45 ogre.setPosition(name[i],
vpTranslationVector(point[i].get_oX(), point[i].get_oY(), point[i].get_oZ()));
49 Ogre::Light * light = ogre.getSceneManager()->createLight();
50 light->setDiffuseColour(1, 1, 1);
51 light->setSpecularColour(1, 1, 1);
52 light->setPosition((Ogre::Real)cdMo[0][3], (Ogre::Real)cdMo[1][3], (Ogre::Real)(-cdMo[2][3]));
53 light->setType(Ogre::Light::LT_POINT);
62 for (
int i = 0 ; i < 4 ; i++) {
76 for (
unsigned int iter=0; iter < 150; iter ++) {
79 for (
int i = 0 ; i < 4 ; i++) {
83 #if defined(VISP_HAVE_OGRE)
85 ogre.display(background, cMo);
94 std::cout <<
"Catch an exception: " << e << std::endl;
97 std::cout <<
"Catch an exception " << std::endl;
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
double getSamplingTime() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
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.
static int wait(double t0, double t)
Class that defines what is a point.
virtual void setSamplingTime(const double &delta_t)
vpColVector computeControlLaw()
Generic class defining intrinsic camera parameters.
void getPosition(vpHomogeneousMatrix &wMc) const
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
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.
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...