Commit 4bca1654 authored by mederic_fourmy's avatar mederic_fourmy
Browse files

Add parameter to switch between the 2 apriltag factors

parent 4fc07969
......@@ -26,7 +26,9 @@ noise:
std_z : 0.1 # m
std_rpy_degrees : 5 # degrees
std_pix: 20 # pixel error
use_proj_factor: false
vote:
voting active: true
min_time_vote: 0 # s
......
......@@ -87,6 +87,9 @@ struct ParamsProcessorTrackerLandmarkApriltag : public ParamsProcessorTrackerLan
bool refine_edges_;
double std_pix_;
bool use_proj_factor_;
double min_time_span_;
double max_time_span_;
int nb_vote_for_every_first_;
......@@ -106,6 +109,7 @@ struct ParamsProcessorTrackerLandmarkApriltag : public ParamsProcessorTrackerLan
debug_ = _server.getParam<bool>(prefix + _unique_name + "/debug");
refine_edges_ = _server.getParam<bool>(prefix + _unique_name + "/refine_edges");
std_pix_ = _server.getParam<double>(prefix + _unique_name + "/std_pix");
use_proj_factor_ = _server.getParam<bool>(prefix + _unique_name + "/use_proj_factor");
min_time_span_ = _server.getParam<double>(prefix + _unique_name + "/keyframe_vote/min_time_span");
max_time_span_ = _server.getParam<double>(prefix + _unique_name + "/keyframe_vote/max_time_span");
nb_vote_for_every_first_ = _server.getParam<int>(prefix + _unique_name + "/keyframe_vote/nb_vote_for_every_first");
......@@ -114,7 +118,7 @@ struct ParamsProcessorTrackerLandmarkApriltag : public ParamsProcessorTrackerLan
}
std::string print() const override
{
return ParamsProcessorTrackerLandmark::print() + "\n"
return ParamsProcessorTrackerLandmark::print() + "\n"
+ "tag_family_: " + tag_family_ + "\n"
+ "tag_width_default_: " + std::to_string(tag_width_default_) + "\n"
+ "tag_widths_: " + converter<std::string>::convert(tag_widths_) + "\n"
......@@ -124,6 +128,7 @@ struct ParamsProcessorTrackerLandmarkApriltag : public ParamsProcessorTrackerLan
+ "debug_: " + std::to_string(debug_) + "\n"
+ "refine_edges_: " + std::to_string(refine_edges_) + "\n"
+ "std_pix_: " + std::to_string(std_pix_) + "\n"
+ "use_proj_factor_: " + std::to_string(use_proj_factor_) + "\n"
+ "min_time_span_: " + std::to_string(min_time_span_) + "\n"
+ "max_time_span_: " + std::to_string(max_time_span_) + "\n"
+ "nb_vote_for_every_first_: " + std::to_string(nb_vote_for_every_first_) + "\n"
......@@ -244,6 +249,7 @@ class ProcessorTrackerLandmarkApriltag : public ProcessorTrackerLandmark
apriltag_detector_t* detector_;
apriltag_family_t* tag_family_;
double std_pix_; ///< pixel error to be propagated to a camera to tag transformation covariance
bool use_proj_factor_;
double ippe_min_ratio_;
double ippe_max_rep_error_;
Matrix3d K_;
......
......@@ -31,6 +31,7 @@ ProcessorTrackerLandmarkApriltag::ProcessorTrackerLandmarkApriltag( ParamsProces
tag_widths_(_params_tracker_landmark_apriltag->tag_widths_),
tag_width_default_(_params_tracker_landmark_apriltag->tag_width_default_),
std_pix_(_params_tracker_landmark_apriltag->std_pix_),
use_proj_factor_(_params_tracker_landmark_apriltag->use_proj_factor_),
ippe_min_ratio_(_params_tracker_landmark_apriltag->ippe_min_ratio_),
ippe_max_rep_error_(_params_tracker_landmark_apriltag->ippe_max_rep_error_),
cv_K_(3,3),
......@@ -153,8 +154,7 @@ void ProcessorTrackerLandmarkApriltag::preProcess()
det->p[2][0], det->p[2][1], // top right
det->p[3][0], det->p[3][1]; // top left
bool use_reproj_factor = true;
if (use_reproj_factor)
if (use_proj_factor_)
{
// add to detected features list
detections_incoming_.push_back(std::make_shared<FeatureApriltagProj>(corners_vec,
......
......@@ -79,6 +79,8 @@ static ParamsProcessorBasePtr createParamsProcessorLandmarkApriltag(const std::s
YAML::Node noise = config["noise"];
params->std_pix_ = noise["std_pix"] .as<double>();
params->use_proj_factor_ = config["use_proj_factor"] .as<bool>();
YAML::Node vote = config["vote"];
params->voting_active = vote["voting active"] .as<bool>();
params->min_time_span_ = vote["min_time_vote"] .as<double>();
......
......@@ -26,7 +26,9 @@ noise:
std_z : 0.1 # m
std_rpy_degrees : 5 # degrees
std_pix: 20 # pixel error
use_proj_factor: false
vote:
voting active: true
min_time_vote: 0 # s
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment