Skip to content

Commit

Permalink
Format review
Browse files Browse the repository at this point in the history
  • Loading branch information
lasdasdas committed May 24, 2024
1 parent 1aac933 commit 03378ae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ pcl::SampleConsensusModelTorus<PointT, PointNT>::computeModelCoefficients(
// Direction vector
Eigen::Vector3f d = ((p1 + n1 * t1) - (p0 + n0 * t0));
d.normalize();
// Flip direction, so that the fisrt element of the direction vector is
// positive, for consitency.
// Flip direction, so that the first element of the direction vector is
// positive, for consistency.
if (d[0] < 0) {
d *= -1;
}
Expand Down
34 changes: 19 additions & 15 deletions sample_consensus/include/pcl/sample_consensus/sac_model_torus.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,27 @@ class SampleConsensusModelTorus
}
/** \brief Check whether the given index samples can form a valid torus model, compute
* the model coefficients from these samples and store them in model_coefficients. The
* torus coefficients are: radii, torus_center_point, torus_normal \param[in] samples
* the point indices found as possible good candidates for creating a valid model
* torus coefficients are: radii, torus_center_point, torus_normal.
* \param[in] samples the point indices found as possible good candidates for creating a valid model
* \param[out] model_coefficients the resultant model coefficients
*/
bool
computeModelCoefficients(const Indices& samples,
Eigen::VectorXf& model_coefficients) const override;

/** \brief Compute all distances from the cloud data to a given torus model.
* \param[in] model_coefficients the coefficients of a torus model that we need to
* compute distances to \param[out] distances the resultant estimated distances
* \param[in] model_coefficients the coefficients of a torus model that we need to compute distances to
* \param[out] distances the resultant estimated distances
*/
void
getDistancesToModel(const Eigen::VectorXf& model_coefficients,
std::vector<double>& distances) const override;

/** \brief Select all the points which respect the given model coefficients as
* inliers. \param[in] model_coefficients the coefficients of a torus model that we
* need to compute distances to \param[in] threshold a maximum admissible distance
* threshold for determining the inliers from the outliers \param[out] inliers the
* inliers.
* \param[in] model_coefficients the coefficients of a torus model that we need to compute distances to
* \param[in] threshold a maximum admissible distance threshold for determining the inliers from the outliers
* \param[out] inliers the
* resultant model inliers
*/
void
Expand All @@ -165,16 +166,17 @@ class SampleConsensusModelTorus

/** \brief Count all the points which respect the given model coefficients as inliers.
*
* \param[in] model_coefficients the coefficients of a model that we need to compute
* distances to \param[in] threshold maximum admissible distance threshold for
* \param[in] model_coefficients the coefficients of a model that we need to compute distances to
* \param[in] threshold maximum admissible distance threshold for
* determining the inliers from the outliers \return the resultant number of inliers
*/
std::size_t
countWithinDistance(const Eigen::VectorXf& model_coefficients,
const double threshold) const override;

/** \brief Recompute the torus coefficients using the given inlier set and return them
* to the user. \param[in] inliers the data inliers found as supporting the model
* to the user.
* \param[in] inliers the data inliers found as supporting the model
* \param[in] model_coefficients the initial guess for the optimization
* \param[out] optimized_coefficients the resultant recomputed coefficients after
* non-linear optimization
Expand All @@ -197,8 +199,9 @@ class SampleConsensusModelTorus
bool copy_data_fields = true) const override;

/** \brief Verify whether a subset of indices verifies the given torus model
* coefficients. \param[in] indices the data indices that need to be tested against
* the torus model \param[in] model_coefficients the torus model coefficients
* coefficients.
* \param[in] indices the data indices that need to be tested against the torus model
* \param[in] model_coefficients the torus model coefficients
* \param[in] threshold a maximum admissible distance threshold for determining the
* inliers from the outliers
*/
Expand All @@ -219,9 +222,10 @@ class SampleConsensusModelTorus
using SampleConsensusModel<PointT>::model_size_;

/** \brief Project a point onto a torus given by its model coefficients (radii,
* torus_center_point, torus_normal) \param[in] pt the input point to project
* \param[in] model_coefficients the coefficients of the torus (radii,
* torus_center_point, torus_normal) \param[out] pt_proj the resultant projected point
* torus_center_point, torus_normal)
* \param[in] pt the input point to project
* \param[in] model_coefficients the coefficients of the torus (radii, torus_center_point, torus_normal)
* \param[out] pt_proj the resultant projected point
*/
void
projectPointToTorus(const Eigen::Vector3f& pt,
Expand Down

0 comments on commit 03378ae

Please sign in to comment.