add helper functions
parent
d0d2aa8aee
commit
43df7375c0
|
@ -31,8 +31,9 @@ namespace gtsam {
|
||||||
pose_(pose) {
|
pose_(pose) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CalibratedCamera::~CalibratedCamera() {
|
CalibratedCamera::CalibratedCamera(const Vector &v) : pose_(expmap<Pose3>(v)) {}
|
||||||
}
|
|
||||||
|
CalibratedCamera::~CalibratedCamera() {}
|
||||||
|
|
||||||
CalibratedCamera CalibratedCamera::level(const Pose2& pose2, double height) {
|
CalibratedCamera CalibratedCamera::level(const Pose2& pose2, double height) {
|
||||||
double st = sin(pose2.theta()), ct = cos(pose2.theta());
|
double st = sin(pose2.theta()), ct = cos(pose2.theta());
|
||||||
|
|
|
@ -37,12 +37,24 @@ namespace gtsam {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CalibratedCamera(const Pose3& pose);
|
CalibratedCamera(const Pose3& pose);
|
||||||
|
CalibratedCamera(const Vector &v) ;
|
||||||
virtual ~CalibratedCamera();
|
virtual ~CalibratedCamera();
|
||||||
|
|
||||||
const Pose3& pose() const {
|
inline const Pose3& pose() const { return pose_; }
|
||||||
return pose_;
|
bool equals (const CalibratedCamera &camera, double tol = 1e-9) const {
|
||||||
|
return pose_.equals(camera.pose(), tol) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const CalibratedCamera compose(const CalibratedCamera &c) const {
|
||||||
|
return CalibratedCamera( pose_ * c.pose() ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const CalibratedCamera inverse() const {
|
||||||
|
return CalibratedCamera( pose_.inverse() ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static size_t dim() { return 6 ; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a level camera at the given 2D pose and height
|
* Create a level camera at the given 2D pose and height
|
||||||
* @param pose2 specifies the location and viewing direction
|
* @param pose2 specifies the location and viewing direction
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace gtsam {
|
||||||
Pose3 transform_to(const Pose3& pose) const;
|
Pose3 transform_to(const Pose3& pose) const;
|
||||||
|
|
||||||
/** get the dimension by the type */
|
/** get the dimension by the type */
|
||||||
static inline size_t dim() { return 6; };
|
inline static size_t dim() { return 6; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Serialization function */
|
/** Serialization function */
|
||||||
|
|
Loading…
Reference in New Issue