![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
Points, poses, rotations, transforms and twists. More...
Classes | |
| class | rz::Point |
| Immutable 2D point / vector with unit-safe Cartesian coordinates. More... | |
| class | rz::Pose |
| Rigid-body pose in SE(2) with unit-safe position and rotation. More... | |
| class | rz::Rotation |
| Immutable planar rotation about the Z axis. More... | |
| class | rz::Transform |
| Rigid-body transform in SE(2): translation (meters) + rotation (radians). More... | |
| class | rz::Twist |
| Differential motion (twist) in SE(2) space. More... | |
Functions | |
| Length | rz::circumradius (const Point &A, const Point &B, const Point &C) noexcept |
| Circumradius of the triangle defined by three points. | |
| std::optional< double > | rz::circleLineIntersection (const Point &start, const Point &end, const Point ¢er, Length radius) noexcept |
| Intersection of a circle with a line segment. | |
| Curvature | rz::curvatureToPoint (const Pose &pose, const Point &point) noexcept |
| Signed curvature needed to reach a point from a pose assuming an instantaneous circular arc. | |
Points, poses, rotations, transforms and twists.
|
noexcept |
Intersection of a circle with a line segment.
Solves for t in [0, 1] where the parametric segment P(t) = start + t * (end - start) intersects the circle of center and radius.
If two intersections lie on the segment, the larger parameter (farther along the segment, denoted t2) is returned; otherwise the single valid root is returned. If no intersection lies on the segment, returns std::nullopt.
| start | Segment start point. |
| end | Segment end point. |
| center | Circle center. |
| radius | Circle radius (meters). |
Circumradius of the triangle defined by three points.
Uses the formula R = abc/4A, where a = |BC|, b = |AC|, c = |AB|, and A is the triangle area (half the absolute wedge of two sides).
If the points are collinear (A = 0), returns 0 m.
| A | Vertex A. |
| B | Vertex B. |
| C | Vertex C. |
Signed curvature needed to reach a point from a pose assuming an instantaneous circular arc.
Computes curvature = +-2 * dPerp / chord^2, where dPerp is the perpendicular distance from the point to the pose’s heading line, and the sign is determined by which side of the heading the point lies on (left positive, right negative). If the point lies exactly on the heading line, returns 0.
| pose | Current pose (defines line and heading). |
| point | Target point. |