MIRA
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AbstractMetricPlanner Class Referenceabstract

Interface for metric planners like Dijkstra and E*. More...

#include <pilot/AbstractMetricPlanner.h>

Inheritance diagram for AbstractMetricPlanner:
Inheritance graph
[legend]

Public Types

enum  Status {
  OUT_OF_GRID, VALID, INVALID, WAVEFRONT,
  OUTDATED, GOAL, OBSTACLE
}
 Planner status of a fixed position (planner map cell) More...
 
typedef std::vector< Point2fCarrot
 
typedef std::function< float(int x, int y, float r)> CostFn
 Type declaration for a cost function to be used with setGoal(const Polygon2i, ...) or setGoal(const Polygon2f, ...). More...
 
enum  Flags
 
typedef std::multimap< std::string, std::string > ChannelNameMapping
 
typedef std::map< std::string, StatusChannelStatusMap
 
typedef std::map< std::string, StatusStatusMap
 

Public Member Functions

 AbstractMetricPlanner ()
 
virtual ~AbstractMetricPlanner ()
 
void initialize (Authority *parent)
 
virtual Point2f getGradient (const Point2f &worldPos) const =0
 Returns the gradient for a position in world coordinates. More...
 
void update (const maps::CostMap &map)
 Update the planning context with the current costmap (entire area). More...
 
virtual void update (const maps::CostMap &map, const maps::DirtyRegions &dirty)=0
 Update the planning context with the current costmap (dirty regions only) More...
 
virtual void setOnewayMap (const maps::OccupancyGrid &onewayMap)=0
 Set a map describing oneway road restrictions. More...
 
virtual double infinity () const =0
 Returns the value that is returned by getValue() when cost values are not yet computed or are infinite. More...
 
virtual double getValue (const Point2f &worldPos, bool ignoreDoubleBuffer=false) const =0
 Returns the cost value at position (in world coordinates) in the planner map. More...
 
virtual double getValueFiltered (const Point2f &worldPos, bool ignoreDoubleBuffer=false) const =0
 Returns the interpolated cost value at position (in world coordinates) in the planner map. More...
 
virtual Carrot getCarrot (const Point2f &pos, int maxCount, float maxDistance=1e10f) const =0
 Return the optimal path to the goal, starting at pos. More...
 
virtual Pose2 getCurrentGoal (const Point2f &pos) const =0
 Return the current goal point. More...
 
virtual Point2i world2map (const Point2f &p) const =0
 Convert a given point to integer map coordinates. More...
 
virtual Point2f map2world (const Point2i &p) const =0
 Convert a given point to world coordinates. More...
 
virtual float getCellSize () const =0
 Get planner map cell size. More...
 
virtual Rect2f getRegion () const =0
 Get planner map area (world coordinates) More...
 
virtual Rect2i getMapRegion () const =0
 Get planner map area (map coordinates) More...
 
virtual Duration getAccumulatedPlanningTime () const =0
 Get accumulated planning time since goal was set. More...
 
virtual void setRobotPosition (const Point2f &robotPos)
 Set the current robot position in planner (world position) Base implementation is empty. More...
 
virtual void setGoal (const Point2f &goal, float radius, bool clearDoubleBuffer=true, bool prepareNew=true)=0
 
virtual void setGoal (const Polygon2i &polygon, int radius=1, bool clearDoubleBuffer=true, bool prepareNew=true)=0
 Sets the interior of the polygon as goal region and additionally adds an optional goal border with the specified radius where the initial costs are set for seeding the wavefront propagation. More...
 
virtual void setGoal (const Polygon2f &polygon, float radius=0.1f, bool clearDoubleBuffer=true, bool prepareNew=true)=0
 Same as above but takes world coordinates in meter. More...
 
virtual void setGoal (const Polygon2i &polygon, int radius, CostFn &costFn, bool clearDoubleBuffer=true, bool prepareNew=true)=0
 Same as above but additionally allows to specify a cost function that is called for each cell within the polygon to compute the initial costs of that cell. More...
 
virtual void setGoal (const Polygon2f &polygon, float radius, CostFn &costFn, bool clearDoubleBuffer=true, bool prepareNew=true)=0
 Same as above but takes world coordinates in meter. More...
 
virtual bool hasValidGoal () const =0
 Check if the internal planner has a goal. More...
 
virtual void plan (const Point2f &pos, Duration plantime)=0
 High level planning interface. More...
 
virtual bool havePlan () const =0
 Returns if we have or have had a valid path to the set goal. More...
 
virtual bool havePlanSinceUpdate () const =0
 Returns if we have or have had a valid path to the set goal, after the cost map was updated. More...
 
