Class Camera3DLidar

Inheritance Relationships

Base Type

Class Documentation

class aslam::Camera3DLidar : public aslam::Cloneable<Camera, Camera3DLidar>

An implementation of a projection model for a 360 degree 3D lidar.

Constructors/destructors and operators

friend friend std::ostream & operator<< (std::ostream &out, const Camera3DLidar &camera)

Convenience function to print the state using streams.

Camera3DLidar()

Empty constructor for serialization interface.

Camera3DLidar(const Camera3DLidar &other) = default

Copy constructor for clone operation.

void operator=(const Camera3DLidar&) = delete
Camera3DLidar(const Eigen::VectorXd &intrinsics, const uint32_t image_width, const uint32_t image_height)

Construct a Camera3DLidar.

Parameters
  • intrinsics[in] (Horizontal-, vertical- resolution in radians, frequency in Hz).

  • image_width[in] Image width in pixels.

  • image_height[in] Image height in pixels.

inline virtual ~Camera3DLidar()

Methods to project and back-project euclidean points

virtual bool backProject3(const Eigen::Ref<const Eigen::Vector2d> &keypoint, Eigen::Vector3d *out_point_3d) const

Compute the 3d bearing vector in euclidean coordinates given a keypoint in image coordinates.

Uses the projection (& distortion) models. The result might be in normalized image plane for some camera implementations but not for the general case.

Parameters
  • keypoint[in] Keypoint in image coordinates.

  • out_point_3d[out] Bearing vector in euclidean coordinates

template<typename DerivedKeyPoint, typename DerivedPoint3d>
inline const ProjectionResult evaluateProjectionResult(const Eigen::MatrixBase<DerivedKeyPoint> &keypoint, const Eigen::MatrixBase<DerivedPoint3d> &point_3d) const

Checks the success of a projection operation and returns the result in a ProjectionResult object.

Parameters
  • keypoint[in] Keypoint in image coordinates.

  • point_3d[in] Projected point in euclidean.

Returns

The ProjectionResult object contains details about the success of the projection.

Functional methods to project and back-project points

template<typename ScalarType, typename DistortionType, typename MIntrinsics, typename MDistortion>
const ProjectionResult project3Functional(const Eigen::Matrix<ScalarType, 3, 1> &point_3d, const Eigen::MatrixBase<MIntrinsics> &intrinsics_external, const Eigen::MatrixBase<MDistortion> &distortion_coefficients_external, Eigen::Matrix<ScalarType, 2, 1> *out_keypoint) const

Template version of project3Functional.

virtual const ProjectionResult project3Functional(const Eigen::Ref<const Eigen::Vector3d> &point_3d, const Eigen::VectorXd *intrinsics_external, const Eigen::VectorXd *distortion_coefficients_external, Eigen::Vector2d *out_keypoint, Eigen::Matrix<double, 2, 3> *out_jacobian_point, Eigen::Matrix<double, 2, Eigen::Dynamic> *out_jacobian_intrinsics, Eigen::Matrix<double, 2, Eigen::Dynamic> *out_jacobian_distortion) const

This function projects a point into the image using the intrinsic parameters that are passed in as arguments.

If any of the Jacobians are nonnull, they should be filled in with the Jacobian with respect to small changes in the argument.

Parameters
  • point_3d[in] The point in euclidean coordinates.

  • intrinsics_external[in] External intrinsic parameter vector. NOTE: If nullptr, use internal distortion parameters.

  • distortion_coefficients_external[in] External distortion parameter vector. Parameter is ignored is no distortion is active. NOTE: If nullptr, use internal distortion parameters. NOTE: THIS IS NOT USABLE FOR THIS CAMERA!

  • out_keypoint[out] The keypoint in image coordinates. NOTE: THIS IS NOT USABLE FOR THIS CAMERA!

  • out_jacobian_point[out] The Jacobian wrt. to changes in the euclidean point. nullptr: calculation is skipped. NOTE: THIS IS NOT USABLE FOR THIS CAMERA!

  • out_jacobian_intrinsics[out] The Jacobian wrt. to changes in the intrinsics. nullptr: calculation is skipped. NOTE: THIS IS NOT USABLE FOR THIS CAMERA!

  • out_jacobian_distortion[out] The Jacobian wrt. to changes in the distortion parameters. nullptr: calculation is skipped. NOTE: THIS IS NOT USABLE FOR THIS CAMERA!

Returns

Contains information about the success of the projection. Check ProjectionResult for more information.

Methods to support unit testing.

virtual Eigen::Vector2d createRandomKeypoint() const

Creates a random valid keypoint..

virtual Eigen::Vector3d createRandomVisiblePoint(double depth) const

Creates a random visible point.

Negative depth means random between 0 and 100 meters.

void getBorderRays(Eigen::MatrixXd &rays) const

Get a set of border rays.

Methods to access intrinsics.

inline double verticalResolution() const

The vertical resolution of the lidar in radians.

inline double horizontalResolution() const

The horizontal resolution of the lidar in radians.

inline double horizontalCenter() const

The horizontal center of the image.

inline double verticalCenter() const

The vertical center of the image.

inline virtual int getParameterSize() const

Returns the number of intrinsic parameters used in this camera model.

virtual bool intrinsicsValid(const Eigen::VectorXd &intrinsics) const

Function to check whether the given intrinsic parameters are valid for this model.

virtual void printParameters(std::ostream &out, const std::string &text) const

Print the internal parameters of the camera in a human-readable form Print to the ostream that is passed in.

The text is extra text used by the calling function to distinguish cameras

static inline constexpr int parameterCount()

Returns the number of intrinsic parameters used in this camera model.

static bool areParametersValid(const Eigen::VectorXd &parameters)

Static function that checks whether the given intrinsic parameters are valid for this model.

Public Types

enum [anonymous]

Values:

enumerator CLASS_SERIALIZATION_VERSION
enum Parameters

Values:

enumerator kHorizontalResolutionRad
enumerator kVerticalResolutionRad
enumerator kVerticalCenterRad
enumerator kHorizontalCenterRad

Public Functions

ASLAM_POINTER_TYPEDEFS(Camera3DLidar)
inline virtual int64_t rollingShutterDelayNanoSeconds(const Eigen::Vector2d &keypoint) const

The amount of time elapsed between the first row of the image and the keypoint.

For a global shutter camera, this can return Duration(0).

Parameters

keypoint[in] Keypoint to which the delay should be calculated.

Returns

Time elapsed between the first row of the image and the keypoint in nanoseconds.

inline int64_t rollingShutterDelayNanoSeconds() const

The amount of time elapsed between the first row of the image and the last row of the image.

For a global shutter camera, this can return 0.

inline virtual uint32_t getNumberOfLines() const

returns the number of lines, this is either the number of columns or rows or 1 in case of a global shutter camera.

inline virtual LineDelayMode getLineDelayMode() const

Returns which orientation the rolling shutter effect is occuring.

Public Static Functions

template<typename DistortionType = NullDistortion>
static inline Camera3DLidar::Ptr createTestCamera()

Create a test camera object for unit testing.

template<typename DistortionType = NullDistortion>
static inline Camera3DLidar::UniquePtr createTestCameraUnique()

Create a test camera object for unit testing.