1#include "state_representation/parameters/Parameter.hpp"
10Parameter<int>::Parameter(
const std::string& name,
const int& value) :
12 this->set_empty(
false);
16Parameter<std::vector<int>>::Parameter(
const std::string& name) :
17 ParameterInterface(name,
ParameterType::INT_ARRAY), value_() {}
20Parameter<std::vector<int>>::Parameter(
const std::string& name,
const std::vector<int>& value) :
21 ParameterInterface(name,
ParameterType::INT_ARRAY), value_(value) {
22 this->set_empty(
false);
26Parameter<double>::Parameter(
const std::string& name) :
30Parameter<double>::Parameter(
const std::string& name,
const double& value) :
31 ParameterInterface(name,
ParameterType::DOUBLE), value_(value) {
32 this->set_empty(
false);
36Parameter<std::vector<double>>::Parameter(
const std::string& name) :
37 ParameterInterface(name,
ParameterType::DOUBLE_ARRAY), value_() {}
40Parameter<std::vector<double>>::Parameter(
const std::string& name,
const std::vector<double>& value) :
41 ParameterInterface(name,
ParameterType::DOUBLE_ARRAY), value_(value) {
42 this->set_empty(
false);
46Parameter<bool>::Parameter(
const std::string& name) :
50Parameter<bool>::Parameter(
const std::string& name,
const bool& value) :
51 ParameterInterface(name,
ParameterType::BOOL), value_(value) {
52 this->set_empty(
false);
56Parameter<std::vector<bool>>::Parameter(
const std::string& name) :
57 ParameterInterface(name,
ParameterType::BOOL_ARRAY), value_() {
61Parameter<std::vector<bool>>::Parameter(
const std::string& name,
const std::vector<bool>& value) :
62 ParameterInterface(name,
ParameterType::BOOL_ARRAY), value_(value) {
63 this->set_empty(
false);
67Parameter<std::string>::Parameter(
const std::string& name) :
71Parameter<std::string>::Parameter(
const std::string& name,
const std::string& value) :
72 ParameterInterface(name,
ParameterType::STRING), value_(value) {
73 this->set_empty(
false);
77Parameter<std::vector<std::string>>::Parameter(
const std::string& name) :
78 ParameterInterface(name,
ParameterType::STRING_ARRAY), value_() {}
81Parameter<std::vector<std::string>>::Parameter(
const std::string& name,
const std::vector<std::string>& value) :
82 ParameterInterface(name,
ParameterType::STRING_ARRAY), value_(value) {
83 this->set_empty(
false);
87Parameter<CartesianState>::Parameter(
const std::string& name) :
91Parameter<CartesianState>::Parameter(
const std::string& name,
const CartesianState& value) :
93 this->set_empty(
false);
97Parameter<CartesianPose>::Parameter(
const std::string& name) :
101Parameter<CartesianPose>::Parameter(
const std::string& name,
const CartesianPose& value) :
103 this->set_empty(
false);
107Parameter<JointState>::Parameter(
const std::string& name) :
111Parameter<JointState>::Parameter(
const std::string& name,
const JointState& value) :
113 this->set_empty(
false);
117Parameter<JointPositions>::Parameter(
const std::string& name) :
121Parameter<JointPositions>::Parameter(
const std::string& name,
const JointPositions& value) :
123 this->set_empty(
false);
127Parameter<Ellipsoid>::Parameter(
const std::string& name) :
132Parameter<Ellipsoid>::Parameter(
const std::string& name,
const Ellipsoid& value) :
134 this->set_empty(
false);
138Parameter<Eigen::MatrixXd>::Parameter(
const std::string& name) :
142Parameter<Eigen::MatrixXd>::Parameter(
const std::string& name,
const Eigen::MatrixXd& value) :
143 ParameterInterface(name,
ParameterType::MATRIX), value_(value) {
144 this->set_empty(
false);
148Parameter<Eigen::VectorXd>::Parameter(
const std::string& name) :
152Parameter<Eigen::VectorXd>::Parameter(
const std::string& name,
const Eigen::VectorXd& value) :
153 ParameterInterface(name,
ParameterType::VECTOR), value_(value) {
154 this->set_empty(
false);
158std::ostream&
operator<<(std::ostream& os,
const Parameter<T>& parameter) {
159 os << parameter.to_string();
161 os <<
", " << parameter.get_value();
166template std::ostream&
operator<<(std::ostream& os,
const Parameter<int>& parameter);
167template std::ostream&
operator<<(std::ostream& os,
const Parameter<double>& parameter);
168template std::ostream&
operator<<(std::ostream& os,
const Parameter<bool>& parameter);
169template std::ostream&
operator<<(std::ostream& os,
const Parameter<std::string>& parameter);
170template std::ostream&
operator<<(std::ostream& os,
const Parameter<CartesianState>& parameter);
171template std::ostream&
operator<<(std::ostream& os,
const Parameter<CartesianPose>& parameter);
172template std::ostream&
operator<<(std::ostream& os,
const Parameter<JointState>& parameter);
173template std::ostream&
operator<<(std::ostream& os,
const Parameter<JointPositions>& parameter);
174template std::ostream&
operator<<(std::ostream& os,
const Parameter<Ellipsoid>& parameter);
175template std::ostream&
operator<<(std::ostream& os,
const Parameter<Eigen::MatrixXd>& parameter);
176template std::ostream&
operator<<(std::ostream& os,
const Parameter<Eigen::VectorXd>& parameter);
179std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<int>>& parameter) {
180 os << parameter.to_string();
183 for (
auto& v: parameter.get_value()) {
192std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<double>>& parameter) {
193 os << parameter.to_string();
196 for (
auto& v: parameter.get_value()) {
205std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<bool>>& parameter) {
206 os << parameter.to_string();
209 for (
auto v: parameter.get_value()) {
218std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<std::string>>& parameter) {
219 os << parameter.to_string();
222 for (
auto& v: parameter.get_value()) {
Parameter(const std::string &name="")
Constructor with the name of the parameter.
Core state variables and objects.
ParameterType
The parameter value types.
std::ostream & operator<<(std::ostream &os, const AnalogIOState &state)
StateType
The class types inheriting from State.