47 #ifndef _MIRA_TOPOMAPPATHOBJECTIVE_H_ 48 #define _MIRA_TOPOMAPPATHOBJECTIVE_H_ 51 #include <navigation/tasks/PositionTask.h> 53 #include <pilot/Pilot.h> 54 #include <pilot/Objective.h> 55 #include <pilot/PathObjectiveBase.h> 57 #include <model/Marker.h> 59 #include <maps/OccupancyGrid.h> 66 namespace viros {
namespace topomap {
75 template<
typename Reflector>
82 "If called, the objective will wait for the next InitCostMap update before updating the path");
85 this,
"Define additional costs for a specific link.",
86 "fromGWName",
"from this gateway",
"Gateway1",
87 "toGWName",
"to this gateway",
"Gateway2",
88 "cost",
"additional cost from gateway1 to gateway2", 5);
90 this,
"Reset all additional gateways costs to zero.");
95 virtual void setTask(boost::shared_ptr<navigation::Task> task);
96 virtual bool inGoalRegion(
const Pose2& iRobotInMap,
const Point2f& iGoalInMap,
const boost::shared_ptr<navigation::PositionTask>& task);
101 virtual Vote
vote(
const mira::robot::PoseVelocityTrajectory& trajectory,
float lookAheadTime);
144 virtual bool causesWork(navigation::TaskPtr task);
161 boost::shared_ptr<navigation::PositionTask>
mTask;
Definition: PathObjective.h:70
virtual bool inGoalRegion(const Pose2 &iRobotInMap, const Point2f &iGoalInMap, const boost::shared_ptr< navigation::PositionTask > &task)
std::list< NodePosition > NodePositionList
Definition: MetricCostmapTopoMapPlanner.h:143
virtual bool haveValidPath()
Is called in prepareVote() to check if the current path is valid and ready to be used.
void reflect(Reflector &r)
Definition: PathObjective.h:76
Channel< maps::GridMap< double > > mCurrentMapChannel
Definition: PathObjective.h:188
virtual void plan(Duration plantime)
Hybrid metric-topological planner for 2D costmaps.
Definition: MetricCostmapTopoMapPlanner.h:52
virtual Vote vote(const mira::robot::PoseVelocityTrajectory &trajectory, float lookAheadTime)
#define MIRA_REFLECT_BASE(reflector, BaseClass)
boost::shared_ptr< GatewayNode > GatewayNodePtr
Definition: TopoMapFwd.h:87
bool mHaveValidPath
Definition: PathObjective.h:164
void setGoal(const Point2f &goal, const std::string &frame)
virtual bool causesWork(navigation::TaskPtr task)
Channel< maps::GridMap< double > > mInitMapChannel
Definition: PathObjective.h:187
bool mWaitForInitCostMapUpdate
Definition: PathObjective.h:153
virtual void setTask(boost::shared_ptr< navigation::Task > task)
Channel< MetricCostmapTopoMapPlanner::NextSubGoal > mDbgNextSubGoalChannel
Definition: PathObjective.h:158
TopoMapPtr mTopoMap
Definition: PathObjective.h:148
virtual bool reachedTask()
void reflect(Reflector &r)
Definition: MetricCostmapTopoMapPlanner.h:61
virtual bool inGoalHysteresis() const
Channel< std::vector< Point2f > > mPathChannel
Definition: PathObjective.h:159
MetricCostmapTopoMapPlanner mPlanner
Definition: PathObjective.h:185
virtual void prepareVote(float lookAheadTime)
Definition: MetricCostmapTopoMapPlanner.h:145
double mOffset
Definition: PathObjective.h:150
Channel< maps::GridMap< uint8, 3 > > mDbgNavStatusChannel
Definition: PathObjective.h:156
virtual void initialize()
boost::shared_ptr< navigation::PositionTask > mTask
Definition: PathObjective.h:161
boost::optional< uint32 > mLastSequence
Definition: PathObjective.h:189
void computeLeafCosts(NodePtr node)
void waitForInitCostMapUpdate()
If called the objective will wait for the next InitCostMap update before updating the path...
Definition: PathObjective.h:134
void setAdditionalLinkCosts(const std::string &fromGWName, const std::string &toGWName, double costs)
Definition: MetricCostmapTopoMapPlanner.h:266
void localizeGoalWorld(NodePtr node, const Point2f &pos, const std::string &goalFrame, MetricCostmapTopoMapPlanner::NodePositionList &nodes, bool stayWithinMapTf)
void resetAllAdditionalLinkCosts()
Reset all additional gateways costs to zero.
Definition: PathObjective.h:127
void localizeGoal(NodePtr node, const std::string &frame, const Point2i &cell, const Point2f &posinmap, MetricCostmapTopoMapPlanner::NodePositionList &nodes)
void setAdditionalLinkCosts(const std::string &fromGWName, const std::string &toGWName, double costs)
Define additional costs for a specific link.
Definition: PathObjective.h:120
bool mInGoalHysteresis
Definition: PathObjective.h:152
boost::shared_ptr< TopoMap > TopoMapPtr
Definition: TopoMapFwd.h:91
boost::shared_ptr< Node > NodePtr
Definition: TopoMapFwd.h:84
Definition: MetricCostmapTopoMapPlanner.h:45
void resetAllAdditionalLinkCosts()
Definition: MetricCostmapTopoMapPlanner.h:269
void onInitCostMapChanged(ChannelRead< maps::GridMap< double >> data)
Channel< std::vector< std::string > > mLocalizedNodesChannel
Definition: PathObjective.h:155
Channel< mira::model::Marker > mDbgMarkerChannel
Definition: PathObjective.h:157
virtual void updateMetricPlannerGoal(mira::pilot::AbstractMetricPlannerPtr planner, bool initial)
Is called in plan to set or update the goal position, if the goal is moving, e.g. ...