Parasol Planning Library (PPL)
Control.h
Go to the documentation of this file.
1 #ifndef PMPL_CONTROL_H_
2 #define PMPL_CONTROL_H_
3 
4 #include <cstddef>
5 #include <iostream>
6 #include <set>
7 #include <vector>
8 
9 #include "Geometry/Shapes/NBox.h"
10 
11 class Actuator;
12 
13 
23 struct Control final {
24 
27 
28  typedef std::vector<double> Signal;
29 
33 
34  Actuator* actuator{nullptr};
36 
40 
42 
46  Control(Actuator* const _actuator, const Signal& _signal = Signal());
47 
48  Control(const Control&) = default;
49  Control(Control&&) = default;
50 
54 
55  Control& operator=(const Control&) = default;
56  Control& operator=(Control&&) = default;
57 
61 
64  std::vector<double> GetOutput() const;
65 
69 
71  bool operator<(const Control& _rhs) const noexcept;
72 
74  bool operator==(const Control& _rhs) const noexcept;
75  bool operator!=(const Control& _rhs) const noexcept;
76 
78 
79 };
80 
82 std::ostream& operator<<(std::ostream&, const Control&);
83 
84 
88 
89 
91 typedef std::vector<Control> ControlSet;
92 
100 std::vector<double> AggregatedControlVector(const ControlSet& _controls);
101 
102 #endif
std::vector< double > AggregatedControlVector(const ControlSet &_controls)
Definition: Control.cpp:83
std::ostream & operator<<(std::ostream &, const Control &)
Display function for debugging controls and roadmap output. Prints the signal.
Definition: Control.cpp:75
std::vector< Control > ControlSet
A discrete set of controls can be defined by a sequence of allowed controls.
Definition: Control.h:91
NBox ControlSpace
Definition: Control.h:87
Definition: Actuator.h:35
An axis-aligned rectangular prism in n dimensions.
Definition: NBox.h:14
Definition: Control.h:23
bool operator!=(const Control &_rhs) const noexcept
Definition: Control.cpp:68
std::vector< double > GetOutput() const
Definition: Control.cpp:28
Actuator * actuator
The actuator for this control.
Definition: Control.h:34
bool operator==(const Control &_rhs) const noexcept
Define equality operators to check against identical controls.
Definition: Control.cpp:60
Control & operator=(const Control &)=default
Control & operator=(Control &&)=default
Control(const Control &)=default
bool operator<(const Control &_rhs) const noexcept
Define a weak ordering over controls to allow sorting/sequencing.
Definition: Control.cpp:41
Control(Control &&)=default
Signal signal
The signal for this control.
Definition: Control.h:35
std::vector< double > Signal
Definition: Control.h:28