44 #include <visp3/core/vpDebug.h>
45 #include <visp3/core/vpMath.h>
46 #include <visp3/core/vpXmlParserCamera.h>
47 #include <visp3/robot/vpViper650.h>
49 static const char *opt_viper650[] = {
"CAMERA",
"eMc_ROT_XYZ",
"eMc_TRANS_XYZ",
nullptr };
52 #ifdef VISP_HAVE_VIPER650_DATA
54 std::string(VISP_VIPER650_DATA_PATH) +
55 std::string(
"/include/const_eMc_MarlinF033C_without_distortion_Viper650.cnf");
58 std::string(VISP_VIPER650_DATA_PATH) + std::string(
"/include/const_eMc_MarlinF033C_with_distortion_Viper650.cnf");
61 std::string(VISP_VIPER650_DATA_PATH) +
62 std::string(
"/include/const_eMc_PTGreyFlea2_without_distortion_Viper650.cnf");
65 std::string(VISP_VIPER650_DATA_PATH) + std::string(
"/include/const_eMc_PTGreyFlea2_with_distortion_Viper650.cnf");
68 std::string(VISP_VIPER650_DATA_PATH) + std::string(
"/include/"
69 "const_eMc_schunk_gripper_without_distortion_Viper650."
73 std::string(VISP_VIPER650_DATA_PATH) +
74 std::string(
"/include/const_eMc_schunk_gripper_with_distortion_Viper650.cnf");
77 std::string(VISP_VIPER650_DATA_PATH) + std::string(
"/include/const_eMc_generic_without_distortion_Viper650.cnf");
80 std::string(VISP_VIPER650_DATA_PATH) + std::string(
"/include/const_eMc_generic_with_distortion_Viper650.cnf");
83 std::string(VISP_VIPER650_DATA_PATH) + std::string(
"/include/const_camera_Viper650.xml");
110 c56 = -341.33 / 9102.22;
182 #ifdef VISP_HAVE_VIPER650_DATA
184 std::string filename_eMc;
196 "Feature TOOL_MARLIN_F033C_CAMERA is not implemented for Kannala-Brandt projection model yet.");
211 "Feature TOOL_PTGREY_FLEA2_CAMERA is not implemented for Kannala-Brandt projection model yet.");
227 "Feature TOOL_SCHUNK_GRIPPER_CAMERA is not implemented for Kannala-Brandt projection model yet.");
242 "Feature TOOL_GENERIC_CAMERA is not implemented for Kannala-Brandt projection model yet.");
249 "No predefined file available for a custom tool"
250 "You should use init(vpViper650::vpToolType, const std::string&) or"
251 "init(vpViper650::vpToolType, const vpHomogeneousMatrix&) instead");
254 vpERROR_TRACE(
"This error should not occur!");
259 this->
init(filename_eMc);
285 "Feature TOOL_MARLIN_F033C_CAMERA is not implemented for Kannala-Brandt projection model yet.");
311 "Feature TOOL_PTGREY_FLEA2_CAMERA is not implemented for Kannala-Brandt projection model yet.");
330 "Feature TOOL_GENERIC_CAMERA is not implemented for Kannala-Brandt projection model yet.");
337 "No predefined parameters available for a custom tool"
338 "You should use init(vpViper650::vpToolType, const std::string&) or"
339 "init(vpViper650::vpToolType, const vpHomogeneousMatrix&) instead");
420 std::ifstream fdconfig(filename.c_str(), std::ios::in);
422 if (!fdconfig.is_open()) {
429 bool get_erc =
false;
430 bool get_etc =
false;
433 while (std::getline(fdconfig, line)) {
435 if ((line.compare(0, 1,
"#") == 0) || line.empty()) {
438 std::istringstream ss(line);
442 for (code = 0;
nullptr != opt_viper650[code]; ++code) {
443 if (key.compare(opt_viper650[code]) == 0) {
453 ss >> erc_[0] >> erc_[1] >> erc_[2];
456 erc_ = erc_ * M_PI / 180.0;
462 ss >> etc_[0] >> etc_[1] >> etc_[2];
469 filename.c_str(), lineNum));
475 if (get_etc && get_erc) {
480 "Could not read translation and rotation "
481 "parameters from config file %s",
560 const unsigned int &image_height)
const
562 #if defined(VISP_HAVE_VIPER650_DATA) && defined(VISP_HAVE_PUGIXML)
608 vpERROR_TRACE(
"This error should not occur!");
625 if (image_width == 640 && image_height == 480) {
637 "Feature getCameraParameters is not implemented for Kannala-Brandt projection model yet.");
642 vpTRACE(
"Cannot get default intrinsic camera parameters for this image "
651 if (image_width == 640 && image_height == 480) {
663 "Feature getCameraParameters is not implemented for Kannala-Brandt projection model yet.");
668 vpTRACE(
"Cannot get default intrinsic camera parameters for this image "
676 if (image_width == 640 && image_height == 480) {
688 "Feature getCameraParameters is not implemented for Kannala-Brandt projection model yet.");
693 vpTRACE(
"Cannot get default intrinsic camera parameters for this image "
Generic class defining intrinsic camera parameters.
void initPersProjWithoutDistortion(double px, double py, double u0, double v0)
vpCameraParametersProjType
@ perspectiveProjWithDistortion
Perspective projection with distortion model.
@ ProjWithKannalaBrandtDistortion
Projection with Kannala-Brandt distortion model.
@ perspectiveProjWithoutDistortion
Perspective projection without distortion model.
void initPersProjWithDistortion(double px, double py, double u0, double v0, double kud, double kdu)
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
@ notImplementedError
Not implemented.
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix & buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
unsigned int getWidth() const
unsigned int getHeight() const
static double rad(double deg)
Error that can be emitted by the vpRobot class and its derivatives.
@ readingParametersError
Cannot parse parameters.
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as Euler angle minimal representation.
Class that consider the case of a translation vector.
Modelization of the ADEPT Viper 650 robot.
static const std::string CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME
static const char *const CONST_PTGREY_FLEA2_CAMERA_NAME
vpCameraParameters::vpCameraParametersProjType projModel
static const std::string CONST_EMC_SCHUNK_GRIPPER_WITHOUT_DISTORTION_FILENAME
static const vpToolType defaultTool
Default tool attached to the robot end effector.
static const std::string CONST_EMC_SCHUNK_GRIPPER_WITH_DISTORTION_FILENAME
vpToolType getToolType() const
Get the current tool type.
static const std::string CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME
void parseConfigFile(const std::string &filename)
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
static const char *const CONST_GENERIC_CAMERA_NAME
static const std::string CONST_EMC_MARLIN_F033C_WITHOUT_DISTORTION_FILENAME
static const std::string CONST_EMC_MARLIN_F033C_WITH_DISTORTION_FILENAME
void setToolType(vpViper650::vpToolType tool)
Set the current tool type.
vpToolType
List of possible tools that can be attached to the robot end-effector.
@ TOOL_MARLIN_F033C_CAMERA
@ TOOL_SCHUNK_GRIPPER_CAMERA
@ TOOL_PTGREY_FLEA2_CAMERA
static const char *const CONST_MARLIN_F033C_CAMERA_NAME
static const std::string CONST_EMC_PTGREY_FLEA2_WITHOUT_DISTORTION_FILENAME
static const std::string CONST_EMC_PTGREY_FLEA2_WITH_DISTORTION_FILENAME
static const std::string CONST_CAMERA_FILENAME
static const char *const CONST_SCHUNK_GRIPPER_CAMERA_NAME
virtual void set_eMc(const vpHomogeneousMatrix &eMc_)
double c56
Mechanical coupling between joint 5 and joint 6.
vpHomogeneousMatrix eMc
End effector to camera transformation.
XML parser to load and save intrinsic camera parameters.
int parse(vpCameraParameters &cam, const std::string &filename, const std::string &camera_name, const vpCameraParameters::vpCameraParametersProjType &projModel, unsigned int image_width=0, unsigned int image_height=0, bool verbose=true)