Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add potential fixes for fisheye model #146

Open
wants to merge 3 commits into
base: noetic-devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion camera_calibration_parsers/src/parse_ini.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ bool writeCalibrationIni(std::ostream& out, const std::string& camera_name,
sensor_msgs::distortion_models::PLUMB_BOB.c_str(), (int)cam_info.D.size());
return false;
}
else if ( cam_info.distortion_model != sensor_msgs::distortion_models::EQUIDISTANT ||
cam_info.D.size() != 4) {
ROS_ERROR("Videre INI format can only save calibrations using the equidistant distortion model. "
"Use the YAML format instead.\n"
"\tdistortion_model = '%s', expected '%s'\n"
"\tD.size() = %d, expected 4", cam_info.distortion_model.c_str(),
sensor_msgs::distortion_models::EQUIDISTANT.c_str(), (int)cam_info.D.size());
return false;
}

out.precision(5);
out << std::fixed;
Expand Down Expand Up @@ -213,7 +222,9 @@ bool parseCalibrationIniRange(Iterator first, Iterator last,
cam_info.distortion_model = sensor_msgs::distortion_models::PLUMB_BOB;
else if (cam_info.D.size() == 8)
cam_info.distortion_model = sensor_msgs::distortion_models::RATIONAL_POLYNOMIAL;

else if (cam_info.D.size() == 4){
cam_info.distortion_model = sensor_msgs::distortion_models::EQUIDISTANT;
}
return info.hit;
}
/// \endcond
Expand Down