artoolkitplus_parameters.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2013 by Markus Bader *
3  * markus.bader@tuwien.ac.at *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
24 
25 
26 
28 
29  node_name = node.getNamespace();
30  std::string tmp;
31 
32  node.param<bool>("show_camera_image", show_camera_image, ARTOOLKITPLUS_DEFAULT_SHOW_CAMERA_IMAGE);
33  ROS_INFO("%s: show_camera_image: %s", node_name.c_str(), ((show_camera_image) ? "true" : "false"));
34 
35  node.param<int>("skip_frames", skip_frames, ARTOOLKITPLUS_DEFAULT_SKIP_FRAMES);
36  ROS_INFO("%s: skip_frames: %i", node_name.c_str(), skip_frames);
37 
38 
39  node.param<bool>("tracker_single_marker", tracker_single_marker, ARTOOLKITPLUS_DEFAULT_TRACKER_SINGLE_MARKER);
40  ROS_INFO("%s: tracker_single_marker: %s", node_name.c_str(), ((tracker_single_marker) ? "true" : "false"));
41 
42  node.param<bool>("tracker_multi_marker", tracker_multi_marker, ARTOOLKITPLUS_DEFAULT_TRACKER_MULTI_MARKER);
43  ROS_INFO("%s: tracker_multi_marker: %s", node_name.c_str(), ((tracker_multi_marker) ? "true" : "false"));
44 
45  if(!tracker_multi_marker && !tracker_single_marker) {
46  ROS_ERROR("%s: at least tracker_multi_marker or tracker_single_marker must be true", node_name.c_str());
47  }
48 
49  node.param<bool>("use_multi_marker_lite_detection", use_multi_marker_lite_detection, ARTOOLKITPLUS_DEFAULT_MULIT_MARKER_LITE_DETECTION);
50  ROS_INFO("%s: use_multi_marker_lite_detection: %s", node_name.c_str(), ((use_multi_marker_lite_detection) ? "true" : "false"));
51 
52  node.param<std::string>("pattern_frame", pattern_frame, ARTOOLKITPLUS_DEFAULT_PATTERN_FRAME);
53  ROS_INFO("%s: pattern_frame: %s", node_name.c_str(), pattern_frame.c_str());
54 
55  node.param<std::string>("pattern_file", pattern_file, ARTOOLKITPLUS_DEFAULT_PATTERN_FILE);
56  ROS_INFO("%s: pattern_file: %s", node_name.c_str(), pattern_file.c_str());
57  if(!tracker_multi_marker && !pattern_file.empty()) {
58  ROS_WARN("%s: tracker_multi_marker must be true in order to use mutli patterns with a pattern file", node_name.c_str());
59  }
60 
61  node.param<std::string>("tf_prefix", tf_prefix, node_name);
62  ROS_INFO("%s: tf_prefix: %s", node_name.c_str(), tf_prefix.c_str());
63 
64 
65  node.param<std::string>("marker_mode", tmp, ARTOOLKITPLUS_MARKER_MODE_BCH);
66  if ((tmp.compare(ARTOOLKITPLUS_MARKER_MODE_BCH) == 0) || (tmp.compare(ARTOOLKITPLUS_MARKER_MODE_SIMPEL) == 0)) {
67  if (tmp.compare(ARTOOLKITPLUS_MARKER_MODE_BCH) == 0)
68  useBCH = true;
69  else
70  useBCH = false;
71  ROS_INFO("%s: marker_mode: %s", node_name.c_str(), tmp.c_str());
72  } else {
73  ROS_ERROR("%s: marker_mode: %s does not match any known type use %s or %s", node_name.c_str(), tmp.c_str(), ARTOOLKITPLUS_MARKER_MODE_SIMPEL, ARTOOLKITPLUS_MARKER_MODE_BCH);
74  }
75 
76  node.param<double>("pattern_width", pattern_width, ARTOOLKITPLUS_DEFAULT_PATTERN_WITH);
77  ROS_INFO("%s: pattern_width: %4.3f [m] only for single marker", node_name.c_str(), pattern_width);
78 
79  node.param<int>("edge_threshold", edge_threshold, ARTOOLKITPLUS_DEFAULT_THRESHOLD);
80  ROS_INFO("%s: edge_threshold: %i, (0 = auto edge_threshold)", node_name.c_str(), edge_threshold);
81 
82  node.param<double>("border_width", pattern_width, ARTOOLKITPLUS_DEFAULT_BOARDER_WIDTH);
83  ROS_INFO("%s: border_width: %4.3f, (0 = auto border_width)", node_name.c_str(), pattern_width);
84 
85  node.param<int>("undist_iterations", undist_iterations, ARTOOLKITPLUS_DEFAULT_UNDIST_INTERATIONS);
86  ROS_INFO("%s: undist_iterations: %i", node_name.c_str(), undist_iterations);
87 
88  node.param<bool>("distorted_input", distorted_input, ARTOOLKITPLUS_DEFAULT_DISTORTED_INPUT);
89  ROS_INFO("%s: distorted_input: %s", node_name.c_str(), ((distorted_input) ? "true" : "false"));
90 
91  node.param<std::string>("undist_mode", tmp, ARTOOLKITPLUS_DEFAULT_UNDIST_MODE);
92  if ((tmp.compare(ARTOOLKITPLUS_UNDIST_MODE_NONE) == 0) || (tmp.compare(ARTOOLKITPLUS_UNDIST_MODE_STD) == 0) || (tmp.compare(ARTOOLKITPLUS_UNDIST_MODE_LUT) == 0)) {
93  if (tmp.compare(ARTOOLKITPLUS_UNDIST_MODE_NONE) == 0)
94  undist_mode = ARToolKitPlus::UNDIST_NONE;
95  if (tmp.compare(ARTOOLKITPLUS_UNDIST_MODE_STD) == 0)
96  undist_mode = ARToolKitPlus::UNDIST_STD;
97  if (tmp.compare(ARTOOLKITPLUS_UNDIST_MODE_LUT) == 0)
98  undist_mode = ARToolKitPlus::UNDIST_LUT;
99  ROS_INFO("%s: undist_mode: %s", node_name.c_str(), tmp.c_str());
100  } else {
101  ROS_ERROR("%s: undist_mode: %s does not match any known type use %s, %s or %s", node_name.c_str(), tmp.c_str(), ARTOOLKITPLUS_UNDIST_MODE_NONE, ARTOOLKITPLUS_UNDIST_MODE_STD,
103  }
104 
105  node.param<std::string>("pose_estimation_mode", tmp, ARTOOLKITPLUS_DEFAULT_POSE_ESTIMATION_MODE);
106  if ((tmp.compare(ARTOOLKITPLUS_POSE_ESTIMATION_MODE_NORMAL) == 0) || (tmp.compare(ARTOOLKITPLUS_POSE_ESTIMATION_MODE_CONT) == 0) || (tmp.compare(ARTOOLKITPLUS_POSE_ESTIMATION_MODE_RPP) == 0)) {
107  if (tmp.compare(ARTOOLKITPLUS_POSE_ESTIMATION_MODE_NORMAL) == 0)
108  pose_estimation_mode = ARToolKitPlus::POSE_ESTIMATOR_ORIGINAL;
109  if (tmp.compare(ARTOOLKITPLUS_POSE_ESTIMATION_MODE_CONT) == 0)
110  pose_estimation_mode = ARToolKitPlus::POSE_ESTIMATOR_ORIGINAL_CONT;
111  if (tmp.compare(ARTOOLKITPLUS_POSE_ESTIMATION_MODE_RPP) == 0)
112  pose_estimation_mode = ARToolKitPlus::POSE_ESTIMATOR_RPP;
113  ROS_INFO("%s: pose_estimation_mode: %s", node_name.c_str(), tmp.c_str());
114  } else {
115  ROS_ERROR("%s: pose_estimation_mode: %s does not match any known type use %s, %s or %s", node_name.c_str(), tmp.c_str(), ARTOOLKITPLUS_POSE_ESTIMATION_MODE_NORMAL,
117  }
118 
119 
120  nPattern = -1;
121  nUpdateMatrix = true;
122 }
123 
#define ARTOOLKITPLUS_DEFAULT_MULIT_MARKER_LITE_DETECTION
#define ARTOOLKITPLUS_DEFAULT_BOARDER_WIDTH
#define ARTOOLKITPLUS_UNDIST_MODE_STD
#define ARTOOLKITPLUS_MARKER_MODE_BCH
#define ARTOOLKITPLUS_DEFAULT_TRACKER_SINGLE_MARKER
#define ARTOOLKITPLUS_DEFAULT_SKIP_FRAMES
#define ARTOOLKITPLUS_DEFAULT_DISTORTED_INPUT
#define ARTOOLKITPLUS_DEFAULT_PATTERN_WITH
#define ARTOOLKITPLUS_DEFAULT_UNDIST_MODE
#define ROS_WARN(...)
#define ARTOOLKITPLUS_DEFAULT_THRESHOLD
#define ARTOOLKITPLUS_DEFAULT_POSE_ESTIMATION_MODE
#define ARTOOLKITPLUS_POSE_ESTIMATION_MODE_NORMAL
#define ARTOOLKITPLUS_DEFAULT_TRACKER_MULTI_MARKER
#define ROS_INFO(...)
bool param(const std::string &param_name, T &param_val, const T &default_val) const
#define ARTOOLKITPLUS_POSE_ESTIMATION_MODE_CONT
const std::string & getNamespace() const
#define ARTOOLKITPLUS_DEFAULT_UNDIST_INTERATIONS
#define ARTOOLKITPLUS_DEFAULT_PATTERN_FILE
#define ARTOOLKITPLUS_POSE_ESTIMATION_MODE_RPP
#define ARTOOLKITPLUS_UNDIST_MODE_LUT
#define ROS_ERROR(...)
#define ARTOOLKITPLUS_DEFAULT_PATTERN_FRAME
#define ARTOOLKITPLUS_DEFAULT_SHOW_CAMERA_IMAGE
#define ARTOOLKITPLUS_MARKER_MODE_SIMPEL
#define ARTOOLKITPLUS_UNDIST_MODE_NONE


tuw_artoolkitplus
Author(s): Markus Bader
autogenerated on Sun Sep 4 2016 03:24:33