2 #include <visp3/core/vpConfig.h>
3 #ifdef VISP_HAVE_MODULE_AR
4 #include <visp3/ar/vpAROgre.h>
6 #include <visp3/visual_features/vpFeatureBuilder.h>
7 #include <visp3/vs/vpServo.h>
8 #include <visp3/robot/vpSimulatorCamera.h>
23 #if defined(VISP_HAVE_OGRE)
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++) {
43 std::ostringstream s; s <<
"Sphere" << i; name[i] = s.str();
44 ogre.load(name[i],
"Sphere.mesh");
45 ogre.setScale(name[i], 0.02f, 0.02f, 0.02f);
47 ogre.setPosition(name[i],
vpTranslationVector(point[i].get_oX(), point[i].get_oY(), point[i].get_oZ()));
51 Ogre::Light * light = ogre.getSceneManager()->createLight();
52 light->setDiffuseColour(1, 1, 1);
53 light->setSpecularColour(1, 1, 1);
54 light->setPosition((Ogre::Real)cdMo[0][3], (Ogre::Real)cdMo[1][3], (Ogre::Real)(-cdMo[2][3]));
55 light->setType(Ogre::Light::LT_POINT);
64 for (
int i = 0 ; i < 4 ; i++) {
78 for (
unsigned int iter=0; iter < 150; iter ++) {
81 for (
int i = 0 ; i < 4 ; i++) {
85 #if defined(VISP_HAVE_OGRE)
87 ogre.display(background, cMo);
96 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 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.