#include <visp3/core/vpConfig.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/robot/vpSimulatorAfma6.h>
#include <visp3/visual_features/vpFeatureBuilder.h>
#include <visp3/vs/vpServo.h>
#ifdef ENABLE_VISP_NAMESPACE
#endif
{
unsigned int thickness = 3;
static std::vector<vpImagePoint> traj[4];
for (unsigned int i = 0; i < 4; i++) {
point[i].project(cMo);
traj[i].push_back(cog);
}
for (unsigned int i = 0; i < 4; i++) {
for (unsigned int j = 1; j < traj[i].size(); j++) {
}
}
}
int main()
{
#if defined(VISP_HAVE_THREADS)
try {
std::vector<vpPoint> point;
point.push_back(
vpPoint(-0.1, -0.1, 0));
point.push_back(
vpPoint(0.1, -0.1, 0));
point.push_back(
vpPoint(0.1, 0.1, 0));
point.push_back(
vpPoint(-0.1, 0.1, 0));
for (unsigned int i = 0; i < 4; i++) {
point[i].track(cdMo);
point[i].track(cMo);
}
vpSimulatorAfma6 robot(true);
std::cout << "Robot joint limits: " << std::endl;
for (unsigned int i = 0; i < 3; i++)
std::cout << "Joint " << i << ": min " << qmin[i] << " max " << qmax[i] << " (m)" << std::endl;
for (
unsigned int i = 3; i < qmin.
size(); i++)
<< std::endl;
robot.set_fMo(wMo);
bool ret = robot.initialiseCameraRelativeToObject(cMo);
if (ret == false)
return EXIT_FAILURE;
robot.setDesiredCameraPosition(cdMo);
#if defined(VISP_HAVE_X11)
vpDisplayX displayInt(Iint, 700, 0, "Internal view");
#elif defined(VISP_HAVE_GDI)
#elif defined(HAVE_OPENCV_HIGHGUI)
#else
std::cout << "No image viewer is available..." << std::endl;
#endif
robot.setCameraParameters(cam);
bool start = true;
for (;;) {
cMo = robot.get_cMo();
for (unsigned int i = 0; i < 4; i++) {
point[i].track(cMo);
}
robot.getInternalView(Iint);
if (!start) {
display_trajectory(Iint, point, cMo, cam);
}
break;
if (start) {
start = false;
v = 0;
}
}
}
std::cout << "Catch an exception: " << e << std::endl;
}
#endif
}
unsigned int size() const
Return the number of elements of the 2D array.
Generic class defining intrinsic camera parameters.
@ perspectiveProjWithoutDistortion
Perspective projection without distortion model.
Implementation of column vector and the associated operations.
static const vpColor blue
static const vpColor green
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
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)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
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.
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 double deg(double rad)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) VP_OVERRIDE
void setVerbose(bool verbose)
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
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()
VISP_EXPORT int wait(double t0, double t)