POS Library — Coordinate Systems
The POS library [1] is a coordinate system framework based on the POS ontology [2] for representing and transforming generalized coordinates across different coordinate systems and spaces.
See the basic notions for a general description of the fundamental concepts. Below you will find tutorials, with increasingly complex examples, and reference documentation.
Quick Example
Create a child coordinate system, define a point in it, and transform the point to world coordinates.
quick_example.c++#include <print>
import ninbot;
int main()
{
using namespace nin;
using namespace nin::R2;
position_coordsys_child CS1 {WCS, translation{3_m, 1_m}};
point P = {CS1, point_qty{1_m, 2_m}};
point_qty P_wcs = P.map_to(WCS);
std::println("Coordinates of point P in WCS are: P={}", P_wcs);
}
Coordinates of point P in WCS are: P=(4, 3) (m)
In the example above,
-
CS1 is a child coordinate system whose origin sits at (3, 1) in the World Coordinate System (
WCS). -
pointbinds a coordinate quantity toCS1. -
map_to(WCS)builds a transformation function fromCS1toWCSand invokes it in one step, walking up the tree and composing the rigid transformations along the way.
Reference
Basic Templates
| Template | Description |
|---|---|
Concept for coordinate system spaces |
|
Concept for cross-space bridges |
|
Base class for all coordinate systems |
|
Coordinate quantity bound to a coordinate system |
|
Batch container of coordinate quantities |
|
Create transformation functions between coordinate systems |
|
Fixed transformation function between coordinate systems |
|
Abstract base for backend implementations |
|
Child node in the kinematic tree |
|
Wrapper for arbitrary backends |
|
Tree traversal cutoff for performance |