virtual Time lastValidPlan () const =0
 Return last time a valid plan existed. More...
 
virtual bool haveWork () const =0
 Low level planning interface. More...
 
virtual void planTime (Duration plantime)=0
 Low level planning interface. More...
 
virtual void planSteps (int steps)=0
 Low level planning interface. More...
 
virtual void planStep ()=0
 Low level planning interface. More...
 
virtual void resetPlanningTimeout ()=0
 Reset initial last plan time that is used for timeout. More...
 
virtual maps::CostMap getNavFunction (bool ignoreDoubleBuffer=false) const =0
 Creates a deep copy of the navigation function that contains the accumulated costs from each cell to the goal as a potential field. More...
 
virtual maps::GridMap< uint8, 3 > dumpNavStatus (bool useDoubleBuffer=false, bool costsInGoalRegion=true)=0
 Create a color image of the navigation function (for user presentation, debugging). More...
 
virtual maps::GridMap< uint8, 3 > showNavFunctionNearGoal ()=0
 Create high-res image of navigation function in goal area (for user presentation, debugging). More...
 
virtual Status getStatus (const Point2f &p) const =0
 Return planner status at world position. More...
 
Class const & getClass () const
 
void reflect (Reflector &r)
 
void enableSubscriberCallbacks (bool enable)
 
StatusManagergetStatusManager ()
 
void setHeartbeatInterval (const Duration &interval)
 
void setName (const std::string &name)
 
Duration getHeartbeatInterval () const
 
void heartbeat ()
 
bool hasHeartbeatTimeout () const
 
void bootup (const std::string &message, const std::string &trText="")
 
void bootupFinished ()
 
void recoverFinished ()
 
void recover (const std::string &message, const std::string &trText="")
 
void ok (const std::string &category="")
 
bool warning (const std::string &category, const std::string &message, const std::string &trText="")
 
bool error (const std::string &category, const std::string &message, const std::string &trText="")
 
bool setStatus (Status::StatusMode mode, const std::string &category, const std::string &message, const std::string &trText="")
 
Status::StatusMode getStatus () const
 
StatusMap getStatusMap () const
 
StatusManager::StatusMap getStatusMap () override
 
StatusManager::StatusMap getStatusMap () override
 
void checkin (const ResourceName &fullname, AuthorityRuntimePtr runtime=AuthorityRuntimePtr())
 
void checkin (const ResourceName &ns, const std::string &name, AuthorityRuntimePtr runtime=AuthorityRuntimePtr())
 
void checkin (Authority &iParent, const ResourceName &ns, const std::string &name)
 
void checkin (Authority &iParent, const std::string &name)
 
void checkin (const ResourceName &fullname, AuthorityRuntimePtr runtime=AuthorityRuntimePtr())
 
void checkin (const ResourceName &ns, const std::string &name, AuthorityRuntimePtr runtime=AuthorityRuntimePtr())
 
void checkin (Authority &iParent, const ResourceName &ns, const std::string &name)
 
void checkin (Authority &iParent, const std::string &name)
 
void checkout ()
 
void checkout ()
 
bool isValid () const
 
bool isValid () const
 
void validate () const
 
void validate () const
 
void startWithParent (bool start)
 
void startWithParent (bool start)
 
AuthorityRuntimePtr getRuntime ()
 
AuthorityRuntimePtr getRuntime ()
 
std::set< Authority *> getChildren ()
 
std::set< Authority *> getChildren ()
 
void addImmediateHandler (DiagnosticRunnablePtr runnable)
 
void addImmediateHandler (DiagnosticRunnablePtr runnable)
 
void addImmediateHandlerFunction (F &&fn)
 
void addImmediateHandlerFunction (F &&fn)
 
void addFinalizeHandler (DiagnosticRunnablePtr runnable)
 
void addFinalizeHandler (DiagnosticRunnablePtr runnable)
 
void addFinalizeHandlerFunction (F &&fn)
 
void addFinalizeHandlerFunction (F &&fn)
 
TimerPtr createTimer (Duration period, TimerCallback callback, bool oneshot=false)
 
TimerPtr createTimer (Duration period, Duration tolerance, TimerCallback callback, bool oneshot=false)
 
TimerPtr createTimer (Duration period, void(Class::*f)(const Timer &), Class *obj, bool oneshot=false)
 
TimerPtr createTimer (Duration period, void(Class::*f)(const Timer &), bool oneshot=false)
 
TimerPtr createTimer (Duration period, Duration tolerance, void(Class::*f)(const Timer &), Class *obj, bool oneshot=false)
 
