TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FrameMgr2D Class Reference

Manages a hierarchy of 2D coordinate frames and enables SE(2) transforms and GPS conversion. More...

#include <FrameMgr2D.h>

Collaboration diagram for FrameMgr2D:
Collaboration graph
[legend]

Public Member Functions

void setGPS (Frame2D &parent, const GPSCoordinate gps, float rotationDeg=90)
 
GPSCoordinate toGPS (const Frame2D &frame) const
 Converts a local frame to a GPS coordinate.
 
Transform2D getTransform (const Frame2D &from, const Frame2D &to) const
 Computes the transform from one frame to another using SE(2) math.
 

Protected Member Functions

std::vector< const Frame2D * > getPathToRoot (const Frame2D &frame) const
 Returns the path from the given frame up to the root (including self). The path is verly small, so no special optimizations are needed.
 

Protected Attributes

Frame2Dp_gpsParent = nullptr
 
GPSCoordinate gpsCoordinate
 
float gpsRotationDeg
 

Detailed Description

Manages a hierarchy of 2D coordinate frames and enables SE(2) transforms and GPS conversion.

FrameMgr2D is designed for robotics and navigation applications where multiple coordinate frames (such as world, robot base, and sensors) must be related and transformed. It supports:

Typical usage:

Example:

Frame2D base(FrameType::BASE, 0, world, Transform2D(1.0, 2.0, 45));
mgr.setGPS(world, GPSCoordinate(48.8584, 2.2945, 35)); // Eiffel Tower
Coordinate robot_local(0.5, 0.0); // 0.5m ahead in base frame
// Convert robot position in base frame to GPS
GPSCoordinate robot_gps = mgr.toGPS(base);
A generic 3D coordinate class for robotics, navigation, and spatial calculations.
Definition: Coordinate.h:57
Manages a hierarchy of 2D coordinate frames and enables SE(2) transforms and GPS conversion.
Definition: FrameMgr2D.h:196
GPSCoordinate toGPS(const Frame2D &frame) const
Converts a local frame to a GPS coordinate.
Definition: FrameMgr2D.h:211
void setGPS(Frame2D &parent, const GPSCoordinate gps, float rotationDeg=90)
Definition: FrameMgr2D.h:203
Represents a geodetic GPS coordinate with latitude, longitude, and optional altitude.
Definition: GPSCoordinate.h:52
Represents a 2D rigid body transform (SE(2)): translation and rotation.
Definition: FrameMgr2D.h:42
@ WORLD
World/global reference frame (fixed, absolute)
@ BASE
Robot or vehicle base frame (body frame)
Represents a 2D coordinate frame in a hierarchical frame tree.
Definition: FrameMgr2D.h:130

This class is suitable for embedded and desktop robotics systems that require flexible, hierarchical frame management and integration with GPS.

Member Function Documentation

◆ getTransform()

Transform2D getTransform ( const Frame2D from,
const Frame2D to 
) const
inline

Computes the transform from one frame to another using SE(2) math.

Parameters
fromThe starting frame.
toThe target frame.
Returns
The composed transform from 'from' to 'to'.

◆ setGPS()

void setGPS ( Frame2D parent,
const GPSCoordinate  gps,
float  rotationDeg = 90 
)
inline

Defines the GPI coordinate for the indicated parent frame. The GPS coordinate is assumed to be facing north (90 degrees) by default, but a different rotation can be specified if needed.


The documentation for this class was generated from the following file: