robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
grid_info.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_GRID_INFO_HPP_
2#define ROBOTOC_GRID_INFO_HPP_
3
4#include <iostream>
5
6
7namespace robotoc {
8
13enum class GridType {
15 Impact,
16 Lift,
18};
19
24struct GridInfo {
29
33 double t0 = 0;
34
38 double t = 0;
39
43 double dt = 0;
44
48 double dt_next = 0;
49
53 int phase = 0;
54
58 int stage = 0;
59
63 int impact_index = -1;
64
68 int lift_index = -1;
69
74
79
83 bool sto = false;
84
88 bool sto_next = false;
89
94
98 void setRandom();
99
103 static GridInfo Random();
104
108 void disp(std::ostream& os) const;
109
110 friend std::ostream& operator<<(std::ostream& os, const GridInfo& grid_info);
111
112};
113
114} // namespace robotoc
115
116#endif // ROBOTOC_GRID_INFO_HPP_
Definition: constraint_component_base.hpp:17
GridType
Type of the grid.
Definition: grid_info.hpp:13
Grid information.
Definition: grid_info.hpp:24
int num_grids_in_phase
Total number of grids in the phase.
Definition: grid_info.hpp:78
static GridInfo Random()
Returns random grid info.
bool switching_constraint
Flag if the switching constraint is enable or not.
Definition: grid_info.hpp:93
void setRandom()
Sets random.
int impact_index
Impact index of this grid.
Definition: grid_info.hpp:63
double t0
Initial time of the horizon.
Definition: grid_info.hpp:33
int phase
Phase of this grid.
Definition: grid_info.hpp:53
bool sto_next
Flag if the STO is enabled in the next phase.
Definition: grid_info.hpp:88
void disp(std::ostream &os) const
Displays the grid info onto a ostream.
int stage_in_phase
Stage index counded in the phase.
Definition: grid_info.hpp:73
int stage
Stage of this grid.
Definition: grid_info.hpp:58
bool sto
Flag if the STO is enabled in the current phase.
Definition: grid_info.hpp:83
double t
Time of this grid.
Definition: grid_info.hpp:38
double dt
Time step of this grid.
Definition: grid_info.hpp:43
double dt_next
Time step of the next grid.
Definition: grid_info.hpp:48
GridType type
Type of the grid.
Definition: grid_info.hpp:28
friend std::ostream & operator<<(std::ostream &os, const GridInfo &grid_info)
int lift_index
Lift index of this grid.
Definition: grid_info.hpp:68