feat: expose the Cartesian position of a ray behind a segment
Line already holds the scan it was fitted from, so pointAt() is a lookup and not a conversion. A consumer that wants to say something about the individual rays behind a segment - which of them are bright, where along the segment they sit - would otherwise have to be handed the whole scan alongside the segment and re-derive what the segment already knows. The index is a ray number, the same numbering getIndices() returns, so it also reaches rays the segment dropped as outliers or that a split pushed into a neighbouring segment.
This commit is contained in:
@@ -53,6 +53,11 @@ Line::Line(double angle, double radius, const std::array<double, 4>& covariance,
|
||||
// Geometry
|
||||
// ================================================================================================
|
||||
|
||||
std::array<double, 2> Line::pointAt(unsigned int index) const
|
||||
{
|
||||
return { { r_data_.xs[index], r_data_.ys[index] } };
|
||||
}
|
||||
|
||||
double Line::distToPoint(unsigned int index) const
|
||||
{
|
||||
const double p_rad = std::hypot(r_data_.xs[index], r_data_.ys[index]);
|
||||
|
||||
Reference in New Issue
Block a user