Fawkes API  Fawkes Development Version
stop_drive_mode.cpp
1 
2 /***************************************************************************
3  * stop_drive_mode.cpp - Implementation of drive-mode "stop"
4  *
5  * Created: Fri Oct 18 15:16:23 2013
6  * Copyright 2002 Stefan Jacobs
7  * 2013-2014 Bahram Maleki-Fard
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #include "stop_drive_mode.h"
24 
25 namespace fawkes
26 {
27 #if 0 /* just to make Emacs auto-indent happy */
28 }
29 #endif
30 
31 /** @class StopDriveModule <plugins/colli/drive_modes/stop_drive_mode.h>
32  * Stop-Drive-Module. This module is called, if something goes wrong, or is not recognized.
33  * It is a fairly easy one, because it sets all to zero.
34  */
35 
36 /** Constructor.
37  * @param logger The fawkes logger
38  * @param config The fawkes configuration
39  */
41  : AbstractDriveMode(logger, config)
42 {
43  logger_->log_debug("StopDriveModule", "(Constructor): Entering...");
45  logger_->log_debug("StopDriveModule", "(Constructor): Exiting...");
46 }
47 
48 
49 /** Destruct your local values here. */
51 {
52  logger_->log_debug("StopDriveModule", "(Destructor): Entering...");
53  logger_->log_debug("StopDriveModule", "(Destructor): Exiting...");
54 }
55 
56 
57 /* ************************************************************************** */
58 /* *********************** U P D A T E ************************* */
59 /* ************************************************************************** */
60 
61 /** Calculate here your desired settings. What you desire is checked afterwards to the current
62  * settings of the physical boundaries, but take care also.
63  *
64  * How you do this is up to you, but be careful, our hardware is expensive!!!!
65  *
66  * Available are:
67  *
68  * target_ --> current target coordinates to drive to
69  * robot_ --> current robot coordinates
70  * robot_vel_ --> current Motor velocities
71  *
72  * local_target_ --> our local target found by the search component we want to reach
73  * local_trajec_ --> The point we would collide with, if we would drive WITHOUT Rotation
74  *
75  * orient_at_target_ --> Do we have to orient ourself at the target?
76  * stop_at_target_ --> Do we have to stop really ON the target?
77  *
78  * Afterwards filled should be:
79  *
80  * proposed_ --> Desired translation and rotation speed
81  *
82  * Those values are questioned after an update() was called.
83  */
84 void
86 {
87  proposed_.x = proposed_.y = proposed_.rot = 0.f;
88 }
89 
90 } // namespace fawkes
float x
Translation in x-direction.
Definition: types.h:61
Logger * logger_
The fawkes logger.
Fawkes library namespace.
colli_trans_rot_t proposed_
proposed translation and rotation for next timestep
float y
Translation in y-direction.
Definition: types.h:62
float rot
Rotation around z-axis.
Definition: types.h:63
NavigatorInterface::DriveMode drive_mode_
the drive mode name
StopDriveModule(Logger *logger, Configuration *config)
Constructor.
This is the base class which calculates drive modes.
virtual void log_debug(const char *component, const char *format,...)=0
Log debug message.
virtual void update()
Calculate here your desired settings.
Interface for configuration handling.
Definition: config.h:67
Interface for logging.
Definition: logger.h:34
~StopDriveModule()
Destruct your local values here.