TimerPtr createTimer (Duration period, Duration tolerance, void(Class::*f)(const Timer &), bool oneshot=false)
 
TimerPtr createTimer (Time time, TimerCallback callback)
 
TimerPtr createTimer (Time time, void(Class::*f)(const Timer &), Class *obj)
 
TimerPtr createTimer (Time time, void(Class::*f)(const Timer &))
 
TimerPtr createTimer (Duration period, TimerCallback callback, bool oneshot=false)
 
TimerPtr createTimer (Duration period, Duration tolerance, TimerCallback callback, bool oneshot=false)
 
TimerPtr createTimer (Duration period, void(Class::*f)(const Timer &), Class *obj, bool oneshot=false)
 
TimerPtr createTimer (Duration period, void(Class::*f)(const Timer &), bool oneshot=false)
 
TimerPtr createTimer (Duration period, Duration tolerance, void(Class::*f)(const Timer &), Class *obj, bool oneshot=false)
 
TimerPtr createTimer (Duration period, Duration tolerance, void(Class::*f)(const Timer &), bool oneshot=false)
 
TimerPtr createTimer (Time time, TimerCallback callback)
 
TimerPtr createTimer (Time time, void(Class::*f)(const Timer &), Class *obj)
 
TimerPtr createTimer (Time time, void(Class::*f)(const Timer &))
 
void removeTimer (TimerPtr timer)
 
void removeTimer (TimerPtr timer)
 
void start () override
 
void start () override
 
void stop () override
 
void stop () override
 
bool spin (const Duration &maxWait=Duration::infinity())
 
bool spin (const Duration &maxWait=Duration::infinity())
 
bool hasWork (Time horizon=Time::now()) const
 
bool hasWork (Time horizon=Time::now()) const
 
bool hasUnrecoverableFailure () const override
 
bool hasUnrecoverableFailure () const override
 
bool isStarted () const override
 
bool isStarted () const override
 
bool isRunning () const override
 
bool isRunning () const override
 
std::string resolveName (const std::string &name) const
 
std::string resolveName (const std::string &name) const
 
std::string resolveServiceName (const std::string &name) const
 
std::string resolveServiceName (const std::string &name) const
 
Channel< T > publish (const std::string &channelID)
 
Channel< T > publish (const std::string &channelID, const Typename &type)
 
Channel< T > publish (const std::string &channelID)
 
Channel< T > publish (const std::string &channelID, const Typename &type)
 
void unpublish (const std::string &channelID)
 
void unpublish (const std::string &channelID)
 
Channel< T > subscribe (const std::string &channelID, const Duration &storageDuration=Duration::seconds(0))
 
Channel< T > subscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > subscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, bool independentThread)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, bool independentThread)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), bool independentThread)
 
Channel< T > subscribe (const std::string &channelID, const Duration &storageDuration=Duration::seconds(0))
 
Channel< T > subscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > subscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, bool independentThread)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, bool independentThread)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > subscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), bool independentThread)
 
Channel< T > publishAndSubscribe (const std::string &channelID, const Duration &storageDuration=Duration::seconds(0))
 
Channel< T > publishAndSubscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > publishAndSubscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, bool independentThread)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, bool independentThread)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), bool independentThread)
 
Channel< T > publishAndSubscribe (const std::string &channelID, const Duration &storageDuration=Duration::seconds(0))
 
Channel< T > publishAndSubscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > publishAndSubscribe (const std::string &channelID, boost::function< void(ChannelRead< T >)> fn, bool independentThread)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, bool independentThread)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false)
 
Channel< T > publishAndSubscribe (const std::string &channelID, void(Class::*f)(ChannelRead< T >), bool independentThread)
 
