From a9b804e18c811c781a099a70b960f5bbde61257d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 18 Jul 2016 12:14:51 +0200 Subject: some: replace hardcoded pi values with the same pi constant We can't depend on M_PI existing after including cmath. --- tracker-aruco/ftnoir_tracker_aruco.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tracker-aruco/ftnoir_tracker_aruco.cpp') diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp index de26c420..7e635a85 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.cpp +++ b/tracker-aruco/ftnoir_tracker_aruco.cpp @@ -14,6 +14,7 @@ #include #include "opentrack-compat/camera-names.hpp" #include "opentrack-compat/sleep.hpp" +#include "opentrack-compat/pi-constant.hpp" #include #include @@ -87,7 +88,7 @@ void Tracker::start_tracker(QFrame* videoframe) layout = layout_; } -#define HT_PI 3.1415926535 +#define HT_PI OPENTRACK_PI void Tracker::getRT(cv::Matx33d& r_, cv::Vec3d& t_) { @@ -181,7 +182,7 @@ bool Tracker::open_camera() void Tracker::set_intrinsics() { - static constexpr double pi = 3.1415926f; + static constexpr double pi = OPENTRACK_PI; const int w = grayscale.cols, h = grayscale.rows; const double diag_fov = static_cast(s.fov) * pi / 180.; const double fov_w = 2.*atan(tan(diag_fov/2.)/sqrt(1. + h/(double)w * h/(double)w)); -- cgit v1.2.3