Main Page
Namespaces
Classes
Files
File List
File Members
src
partial_movement.cpp
Go to the documentation of this file.
1
27
#include "
sr_movements/partial_movement.hpp
"
28
29
namespace
shadowrobot
30
{
31
PartialMovement::PartialMovement
()
32
{}
33
34
PartialMovement::~PartialMovement
()
35
{}
36
37
double
PartialMovement::get_target
(
double
percentage)
38
{
39
if
(percentage < 0.0)
40
percentage = 0.0;
41
if
(percentage > 1.0)
42
percentage = 1.0;
43
44
int
index =
static_cast<
int
>
(
steps
.size() *
static_cast<
double
>
(percentage));
45
return
steps
[index];
46
}
47
}
// namespace shadowrobot
48
49
/* For the emacs weenies in the crowd.
50
Local Variables:
51
c-basic-offset: 2
52
End:
53
*/
shadowrobot
Definition:
movement_from_image.hpp:36
shadowrobot::PartialMovement::get_target
double get_target(double percentage)
Definition:
partial_movement.cpp:37
partial_movement.hpp
This is the main class from which all the different types of movement will inherit.
shadowrobot::PartialMovement::~PartialMovement
virtual ~PartialMovement()
Definition:
partial_movement.cpp:34
shadowrobot::PartialMovement::steps
std::vector< double > steps
Definition:
partial_movement.hpp:55
shadowrobot::PartialMovement::PartialMovement
PartialMovement()
Definition:
partial_movement.cpp:31
sr_movements
Author(s): Ugo Cupcic
autogenerated on Tue Oct 13 2020 03:50:46