Channel< T > subscribeInterval (const std::string &channelID, boost::function< void(ChannelReadInterval< T >)> fn, const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeInterval (const std::string &channelID, void(Class::*f)(ChannelReadInterval< T >), Class *obj, const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeInterval (const std::string &channelID, void(Class::*f)(ChannelReadInterval< T >), const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeInterval (const std::string &channelID, boost::function< void(ChannelReadInterval< T >)> fn, const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeInterval (const std::string &channelID, void(Class::*f)(ChannelReadInterval< T >), Class *obj, const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeInterval (const std::string &channelID, void(Class::*f)(ChannelReadInterval< T >), const Duration &storageDuration, bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeIntervalByElements (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeIntervalByElements (const std::string &channelID, boost::function< void(ChannelRead< T >)>, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeIntervalByElements (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeIntervalByElements (const std::string &channelID, void(Class::*f)(ChannelRead< T >), Class *obj, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeIntervalByElements (const std::string &channelID, boost::function< void(ChannelRead< T >)>, const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
Channel< T > subscribeIntervalByElements (const std::string &channelID, void(Class::*f)(ChannelRead< T >), const Duration &storageDuration=Duration::seconds(0), bool independentThread=false, const Time &startAfter=Time::unixEpoch())
 
ChannelRead< T > waitForData (Channel< T > channel, Duration timeout=Duration::infinity()) const
 
ChannelRead< T > waitForData (Channel< T > channel, Duration timeout=Duration::infinity()) const
 
void unsubscribe (const std::string &channelID)
 
void unsubscribe (const std::string &channelID)
 
void unsubscribe (const std::string &channelID)
 
void unsubscribe (const std::string &channelID)
 
Channel< T > getChannel (const std::string &channelID)
 
Channel< T > getChannel (const std::string &channelID)
 
bool isSubscribedOn (const std::string &channelID) const
 
bool isSubscribedOn (const std::string &channelID) const
 
 MIRA_DEPRECATED ("Please use isSubscribedOn() instead", bool hasSubscribedOn(const std::string &channelID) const)
 
 MIRA_DEPRECATED ("Please use isSubscribedOn() instead", bool hasSubscribedOn(const std::string &channelID) const)
 
bool hasPublished (const std::string &channelID) const
 
bool hasPublished (const std::string &channelID) const
 
bool doesChannelExist (const std::string &channelID) const
 
bool doesChannelExist (const std::string &channelID) const
 
bool waitForChannel (const std::string &channelID, const Duration &timeout=Duration::infinity()) const
 
bool waitForChannel (const std::string &channelID, const Duration &timeout=Duration::infinity()) const
 
bool isTransformAvailable (const std::string &targetID, const std::string &sourceID) const
 
bool isTransformAvailable (const std::string &targetID, const std::string &sourceID, const std::string &fixedID) const
 
bool isTransformAvailable (const std::string &targetID, const std::string &sourceID) const
 
bool isTransformAvailable (const std::string &targetID, const std::string &sourceID, const std::string &fixedID) const
 
bool waitForTransform (const std::string &targetID, const std::string &sourceID, Duration timeout=Duration::invalid()) const
 
bool waitForTransform (const std::string &targetID, const std::string &sourceID, const std::string &fixedID, Duration timeout=Duration::invalid()) const
 
bool waitForTransform (const std::string &targetID, const std::string &sourceID, Duration timeout=Duration::invalid()) const
 
bool waitForTransform (const std::string &targetID, const std::string &sourceID, const std::string &fixedID, Duration timeout=Duration::invalid()) const
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, boost::function< void(Transform, Time)> fn, Filter &&filter)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Class *obj, Filter &&filter)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Filter &&filter)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, boost::function< void(Transform, Time)> fn)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Class *obj)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time))
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, boost::function< void(Transform, Time)> fn, Filter &&filter)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Class *obj, Filter &&filter)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Filter &&filter)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, boost::function< void(Transform, Time)> fn)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time), Class *obj)
 
void subscribeTransform (const std::string &targetID, const std::string &sourceID, void(Class::*f)(Transform, Time))
 
Transform getTransform (const std::string &targetID, const std::string &sourceID, const Time &time, Filter &&filter) const
 
Transform getTransform (const std::string &targetID, const std::string &sourceID, const Time &time=Time()) const
 
Transform getTransform (const std::string &targetID, const Time &targetTime, const std::string &sourceID, const Time &sourceTime, const std::string &fixedID, Filter &&filter) const
 
Transform getTransform (const std::string &targetID, const Time &targetTime, const std::string &sourceID, const Time &sourceTime, const std::string &fixedID) const
 
Transform getTransform (const TransformDesc &desc, const Time &time, Filter &&filter) const
 
Transform getTransform (const TransformDesc &desc, const Time &time=Time()) const
 
Transform getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime, Filter &&filter) const
 
Transform getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime) const
 
Transform getTransform (const std::string &targetID, const std::string &sourceID, const Time &time, Filter &&filter) const
 
Transform getTransform (const std::string &targetID, const std::string &sourceID, const Time &time=Time()) const
 
Transform getTransform (const std::string &targetID, const Time &targetTime, const std::string &sourceID, const Time &sourceTime, const std::string &fixedID, Filter &&filter) const
 
Transform getTransform (const std::string &targetID, const Time &targetTime, const std::string &sourceID, const Time &sourceTime, const std::string &fixedID) const
 
Transform getTransform (const TransformDesc &desc, const Time &time, Filter &&filter) const
 
Transform getTransform (const TransformDesc &desc, const Time &time=Time()) const
 
