analytic.cpp
Go to the documentation of this file.
1 
10 #include <ctrl/analytic.hpp>
11 
12 
13 // Cf Controller::chooseVelocities(...)
14 void AnalyticCtrl::chooseVelocities(double& trans_vel, double& rot_vel,
15  std::ostream& log_str) {
16  // === Following formula have to be changed ========================
17  const iSeeML::rob::OrPtConfig& goal_config
18  = (*goal)->configuration(), config = state.configuration();
19  const iSeeML::geom::Vector v
20  = goal_config.position() - config.position();
21  const double dist = v.length(), vel = state.translationVelocity(),
22  goal_vel = (*goal)->translationVelocity(),
23  max_curv = 1, // === get a better value !!! ===
24  trans_acc = motion_model.limAcc(0, dist, vel,
25  goal_vel, time_step),
26  rot_acc = 0; // === get a better value !!! ===
27  // =================================================================
28  // gets the goal's velocities
31  trans_acc, rot_acc, time_step);
32  // updates the parameters and send the update signal
33  updateVelocities(trans_vel, rot_vel);
34 } // end of void AnalyticCtrl::chooseVelocities(double&, ...) --------
State state
The current state of the robot.
Definition: track.hpp:32
const double time_step
The time step of the controller.
Definition: controller.hpp:39
const iSeeML::rob::OrPtConfig & configuration() const
Gives the configuration of the state.
Definition: state.hpp:67
double moving_velocity
Translation velocity desired for the robot.
Definition: controller.hpp:45
void updateVelocities(double &trans_vel, double &rot_vel)
Update the velocities from the fields and send the update signal.
Definition: controller.hpp:66
const MotionModel & motion_model
The model of the motion.
Definition: controller.hpp:36
void applyAccelerations(double &trans_vel, double &rot_vel, const double &trans_acc, const double &rot_acc, const double &time_step) const
Modify translation and rotation given velocities, applying the given accelerations during the given t...
Definition: motion.cpp:129
const double & translationVelocity() const
Gives the translation velocity of the state.
Definition: state.hpp:74
double turning_velocity
Rotation velocity desired for the robot.
Definition: controller.hpp:47
Path following controller class, with an analytic approach.
double limAcc(const double &lim_dist, const double &dist, const double &vel, const double &ldr_vel, const double &time_step) const
Descriptive method, giving the limit acceleration which ensure to avoid reaching limit distance for a...
Definition: motion.cpp:21
virtual void chooseVelocities(double &trans_vel, double &rot_vel, std::ostream &log_str)
Computes new velocities for ROS node.
Definition: analytic.cpp:14


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