27 #include "../SmartProjectionRigFactor.h" 30 using namespace gtsam;
36 Point3 landmark3(3, 0, 3.0);
37 Point3 landmark4(10, 0.5, 1.2);
38 Point3 landmark5(10, -0.5, 1.2);
50 static double fov = 60;
51 static size_t w = 640,
h = 480;
65 static const Camera
cam1(level_pose,
K2);
66 static const Camera
cam2(pose_right,
K2);
67 static const Camera
cam3(pose_above,
K2);
114 static const Camera
cam1(level_pose,
K);
115 static const Camera
cam2(pose_right,
K);
116 static const Camera
cam3(pose_above,
K);
146 static const Camera
cam1(level_pose);
147 static const Camera
cam2(pose_right);
148 static const Camera
cam3(pose_above);
152 template <
class CAMERA>
156 Pose3 cameraPose = camera.pose();
157 Pose3 perturbedCameraPose = cameraPose.
compose(noise_pose);
158 return CAMERA(perturbedCameraPose, camera.calibration());
161 template <
class CAMERA>
164 typename CAMERA::MeasurementVector& measurements_cam) {
168 measurements_cam.push_back(cam1_uv1);
169 measurements_cam.push_back(cam2_uv1);
170 measurements_cam.push_back(cam3_uv1);
Smart factor on poses, assuming camera calibration is fixed.
static PinholeCamera< Cal3_S2 > cam1(pose3, cal1)
static StereoCamera cam2(pose3, cal4ptr)
static const Point2 level_uv_right
SmartProjectionRigFactor< Camera > SmartFactorP
static const Camera level_camera(level_pose)
CAMERA perturbCameraPose(const CAMERA &camera)
static const std::shared_ptr< Cal3Bundler > sharedBundlerK(new Cal3Bundler(500, 1e-3, 1e-3, 1000, 2000))
Calibrated camera with spherical projection.
CameraSet< Camera > Cameras
A set of cameras, all with their own calibration.
Point2 landmark1(5.0, 1.5)
Unit3 project(const Point3 &point, OptionalJacobian< 2, 6 > Dpose={}, OptionalJacobian< 2, 3 > Dpoint={}) const
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
SmartProjectionPoseFactor< Cal3Bundler > SmartFactor
static const Cal3Bundler K(500, 1e-3, 1e-3, 0, 0)
static const SmartProjectionParams params
static Point3 landmark(0, 0, 5)
Smart factor on cameras (pose + calibration)
Point2 landmark2(7.0, 1.5)
static const Cal3_S2 K2(1500, 1200, 0, w, h)
std::shared_ptr< Cal3_S2 > shared_ptr
GenericMeasurement< Point2, Point2 > Measurement
GeneralSFMFactor< Camera, Point3 > SFMFactor
static const Camera level_camera_right(pose_right)
void projectToMultipleCameras(const CAMERA &cam1, const CAMERA &cam2, const CAMERA &cam3, Point3 landmark, typename CAMERA::MeasurementVector &measurements_cam)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
The most common 5DOF 3D->2D calibration.
Class compose(const Class &g) const
static const Cal3_S2::shared_ptr sharedK(new Cal3_S2(fov, w, h))
static const Camera cam3(pose_above)
Calibration used by Bundler.
SmartProjectionRigFactor< Camera > SmartRigFactor
static const Point2 level_uv
std::shared_ptr< EmptyCal > shared_ptr
static const Cal3_S2::shared_ptr sharedK2(new Cal3_S2(1500, 1200, 0, 640, 480))
static const CalibratedCamera camera(kDefaultPose)
a general SFM factor with an unknown calibration
static const EmptyCal::shared_ptr emptyK(new EmptyCal())
Calibration used by Bundler.
noiseModel::Base::shared_ptr SharedNoiseModel
The most common 5DOF 3D->2D calibration.