reach.hpp
Go to the documentation of this file.
1 
10 #ifndef QTCTRL_REACH_CTRL
11 #define QTCTRL_REACH_CTRL
12 
13 #include <model/state.hpp>
14 #include <ctrl/file.hpp>
15 
25 class ReachingCtrl : public Controller {
26 
29 
30 protected:
32 
33  /* Cf Controller::newState(const State&) */
34  void newState(const State& state) {
35  this->state = state;
36  if ( firstOdometry() )
37  // move the goal into the state's frame
38  setGoal(goal + state.configuration());
39  Controller::newState(state);
40  }
41 
44  virtual void setGoal(const State& new_goal) { goal = new_goal; }
45 
46 public:
56  ReachingCtrl(const MotionModel& model, const double& ts,
57  const State& goal_aimed)
58  : Controller(model, ts), goal(goal_aimed) {}
59 
62  const State& getGoal() const { return goal; }
63 
66  virtual void changeGoal(const State& goal)
67  // Set the goal in local frame & ask for future set in global frame
68  { setGoal(goal); changeFirstOdometry(); }
69 
70 }; // end of class ReachingCtrl
71 
72 #endif // QTCTRL_REACH_CTRL
void changeFirstOdometry()
Change the odometry data status (first or not).
Definition: controller.hpp:80
Controller is the abstract class inherited by all the implemented controllers.
Definition: controller.hpp:28
const State & getGoal() const
Get the state which is aimed.
Definition: reach.hpp:62
State class, i.e. configuration and velocities.
File controller (teleoperation) class.
const iSeeML::rob::OrPtConfig & configuration() const
Gives the configuration of the state.
Definition: state.hpp:67
void newState(const State &state)
Handles new state of the robot.
Definition: reach.hpp:34
virtual void setGoal(const State &new_goal)
Set the state which is aimed.
Definition: reach.hpp:44
virtual void changeGoal(const State &goal)
Change the oriented point which is aimed.
Definition: reach.hpp:66
State state
The state of the robot.
Definition: reach.hpp:31
ReachingCtrl aims at reaching a given state with the robot.
Definition: reach.hpp:25
State goal
The state which is aimed.
Definition: reach.hpp:28
virtual void newState(const State &state)
Handles new state of the robot.
Definition: controller.cpp:16
This class defines a state, i.e. a configuration and its (translation and rotation) velocities...
Definition: state.hpp:22
This class defines a motion model, with the motion limits.
Definition: motion.hpp:28
bool firstOdometry()
Are the odometry data the first?
Definition: controller.hpp:76
ReachingCtrl(const MotionModel &model, const double &ts, const State &goal_aimed)
The constructor needs a motion model, a time step and a goal state (in the robot&#39;s frame)...
Definition: reach.hpp:56


qt_ctrl
Author(s): Alexis Scheuer
autogenerated on Wed Dec 16 2020 15:51:32