Transform getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime, Filter &&filter) const
 
Transform getTransform (const TransformDesc &desc, const Time &targetTime, const Time &sourceTime) const
 
FrameworkTransformerNodegetTransformNode (const std::string &frameID) const
 
FrameworkTransformerNodegetTransformNode (const std::string &frameID) const
 
TransformDesc prepareTransform (const std::string &targetID, const std::string &sourceID) const
 
TransformDesc prepareTransform (const std::string &targetID, const std::string &sourceID, const std::string &fixedID) const
 
TransformDesc prepareTransform (const std::string &targetID, const std::string &sourceID) const
 
TransformDesc prepareTransform (const std::string &targetID, const std::string &sourceID, const std::string &fixedID) const
 
void publishTransform (const std::string &frameID, const Transform &transform, const Time &time) const
 
void publishTransform (const std::string &frameID, const Transform &transform, const Time &time) const
 
void publishTransformIndirect (const std::string &frameID, const std::string &targetID, const std::string &sourceID, const Transform &transform, const Time &time, Filter &&filter=NearestNeighborInterpolator()) const
 
void publishTransformIndirect (const std::string &frameID, const std::string &targetID, const std::string &sourceID, const Transform &transform, const Time &time, Filter &&filter=NearestNeighborInterpolator()) const
 
void addTransformLink (const std::string &childID, const std::string &parentID) const
 
void addTransformLink (const std::string &childID, const std::string &parentID, FrameworkTransformerNode::Type type) const
 
void addTransformLink (const std::string &childID, const std::string &parentID) const
 
void addTransformLink (const std::string &childID, const std::string &parentID, FrameworkTransformerNode::Type type) const
 
void publishService (const std::string &name, Service &iService, RPCHandlerPtr handler=RPCHandlerPtr())
 
void publishService (Service &iService, RPCHandlerPtr handler=RPCHandlerPtr())
 
void publishService (const std::string &name, Service &iService, RPCHandlerPtr handler=RPCHandlerPtr())
 
void publishService (Service &iService, RPCHandlerPtr handler=RPCHandlerPtr())
 
void unpublishService ()
 
void unpublishService (const std::string &name)
 
void unpublishService ()
 
void unpublishService (const std::string &name)
 
RPCFuture< R > callService (const std::string &iService, const std::string &method, ARGS &&... args) const
 
RPCFuture< R > callService (const std::string &iService, const std::string &method, ARGS &&... args) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const json::Value &jsonRequest) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const std::string &jsonString) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const std::string &service, const std::string &method, const json::Value &params=json::Value()) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const std::string &service, const std::string &method, const std::string &params) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const RPCCallDefinition &rpc) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const json::Value &jsonRequest) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const std::string &jsonString) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const std::string &service, const std::string &method, const json::Value &params=json::Value()) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const std::string &service, const std::string &method, const std::string &params) const
 
RPCFuture< JSONRPCResponsecallServiceJSON (const RPCCallDefinition &rpc) const
 
ServiceCall< F > createServiceCall (const std::string &service, std::string method, bool waitTillExists=true, bool showBootupMsg=true)
 
ServiceCall< F > createServiceCall (const std::string &service, std::string method, bool waitTillExists=true, bool showBootupMsg=true)
 
bool existsService (const std::string &name) const
 
bool existsService (const std::string &name) const
 
bool implementsInterface (const std::string &name, const std::string &interface) const
 
bool implementsInterface (const std::string &name, const std::string &interface) const
 
bool waitForService (const std::string &name, Duration timeout=Duration::invalid()) const
 
bool waitForService (const std::string &name, Duration timeout=Duration::invalid()) const
 
std::string waitForServiceInterface (const std::string &interface, Duration timeout=Duration::invalid()) const
 
std::string waitForServiceInterface (const std::string &interface, Duration timeout=Duration::invalid()) const
 
std::list< std::string > queryServicesForInterface (const std::string &interface) const
 
std::list< std::string > queryServicesForInterface (const std::string &interface) const
 
void registerCallbackForInterface (const std::string &interface, ServiceInterfaceHandler::Callback cb)
 
void registerCallbackForInterface (const std::string &interface, void(Class::*f)(const std::string &, const std::string &), Class *obj)
 
void registerCallbackForInterface (const std::string &interface, ServiceInterfaceHandler::Callback cb)
 
void registerCallbackForInterface (const std::string &interface, void(Class::*f)(const std::string &, const std::string &), Class *obj)
 
boost::shared_ptr< PropertyNodegetProperties () override
 
boost::shared_ptr< PropertyNodegetProperties () override
 
std::set< std::string > getPublishedChannels () override
 
