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
/** @class StopDriveModule <plugins/colli/drive_modes/stop_drive_mode.h>
28
* Stop-Drive-Module. This module is called, if something goes wrong, or is not recognized.
29
* It is a fairly easy one, because it sets all to zero.
30
*/
31
32
/** Constructor.
33
* @param logger The fawkes logger
34
* @param config The fawkes configuration
35
*/
36
StopDriveModule::StopDriveModule
(Logger *logger, Configuration *config)
37
: AbstractDriveMode(logger, config)
38
{
39
logger_->
log_debug
(
"StopDriveModule"
,
"(Constructor): Entering..."
);
40
drive_mode_ =
NavigatorInterface::MovingNotAllowed
;
41
logger_->
log_debug
(
"StopDriveModule"
,
"(Constructor): Exiting..."
);
42
}
43
44
/** Destruct your local values here. */
45
StopDriveModule::~StopDriveModule
()
46
{
47
logger_
->
log_debug
(
"StopDriveModule"
,
"(Destructor): Entering..."
);
48
logger_
->
log_debug
(
"StopDriveModule"
,
"(Destructor): Exiting..."
);
49
}
50
51
/* ************************************************************************** */
52
/* *********************** U P D A T E ************************* */
53
/* ************************************************************************** */
54
55
/** Calculate here your desired settings. What you desire is checked afterwards to the current
56
* settings of the physical boundaries, but take care also.
57
*
58
* How you do this is up to you, but be careful, our hardware is expensive!!!!
59
*
60
* Available are:
61
*
62
* target_ --> current target coordinates to drive to
63
* robot_ --> current robot coordinates
64
* robot_vel_ --> current Motor velocities
65
*
66
* local_target_ --> our local target found by the search component we want to reach
67
* local_trajec_ --> The point we would collide with, if we would drive WITHOUT Rotation
68
*
69
* orient_at_target_ --> Do we have to orient ourself at the target?
70
* stop_at_target_ --> Do we have to stop really ON the target?
71
*
72
* Afterwards filled should be:
73
*
74
* proposed_ --> Desired translation and rotation speed
75
*
76
* Those values are questioned after an update() was called.
77
*/
78
void
79
StopDriveModule::update
()
80
{
81
proposed_
.
x
=
proposed_
.
y
=
proposed_
.
rot
= 0.f;
82
}
83
84
}
// namespace fawkes
fawkes::AbstractDriveMode::proposed_
colli_trans_rot_t proposed_
proposed translation and rotation for next timestep
Definition:
abstract_drive_mode.h:102
fawkes::colli_trans_rot_t::rot
float rot
Rotation around z-axis.
Definition:
types.h:68
fawkes::colli_trans_rot_t::y
float y
Translation in y-direction.
Definition:
types.h:67
fawkes::StopDriveModule::StopDriveModule
StopDriveModule(Logger *logger, Configuration *config)
Constructor.
Definition:
stop_drive_mode.cpp:40
fawkes::NavigatorInterface::MovingNotAllowed
Moving not allowed constant.
Definition:
NavigatorInterface.h:64
fawkes::colli_trans_rot_t::x
float x
Translation in x-direction.
Definition:
types.h:66
fawkes
fawkes::AbstractDriveMode::logger_
Logger * logger_
The fawkes logger.
Definition:
abstract_drive_mode.h:106
fawkes::StopDriveModule::~StopDriveModule
~StopDriveModule()
Destruct your local values here.
Definition:
stop_drive_mode.cpp:49
fawkes::Logger::log_debug
virtual void log_debug(const char *component, const char *format,...)=0
fawkes::StopDriveModule::update
virtual void update()
Calculate here your desired settings.
Definition:
stop_drive_mode.cpp:83
src
plugins
colli
drive_modes
stop_drive_mode.cpp
Generated by
1.8.16