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

Concrete implementation of INavigationState2D for storing and accessing 2D navigation state. More...

#include <MotionState2D.h>

Inheritance diagram for MotionState2D:
Inheritance graph
[legend]
Collaboration diagram for MotionState2D:
Collaboration graph
[legend]

Public Member Functions

 MotionState2D (const Coordinate< DistanceM > &position, const Angle &heading, const Speed &speed)
 Construct a new NavigationState2D object.
 
Coordinate< DistanceM > getPosition () const override
 
Angle getHeading () const override
 
Speed getSpeed () const override
 
- Public Member Functions inherited from IMotionState2D
virtual Coordinate< DistanceM > getPosition () const =0
 
virtual Angle getHeading () const =0
 
virtual Speed getSpeed () const =0
 
virtual Transform2D getTransform () const =0
 
virtual bool begin (Transform2D transform)=0
 
virtual void end ()=0
 
- Public Member Functions inherited from MessageSource
void subscribe (MessageHandler &handler, MessageOrigin origin=MessageOrigin::Undefined, MessageContent content=MessageContent::Undefined)
 Subscribe a message handler to this source, with optional filtering.
 
void unsubscribeAll ()
 Remove all registered message handlers.
 
void sendMessage (Message< float > &msg)
 Publish a message to all registered handlers.
 
void sendMessage (const Message< Coordinate< float > > &msg)
 Publish a message to all registered handlers.
 
void sendMessage (const Message< GPSCoordinate > &msg)
 Publish a message to all registered handlers.
 
void sendMessage (const Message< MotionState3D > &msg)
 Overload for MotionState3D messages.
 

Protected Attributes

Coordinate< DistanceM > position
 
Angle heading
 
Speed speed
 
- Protected Attributes inherited from MessageSource
std::vector< MessageHandlerEntrymessageHandlers_
 

Detailed Description

Concrete implementation of INavigationState2D for storing and accessing 2D navigation state.

Interface for representing the navigation state of a robot in 2D space.

Holds position, heading, and speed values for a robot in 2D space.

Provides access to position, heading (orientation), and speed.

Constructor & Destructor Documentation

◆ MotionState2D()

MotionState2D ( const Coordinate< DistanceM > &  position,
const Angle heading,
const Speed speed 
)
inline

Construct a new NavigationState2D object.

Parameters
positionThe 2D position (meters).
headingThe heading/orientation (radians).
speedThe speed (meters/second).

Member Function Documentation

◆ getHeading()

Angle getHeading ( ) const
inlineoverridevirtual

Implements IMotionState2D.

◆ getPosition()

Coordinate< DistanceM > getPosition ( ) const
inlineoverridevirtual

Implements IMotionState2D.

◆ getSpeed()

Speed getSpeed ( ) const
inlineoverridevirtual

Implements IMotionState2D.


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