std::set< std::string > getPublishedChannels () override
 
std::set< std::string > getSubscribedChannels () override
 
std::set< std::string > getSubscribedChannels () override
 
std::set< std::string > getServiceInterfaces () override
 
std::set< std::string > getServiceInterfaces () override
 
ChannelNameMapping getPublishedChannelNames () override
 
ChannelNameMapping getPublishedChannelNames () override
 
ChannelNameMapping getSubscribedChannelNames () override
 
ChannelNameMapping getSubscribedChannelNames () override
 
ChannelStatusMap getSubscribedChannelStatus () override
 
ChannelStatusMap getSubscribedChannelStatus () override
 
std::string getNamespace () const
 
std::string getNamespace () const
 
std::string getGlobalName () const
 
std::string getGlobalName () const
 
std::string getGlobalID () const
 
std::string getGlobalID () const
 
std::string getID () const
 
std::string getID () const
 
std::string getName () const
 
std::string getName () const
 
const AuthorityDescriptiongetDescription () const
 
const AuthorityDescriptiongetDescription () const
 

Static Public Member Functions

static PseudoClass const & CLASS ()
 

Public Attributes

 NORMAL
 
 ANONYMOUS
 
 HIDDEN
 
 INVISIBLE_PUBLISHER_SUBSCRIBER
 
 INTERNAL
 
 INDEPENDENT_SUBSCRIBER_THREAD
 
 INDEPENDENT_RPC_THREAD
 
 NO_MAIN_THREAD
 

Protected Types

typedef std::map< std::string, RWAccessFlagsRWAccessMap
 
typedef std::list< AbstractChannelSubscriberPtrSubscribePtrList
 

Protected Member Functions

virtual void initialize ()
 Called in initialize(parent). More...
 
virtual Class const & internalGetClass () const=0
 
Channel< T > toProxy (ConcreteChannel< T > *channel)
 
void setChannelReadAccess (const std::string &channelID)
 
void setChannelWriteAccess (const std::string &channelID)
 
void removeChannelReadAccess (const std::string &channelID)
 
void removeChannelWriteAccess (const std::string &channelID)
 
void insertChannelNameMapping (AbstractAuthority::ChannelNameMapping &map, const std::string &local, const std::string &global)
 
void eraseChannelNameMapping (AbstractAuthority::ChannelNameMapping &map, const std::string &local, const std::string &global)
 
void remotePublishService (const std::string &service) const
 
PropertyTree getPropertiesRPC ()
 
void setProperty (const std::string &property, const std::string &value)
 
std::string getProperty (const std::string &property) const
 
void setPropertyJSON (const std::string &property, const json::Value &value)
 
json::Value getPropertyJSON (const std::string &property) const
 

Protected Attributes

AuthorityDescription mDescription
 
boost::optional< StatusmBootUpStatus
 
boost::optional< StatusmRecoverStatus
 
Duration mHeartbeatInterval
 
boost::optional< TimemLastHeartbeat
 
StatusMap mStatusMap
 
std::string mName
 

Detailed Description

Interface for metric planners like Dijkstra and E*.

Member Typedef Documentation

◆ Carrot

typedef std::vector<Point2f> Carrot

◆ CostFn

typedef std::function<float(int x, int y, float r)> CostFn

Type declaration for a cost function to be used with setGoal(const Polygon2i, ...) or setGoal(const Polygon2f, ...).

CostFn is a function taking parameters int x, int y and float r (a cell's coordinates and distance to goal). The function must return a float value which is the initial cost for cell <x,y>. The distance r is given in cells, and the returned initial costs/distance must be returned in cells (not meter).

Member Enumeration Documentation

◆ Status

enum Status

Planner status of a fixed position (planner map cell)

Enumerator
OUT_OF_GRID 
VALID 
INVALID 
WAVEFRONT 
OUTDATED 
GOAL 
OBSTACLE 

Constructor & Destructor Documentation

◆ AbstractMetricPlanner()

◆ ~AbstractMetricPlanner()

virtual ~AbstractMetricPlanner ( )
inlinevirtual

Member Function Documentation

◆ initialize() [1/2]

void initialize ( Authority parent)

◆ initialize() [2/2]

virtual void initialize ( )
inlineprotectedvirtual

Called in initialize(parent).

Default implementation is empty, can be overwritten in subclasses.

◆ getGradient()

virtual Point2f getGradient ( const Point2f worldPos) const
pure virtual

Returns the gradient for a position in world coordinates.

Implemented in MetricPlannerBase.

◆ update() [1/2]

void update ( const maps::CostMap map)

Update the planning context with the current costmap (entire area).

Calls update(map, {mapArea}) for the actual work.

◆ update() [2/2]

virtual void update ( const maps::CostMap map,
const maps::DirtyRegions dirty 
)
pure virtual

Update the planning context with the current costmap (dirty regions only)

Implemented in MetricPlannerBase.

◆ setOnewayMap()

virtual void setOnewayMap ( const maps::OccupancyGrid onewayMap)
pure virtual

Set a map describing oneway road restrictions.

Implemented in MetricPlannerBase.

◆ infinity()

virtual double infinity ( ) const
pure virtual

Returns the value that is returned by getValue() when cost values are not yet computed or are infinite.

Implemented in MetricPlannerBase, and EstarPlanner.

◆ getValue()

virtual double getValue ( const Point2f worldPos,
bool  ignoreDoubleBuffer = false 
) const
pure virtual

Returns the cost value at position (in world coordinates) in the planner map.

By default the value is taken from the double buffer (if enabled), to ensure the returned value is valid, even while planning is in progress. This can be suppressed by ignoreDoubleBuffer=true.

Implemented in MetricPlannerBase.

◆ getValueFiltered()

virtual double getValueFiltered ( const Point2f worldPos,
bool  ignoreDoubleBuffer = false 
) const
pure virtual

Returns the interpolated cost value at position (in world coordinates) in the planner map.

Interpolation is taking into account the 4 cells closest to position, weighted with their distance.

Implemented in MetricPlannerBase.

◆ getCarrot()

virtual Carrot getCarrot ( const Point2f pos,
int  maxCount,
float  maxDistance = 1e10f 
) const
pure virtual

Return the optimal path to the goal, starting at pos.

The path consists of (x,y) positions. Path length can be limited by maxCount (number of path entries) or maxDistance (distance between pos and path entry). If neither limit is reached before, the path will end at the goal position.

Implemented in MetricPlannerBase.

◆ getCurrentGoal()

virtual Pose2 getCurrentGoal ( const Point2f pos) const
pure virtual

Return the current goal point.

If a point goal is set, return it. If a polygon goal is set (see setGoal), follow the path starting at pos to find out where it ends.

Implemented in MetricPlannerBase.

◆ world2map()

virtual Point2i world2map ( const Point2f p) const
pure virtual

Convert a given point to integer map coordinates.

Parameters
[in]pPoint in world coordinates
Returns
Point in map coordinates
Note
The point is not required to be checked against exceeding the map boundaries.

Implemented in MetricPlannerBase.

◆ map2world()

virtual Point2f map2world ( const Point2i p) const
pure virtual

Convert a given point to world coordinates.

Parameters
[in]pPoint in map coordinates
Returns
Point in world coordinates

Implemented in MetricPlannerBase.

◆ getCellSize()

virtual float getCellSize ( ) const
pure virtual

Get planner map cell size.

Implemented in MetricPlannerBase.

◆ getRegion()

virtual Rect2f getRegion ( ) const
pure virtual

Get planner map area (world coordinates)

Implemented in MetricPlannerBase.

◆ getMapRegion()

virtual Rect2i getMapRegion ( ) const
pure virtual

Get planner map area (map coordinates)

Implemented in MetricPlannerBase.

◆ getAccumulatedPlanningTime()

virtual Duration getAccumulatedPlanningTime ( ) const
pure virtual

Get accumulated planning time since goal was set.

Implemented in MetricPlannerBase.

◆ setRobotPosition()

virtual void setRobotPosition ( const Point2f robotPos)
inlinevirtual

Set the current robot position in planner (world position) Base implementation is empty.

◆ setGoal() [1/5]

virtual void setGoal ( const Point2f goal,
float  radius,
bool  clearDoubleBuffer = true,
bool  prepareNew = true 
)
pure virtual
Parameters
goal
radius
clearDoubleBufferIf the goal moves steadily, it makes sense not to clear the double buffer and thereby follow the old goal until the path to the new goal position is planned
prepareNewdo preparation for new goal, should be false when just trying to set the same goal again, e.g. because the goal region was entirely inaccessible

Implemented in MetricPlannerBase.

◆ setGoal() [2/5]

virtual void setGoal ( const Polygon2i polygon,
int  radius = 1,
bool  clearDoubleBuffer = true,
bool  prepareNew = true 
)
pure virtual

Sets the interior of the polygon as goal region and additionally adds an optional goal border with the specified radius where the initial costs are set for seeding the wavefront propagation.

The coordinates of the polygon are given in map coordinates here.

Implemented in MetricPlannerBase.

◆ setGoal() [3/5]

virtual void setGoal ( const Polygon2f polygon,
float  radius = 0.1f,
bool  clearDoubleBuffer = true,
bool  prepareNew = true 
)
pure virtual

Same as above but takes world coordinates in meter.

Implemented in MetricPlannerBase.

◆ setGoal() [4/5]

virtual void setGoal ( const Polygon2i polygon,
int  radius,
CostFn costFn,
bool  clearDoubleBuffer = true,
bool  prepareNew = true 
)
pure virtual

Same as above but additionally allows to specify a cost function that is called for each cell within the polygon to compute the initial costs of that cell.

Implemented in MetricPlannerBase.

◆ setGoal() [5/5]

virtual void setGoal ( const Polygon2f polygon,
float  radius,
CostFn costFn,
bool  clearDoubleBuffer = true,
bool  prepareNew = true 
)
pure virtual

Same as above but takes world coordinates in meter.

Implemented in MetricPlannerBase.

◆ hasValidGoal()

virtual bool hasValidGoal ( ) const
pure virtual

Check if the internal planner has a goal.

This can be false even after calling setGoal() e.g. if the entire goal region was occupied by obstacles (which might warrant trying to set the goal again after updating the map).

Implemented in EstarPlanner.

◆ plan()

virtual void plan ( const Point2f pos,
Duration  plantime 
)
pure virtual

High level planning interface.

Plans for the specified planning time (or less, if no more work to do). The specified position corresponds to the robots position in map world coordinates. The planning stops when there is no more work to do. Internally the variables for havePlan(), havePlanSinceUpdate() and lastValidPlan() are updated for the given robot position to indicate if a valid path to the goal is available. Internally, this high level planning interface holds several states to detect if the goal cannot be reached:

Exceptions
XPathLostif the planning time is longer than the specified PathLostTimout (and if we had a path before). However, this exception is more like a warning. The planning continues and you can continue to call plan(), until the XNoPath exception occurs.
XNoPlanif the planning time is longer than MaxPlanningTime. This indicates that there is no path to the goal.

Implemented in MetricPlannerBase.

◆ havePlan()

virtual bool havePlan ( ) const
pure virtual

Returns if we have or have had a valid path to the set goal.

Part of the high level planning interface.

Implemented in MetricPlannerBase.

◆ havePlanSinceUpdate()

virtual bool havePlanSinceUpdate ( ) const
pure virtual

Returns if we have or have had a valid path to the set goal, after the cost map was updated.

Part of the high level planning interface.

Implemented in MetricPlannerBase.

◆ lastValidPlan()

virtual Time lastValidPlan ( ) const
pure virtual

Return last time a valid plan existed.

Implemented in MetricPlannerBase.

◆ haveWork()

virtual bool haveWork ( ) const
pure virtual

Low level planning interface.

Returns true, if more planning can be done.

Implemented in EstarPlanner.

◆ planTime()

virtual void planTime ( Duration  plantime)
pure virtual

Low level planning interface.

Plans for the specified planning time (or less, if no more work to do).

Implemented in MetricPlannerBase.

◆ planSteps()

virtual void planSteps ( int  steps)
pure virtual

Low level planning interface.

Performs the specified number of iterations in wavefront propagation (or less, if no more work to do).

Implemented in MetricPlannerBase.

◆ planStep()

virtual void planStep ( )
pure virtual

Low level planning interface.

Performs a single iteration in wavefront propagation.

Implemented in EstarPlanner.

◆ resetPlanningTimeout()

virtual void resetPlanningTimeout ( )
pure virtual

Reset initial last plan time that is used for timeout.

Implemented in MetricPlannerBase.

◆ getNavFunction()

virtual maps::CostMap getNavFunction ( bool  ignoreDoubleBuffer = false) const
pure virtual

Creates a deep copy of the navigation function that contains the accumulated costs from each cell to the goal as a potential field.

By default the value is taken from the double buffer (if enabled). This can be suppressed by ignoreDoubleBuffer=true.

Implemented in MetricPlannerBase.

◆ dumpNavStatus()

virtual maps::GridMap<uint8,3> dumpNavStatus ( bool  useDoubleBuffer = false,
bool  costsInGoalRegion = true 
)
pure virtual

Create a color image of the navigation function (for user presentation, debugging).

Implemented in MetricPlannerBase.

◆ showNavFunctionNearGoal()

virtual maps::GridMap<uint8,3> showNavFunctionNearGoal ( )
pure virtual

Create high-res image of navigation function in goal area (for user presentation, debugging).

Implemented in MetricPlannerBase.

◆ getStatus()

virtual Status getStatus ( const Point2f p) const
pure virtual

Return planner status at world position.

Implemented in MetricPlannerBase.


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