42#include <visp3/core/vpDebug.h>
43#include <visp3/core/vpMath.h>
44#include <visp3/core/vpXmlParserCamera.h>
45#include <visp3/robot/vpViper850.h>
47static const char *opt_viper850[] = {
"CAMERA",
"eMc_ROT_XYZ",
"eMc_TRANS_XYZ",
nullptr };
50#ifdef VISP_HAVE_VIPER850_DATA
52std::string(VISP_VIPER850_DATA_PATH) +
53std::string(
"/include/const_eMc_MarlinF033C_without_distortion_Viper850.cnf");
56std::string(VISP_VIPER850_DATA_PATH) + std::string(
"/include/const_eMc_MarlinF033C_with_distortion_Viper850.cnf");
59std::string(VISP_VIPER850_DATA_PATH) +
60std::string(
"/include/const_eMc_PTGreyFlea2_without_distortion_Viper850.cnf");
63std::string(VISP_VIPER850_DATA_PATH) + std::string(
"/include/const_eMc_PTGreyFlea2_with_distortion_Viper850.cnf");
66std::string(VISP_VIPER850_DATA_PATH) + std::string(
"/include/"
67 "const_eMc_schunk_gripper_without_distortion_Viper850."
71std::string(VISP_VIPER850_DATA_PATH) +
72std::string(
"/include/const_eMc_schunk_gripper_with_distortion_Viper850.cnf");
75std::string(VISP_VIPER850_DATA_PATH) + std::string(
"/include/const_eMc_generic_without_distortion_Viper850.cnf");
78std::string(VISP_VIPER850_DATA_PATH) + std::string(
"/include/const_eMc_generic_with_distortion_Viper850.cnf");
81std::string(VISP_VIPER850_DATA_PATH) + std::string(
"/include/const_camera_Viper850.xml");
109 c56 = -341.33 / 9102.22;
181#ifdef VISP_HAVE_VIPER850_DATA
183 std::string filename_eMc;
195 "Feature TOOL_MARLIN_F033C_CAMERA is not implemented for Kannala-Brandt projection model yet.");
210 "Feature TOOL_PTGREY_FLEA2_CAMERA is not implemented for Kannala-Brandt projection model yet.");
225 "Feature TOOL_SCHUNK_GRIPPER_CAMERA is not implemented for Kannala-Brandt projection model yet.");
239 "Feature TOOL_GENERIC_CAMERA is not implemented for Kannala-Brandt projection model yet.");
245 "No predefined file available for a custom tool"
246 "You should use init(vpViper850::vpToolType, const std::string&) or"
247 "init(vpViper850::vpToolType, const vpHomogeneousMatrix&) instead");
255 this->
init(filename_eMc);
281 "Feature TOOL_MARLIN_F033C_CAMERA is not implemented for Kannala-Brandt projection model yet.");
306 "Feature TOOL_PTGREY_FLEA2_CAMERA is not implemented for Kannala-Brandt projection model yet.");
324 "Feature TOOL_GENERIC_CAMERA is not implemented for Kannala-Brandt projection model yet.");
330 "No predefined parameters available for a custom tool"
331 "You should use init(vpViper850::vpToolType, const std::string&) or"
332 "init(vpViper850::vpToolType, const vpHomogeneousMatrix&) instead");
336 this->
eMc.buildFrom(
etc, eRc);
413 std::ifstream fdconfig(filename.c_str(), std::ios::in);
415 if (!fdconfig.is_open()) {
422 bool get_erc =
false;
423 bool get_etc =
false;
426 while (std::getline(fdconfig, line)) {
428 if ((line.compare(0, 1,
"#") == 0) || line.empty()) {
431 std::istringstream ss(line);
435 for (code = 0;
nullptr != opt_viper850[code]; ++code) {
436 if (key.compare(opt_viper850[code]) == 0) {
446 ss >> erc_[0] >> erc_[1] >> erc_[2];
449 erc_ = erc_ * M_PI / 180.0;
455 ss >> etc_[0] >> etc_[1] >> etc_[2];
462 filename.c_str(), lineNum));
469 if (get_etc && get_erc) {
474 "Could not read translation and rotation "
475 "parameters from config file %s",
554 const unsigned int &image_height)
const
556#if defined(VISP_HAVE_VIPER850_DATA) && defined(VISP_HAVE_PUGIXML)
619 if (image_width == 640 && image_height == 480) {
624 cam.initPersProjWithoutDistortion(1232.0, 1233.0, 317.7, 253.9);
627 cam.initPersProjWithDistortion(1214.0, 1213.0, 323.1, 240.0, -0.1824, 0.1881);
631 "Feature getCameraParameters is not implemented for Kannala-Brandt projection model yet.");
636 vpTRACE(
"Cannot get default intrinsic camera parameters for this image "
645 if (image_width == 640 && image_height == 480) {
650 cam.initPersProjWithoutDistortion(868.0, 869.0, 314.8, 254.1);
653 cam.initPersProjWithDistortion(831.3, 831.6, 322.7, 265.8, -0.1955, 0.2047);
657 "Feature getCameraParameters is not implemented for Kannala-Brandt projection model yet.");
662 vpTRACE(
"Cannot get default intrinsic camera parameters for this image "
670 if (image_width == 640 && image_height == 480) {
675 cam.initPersProjWithoutDistortion(868.0, 869.0, 314.8, 254.1);
678 cam.initPersProjWithDistortion(831.3, 831.6, 322.7, 265.8, -0.1955, 0.2047);
682 "Feature getCameraParameters is not implemented for Kannala-Brandt projection model yet.");
687 vpTRACE(
"Cannot get default intrinsic camera parameters for this image "
Generic class defining intrinsic camera parameters.
vpCameraParametersProjType
@ perspectiveProjWithDistortion
Perspective projection with distortion model.
@ ProjWithKannalaBrandtDistortion
Projection with Kannala-Brandt distortion model.
@ perspectiveProjWithoutDistortion
Perspective projection without distortion model.
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.
Definition of the vpImage class member functions.
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.
static const char *const CONST_PTGREY_FLEA2_CAMERA_NAME
void setToolType(vpViper850::vpToolType tool)
Set the current tool type.
static const std::string CONST_CAMERA_FILENAME
static const std::string CONST_EMC_MARLIN_F033C_WITHOUT_DISTORTION_FILENAME
static const vpToolType defaultTool
Default tool attached to the robot end effector.
static const char *const CONST_SCHUNK_GRIPPER_CAMERA_NAME
static const std::string CONST_EMC_GENERIC_WITH_DISTORTION_FILENAME
void parseConfigFile(const std::string &filename)
static const std::string CONST_EMC_SCHUNK_GRIPPER_WITHOUT_DISTORTION_FILENAME
static const std::string CONST_EMC_SCHUNK_GRIPPER_WITH_DISTORTION_FILENAME
static const char *const CONST_GENERIC_CAMERA_NAME
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
vpToolType tool_current
Current tool in use.
vpCameraParameters::vpCameraParametersProjType projModel
static const std::string CONST_EMC_MARLIN_F033C_WITH_DISTORTION_FILENAME
static const std::string CONST_EMC_PTGREY_FLEA2_WITHOUT_DISTORTION_FILENAME
vpToolType getToolType() const
Get the current tool type.
vpToolType
List of possible tools that can be attached to the robot end-effector.
@ TOOL_SCHUNK_GRIPPER_CAMERA
@ TOOL_PTGREY_FLEA2_CAMERA
@ TOOL_MARLIN_F033C_CAMERA
static const char *const CONST_MARLIN_F033C_CAMERA_NAME
static const std::string CONST_EMC_PTGREY_FLEA2_WITH_DISTORTION_FILENAME
static const std::string CONST_EMC_GENERIC_WITHOUT_DISTORTION_FILENAME
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.