pose_util.h
Typedefs
-
typedef Eigen::Matrix<double, Eigen::Dynamic, 3, Eigen::RowMajor> ouster::core::Points
-
typedef Eigen::Matrix<double, Eigen::Dynamic, 16, Eigen::RowMajor> ouster::core::Poses
-
typedef Eigen::Matrix<double, 1, 16, Eigen::RowMajor> ouster::core::Pose
Functions
-
inline Points ouster::core::dewarp(const Points &points, const Pose &pose)
This function takes in a set of 3D points and a set of 4x4 pose matrices
- Parameters:
points – [in] A Eigen matrix of shape (N, 3) representing the 3D points. Each row corresponds to a point in 3D space.
pose – [in] A Eigen matrix of shape (W, 16) representing W 4x4 transformation matrices. Each row is a flattened 4x4 pose matrix
- Returns:
A matrix of shape (N, 3) containing the dewarped 3D points, where the same number of points are transformed by each corresponding pose matrix.
-
template<typename T>
PointsT<T> ouster::core::dewarp(const Eigen::Ref<const PointsT<T>> &points, const Eigen::Ref<const PosesT<T>> &poses) This function takes in a set of 3D points and a set of 4x4 pose matrices
- Parameters:
points – [in] A Eigen matrix of shape (N, 3) representing the 3D points. Each row corresponds to a point in 3D space.
poses – [in] A Eigen matrix of shape (W, 16) representing W 4x4 transformation matrices. Each row is a flattened 4x4 pose matrix
- Returns:
A matrix of shape (N, 3) containing the dewarped 3D points, where the same number of points are transformed by each corresponding pose matrix.
-
template<typename T>
void ouster::core::dewarp(Eigen::Ref<PointsT<T>> dewarped, const Eigen::Ref<const PointsT<T>> points, const Eigen::Ref<const PosesT<T>> poses) This function takes in a set of 3D points and a set of 4x4 pose matrices
- Parameters:
dewarped – [out] An eigen matrix of shape (N, 3) to hold the dewarped 3D points, where the same number of points are transformed by each corresponding pose matrix.
points – [in] A Eigen matrix of shape (N, 3) representing the 3D points. Each row corresponds to a point in 3D space.
poses – [in] A Eigen matrix of shape (W, 16) representing W 4x4 transformation matrices. Each row is a flattened 4x4 pose matrix
-
inline Points ouster::core::transform(const Points &points, const Pose &pose)
Applies a single 4x4 pose transformation to a set of 3D points.
This function takes in a set of 3D points and applies a single 4x4 transformation matrix (Pose) to all points.
- Parameters:
points – [in] A matrix of shape (N, 3) representing the 3D points. Each row corresponds to a point in 3D space.
pose – [in] A vector of 16 elements representing a flattened 4x4 transformation matrix.
- Returns:
A matrix of shape (N, 3) containing the transformed 3D points, where each point is rotated and translated by the given pose.
-
template<typename T>
Eigen::Matrix<T, Eigen::Dynamic, 3, Eigen::RowMajor> ouster::core::transform(const Eigen::Ref<const Eigen::Matrix<T, Eigen::Dynamic, 3, Eigen::RowMajor>> points, const Eigen::Ref<const Eigen::Matrix<T, 1, 16, Eigen::RowMajor>> pose) Applies a single 4x4 pose transformation to a set of 3D points.
This function takes in a set of 3D points and applies a single 4x4 transformation matrix (Pose) to all points.
- Parameters:
points – [in] A matrix of shape (N, 3) representing the 3D points. Each row corresponds to a point in 3D space.
pose – [in] A vector of 16 elements representing a flattened 4x4 transformation matrix.
- Returns:
A matrix of shape (N, 3) containing the transformed 3D points, where each point is rotated and translated by the given pose.
-
template<typename T>
void ouster::core::transform(Eigen::Ref<Eigen::Matrix<T, Eigen::Dynamic, 3, Eigen::RowMajor>> transformed, const Eigen::Ref<const Eigen::Matrix<T, Eigen::Dynamic, 3, Eigen::RowMajor>> points, const Eigen::Ref<const Eigen::Matrix<T, 1, 16, Eigen::RowMajor>> pose) Applies a single 4x4 pose transformation to a set of 3D points.
This function takes in a set of 3D points and applies a single 4x4 transformation matrix (Pose) to all points.
- Parameters:
transformed – [out] A matrix of shape (N, 3) containing the transformed 3D points, where each point is rotated and translated by the given pose.
points – [in] A matrix of shape (N, 3) representing the 3D points. Each row corresponds to a point in 3D space.
pose – [in] A vector of 16 elements representing a flattened 4x4 transformation matrix.
-
Poses ouster::core::interp_pose(const std::vector<double> &x_interp, const std::vector<double> &x_known, const Poses &poses_known)
Computes piecewise linear interpolated 4x4 transformation matrices based on input x-coordinate values.
This function is the Python binding version of the above function.
- Parameters:
x_interp – [in] A vector of x-coordinate values at which to compute the interpolated transformation matrices.
x_known – [in] A vector of reference x-coordinate values corresponding to the known transformation matrices. Must be monotonically increasing and not repeated.
poses_known – [in] An Eigen::Matrix of dynamic size representing the flattened 4x4 transformation matrices (in row-major order, 16 elements each) associated with each x-coordinate value in x_known.
- Returns:
An Eigen::Matrix of dynamic size containing the interpolated transformation matrices (flattened in row-major order, 16 elements each) at the x-coordinate values given by x_interp.
-
template<typename T>
std::vector<Eigen::Matrix<double, 4, 4>> ouster::core::interp_pose(const std::vector<T> &x_interp, const std::vector<T> &x_known, const std::vector<Eigen::Matrix<double, 4, 4>> &poses_known) One-dimensional linear interpolation for monotonically increasing sample transformation matrices.
This function performs linear interpolation on a set of monotonically increasing and non-repeated x-coordinate values and their corresponding 4x4 pose matrices. It evaluates the interpolated poses at the specified x-coordinate values provided in x_interp.
Note
If x_interp contains values outside the range of x_known, the function uses the first two and last two poses to extrapolate accordingly.
- Parameters:
x_interp – [in] A vector of x-coordinate values at which to compute the interpolated transformation matrices.
x_known – [in] A vector of x-coordinate values corresponding to the known transformation matrices. Must be monotonically increasing and not repeated.
poses_known – [in] A vector of 4x4 transformation matrices associated with each x-coordinate value in x_known.
- Throws:
std::invalid_argument – if the sizes of x_known and poses_known do not match, if their sizes are less than 2, or if x_known is not monotonically increasing.
- Returns:
A vector of 4x4 transformation matrices representing the interpolated poses at x-coordinate values given by x_interp.