30 #ifndef _MIRA_PILOT_ABSTRACTOBJECTIVEBASEDPLANNER_H_ 31 #define _MIRA_PILOT_ABSTRACTOBJECTIVEBASEDPLANNER_H_ 33 #include <serialization/adapters/std/list> 46 namespace mira {
namespace pilot {
55 template<
typename Reflector>
59 "The planning horizon [ms]. It should be equal or" 66 "Number of samples along the predicted trajectory (default: 10)", 10);
68 "How long is it allowed to have no valid velocity command",
Duration::seconds(10));
69 r.property(
"Objectives",
mObjectives,
"The objectives");
72 "Enable/Disable an objective which is specified by its class name",
73 "name",
"The objective's name",
"PathObjective",
74 "enable",
"true/false to enable/disable",
true);
85 virtual void setTask(boost::shared_ptr<navigation::Task> task);
116 void addObjective(boost::shared_ptr<Objective> o,
float weight);
118 boost::shared_ptr<Objective>
getObjective(
const std::string& name);
139 template<
typename Reflector>
145 "Do the objective has some work");
147 "Does the objective has reached its task?");
151 r.property(
"Disabled",
disabled,
"If true, the objective is disabled",
false);
152 r.property(
"Weight",
weight,
"The weight for this objective",1.0f);
153 r.property(
"Objective",
objective,
"The objective");
204 float lookAheadTime);
robot::UnicycleBasedRobotModelPtr getRobotModel()
Definition: AbstractObjectiveBasedPlanner.h:129
Time mLastCommand
Definition: AbstractObjectiveBasedPlanner.h:192
virtual void update()
is called before plan even if there is no plantime left
void reflect(Reflector &r)
Definition: AbstractObjectiveBasedPlanner.h:56
tick_type milliseconds() const
robot::UnicycleBasedRobotModelPtr mRobotModel
Definition: AbstractObjectiveBasedPlanner.h:194
Duration mMaxLookAhead
Definition: AbstractObjectiveBasedPlanner.h:188
bool reachedTask() const
Definition: AbstractObjectiveBasedPlanner.h:169
std::vector< PoseVelocityTrajectorySample, Eigen::aligned_allocator< PoseVelocityTrajectorySample > > PoseVelocityTrajectory
void informDecision(const robot::PoseVelocityTrajectory &chosen, float dt)
virtual void initialize()
virtual bool satisfied()
Returns true when all objectives are satisfied with the progress of their respective tasks...
virtual void setTask(boost::shared_ptr< navigation::Task > task)
PropertyHint enumeration(const std::string &values)
Definition: AbstractObjectiveBasedPlanner.h:133
Duration mMaxNoCommandTime
Definition: AbstractObjectiveBasedPlanner.h:191
bool isActive() const
returns true, if the objective is enabled and has work, hence if it is active.
Definition: AbstractObjectiveBasedPlanner.h:174
boost::shared_ptr< UnicycleBasedRobotModel > UnicycleBasedRobotModelPtr
virtual void updateRobotModel()
Update the robot model. Default implementation is empty.
Objectives mObjectives
Definition: AbstractObjectiveBasedPlanner.h:182
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
int mTrajectorySamples
Definition: AbstractObjectiveBasedPlanner.h:189
void reflect(Reflector &r)
Definition: AbstractObjectiveBasedPlanner.h:140
std::list< ObjectiveInfo > Objectives
Definition: AbstractObjectiveBasedPlanner.h:181
virtual void plan(Duration plantime)
Satisfaction
Definition: Objective.h:64
Duration mPlanningHorizon
Definition: AbstractObjectiveBasedPlanner.h:186
void resetDissatisfaction()
Definition: AbstractObjectiveBasedPlanner.h:160
void addObjective(boost::shared_ptr< Objective > o, float weight)
Adds a new objective to the dynamic window with the weight.
Duration mMinLookAhead
Definition: AbstractObjectiveBasedPlanner.h:187
Definition: AbstractPlanner.h:49
virtual std::list< DissatisfactionReason > getDissatisfactionReasons()
Returns reasons (strings) that caused the overall state of dissatisfaction.
void enableObjective(const std::string &name, bool enable)
Returns the objective with the given name, if available.
bool disabled
Definition: AbstractObjectiveBasedPlanner.h:178
Objective::Satisfaction getSatisfaction()
Definition: AbstractObjectiveBasedPlanner.h:156
boost::shared_ptr< Objective > objective
Definition: AbstractObjectiveBasedPlanner.h:176
void prepareVote(float dt)
Definition: AbstractObjectiveBasedPlanner.h:50
float weight
Definition: AbstractObjectiveBasedPlanner.h:177
robot::PoseVelocityTrajectory generateTrajectory(Velocity2 v, const Velocity2 &targetv, float lookAheadTime)
Definition: Objective.h:68
boost::shared_ptr< Objective > getObjective(const std::string &name)
bool hasWork() const
Definition: AbstractObjectiveBasedPlanner.h:165
virtual bool reachedTasks()
Returns true, if all objectives have reached their task.
ObjectiveInfo(boost::shared_ptr< Objective > o, float w)
Definition: AbstractObjectiveBasedPlanner.h:136
ObjectiveInfo()
Definition: AbstractObjectiveBasedPlanner.h:135
virtual void resetDissatisfaction()
Reset any kind of dissatisfaction.