-
Notifications
You must be signed in to change notification settings - Fork 11
/
FootPrint.h
66 lines (46 loc) · 1.46 KB
/
FootPrint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright (C) 2017 Fondazione Istituto Italiano di Tecnologia
* Authors: Stefano Dafarra
* CopyPolicy: Released under the terms of the BSD-3-Clause license, see LICENSE
*
*/
#ifndef FOOTPRINT_H
#define FOOTPRINT_H
#include <deque>
#include <memory>
#include "iDynTree/VectorFixSize.h"
struct Step{
iDynTree::Vector2 position;
double angle;
double impactTime;
std::string footName{"footprint"};
};
typedef std::deque<Step> StepList;
class FootPrint {
std::shared_ptr<StepList> m_steps;
std::string m_footName{"footprint"};
public:
FootPrint();
FootPrint(std::shared_ptr<StepList> &steps); //it sorts the step
bool addStep(const iDynTree::Vector2& position, double theta, double impactTime);
bool addStep(const Step& newStep);
bool getLastStep(Step& lastStep) const;
bool dropPastSteps(); //remove all the steps except the last one
bool keepOnlyPresentStep(double time); //drops all the steps except the last whose impacttime is lower than time.
void clearSteps();
void clearLastStep();
size_t numberOfSteps() const;
const StepList& getSteps() const;
StepList& getSteps();
/**
* Set the foot name
* @param footName name of the foot (e.g. left or right)
*/
void setFootName(const std::string& footName);
/**
* Get the foot name
* @return the name of the foot (e.g. left or right)
*/
const std::string& getFootName() const;
};
#endif // FOOTPRINT_H