1#include "state_representation/parameters/Parameter.hpp"
10Parameter<int>::Parameter(
const std::string& name,
const int& value) :
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) {
26Parameter<double>::Parameter(
const std::string& name) :
30Parameter<double>::Parameter(
const std::string& name,
const double& value) :
31 ParameterInterface(name,
ParameterType::DOUBLE), value_(value) {
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) {
46Parameter<bool>::Parameter(
const std::string& name) :
50Parameter<bool>::Parameter(
const std::string& name,
const bool& value) :
51 ParameterInterface(name,
ParameterType::BOOL), value_(value) {
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) {
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) {
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) {
87Parameter<CartesianState>::Parameter(
const std::string& name) :
91Parameter<CartesianState>::Parameter(
const std::string& name,
const CartesianState& value) :
97Parameter<CartesianPose>::Parameter(
const std::string& name) :
101Parameter<CartesianPose>::Parameter(
const std::string& name,
const CartesianPose& value) :
107Parameter<JointState>::Parameter(
const std::string& name) :
111Parameter<JointState>::Parameter(
const std::string& name,
const JointState& value) :
117Parameter<JointPositions>::Parameter(
const std::string& name) :
121Parameter<JointPositions>::Parameter(
const std::string& name,
const JointPositions& value) :
127Parameter<Ellipsoid>::Parameter(
const std::string& name) :
132Parameter<Ellipsoid>::Parameter(
const std::string& name,
const Ellipsoid& value) :
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) {
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) {
158std::ostream&
operator<<(std::ostream& os,
const Parameter<T>& parameter) {
159 if (parameter.is_empty()) {
160 os <<
"Parameter " << parameter.get_name() <<
" is empty";
162 os <<
"Parameter " << parameter.get_name() <<
": " << parameter.get_value();
167template std::ostream&
operator<<(std::ostream& os,
const Parameter<int>& parameter);
168template std::ostream&
operator<<(std::ostream& os,
const Parameter<double>& parameter);
169template std::ostream&
operator<<(std::ostream& os,
const Parameter<bool>& parameter);
170template std::ostream&
operator<<(std::ostream& os,
const Parameter<std::string>& parameter);
171template std::ostream&
operator<<(std::ostream& os,
const Parameter<CartesianState>& parameter);
172template std::ostream&
operator<<(std::ostream& os,
const Parameter<CartesianPose>& parameter);
173template std::ostream&
operator<<(std::ostream& os,
const Parameter<JointState>& parameter);
174template std::ostream&
operator<<(std::ostream& os,
const Parameter<JointPositions>& parameter);
175template std::ostream&
operator<<(std::ostream& os,
const Parameter<Ellipsoid>& parameter);
176template std::ostream&
operator<<(std::ostream& os,
const Parameter<Eigen::MatrixXd>& parameter);
177template std::ostream&
operator<<(std::ostream& os,
const Parameter<Eigen::VectorXd>& parameter);
180std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<int>>& parameter) {
181 if (parameter.is_empty()) {
182 os <<
"Parameter " << parameter.get_name() <<
" is empty" << std::endl;
184 os <<
"Parameter " << parameter.get_name() <<
": ";
185 for (
auto& v: parameter.get_value()) {
194std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<double>>& parameter) {
195 if (parameter.is_empty()) {
196 os <<
"Parameter " << parameter.get_name() <<
" is empty" << std::endl;
198 os <<
"Parameter " << parameter.get_name() <<
": ";
199 for (
auto& v: parameter.get_value()) {
208std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<bool>>& parameter) {
209 if (parameter.is_empty()) {
210 os <<
"Parameter " << parameter.get_name() <<
" is empty" << std::endl;
212 os <<
"Parameter " << parameter.get_name() <<
": ";
213 for (
auto v: parameter.get_value()) {
222std::ostream&
operator<<(std::ostream& os,
const Parameter<std::vector<std::string>>& parameter) {
223 if (parameter.is_empty()) {
224 os <<
"Parameter " << parameter.get_name() <<
" is empty" << std::endl;
226 os <<
"Parameter " << parameter.get_name() <<
": ";
227 for (
auto& v: parameter.get_value()) {
Parameter(const std::string &name)
Constructor with name of the parameter.
Core state variables and objects.
ParameterType
The parameter value types.
std::ostream & operator<<(std::ostream &os, const Ellipsoid &ellipsoid)
StateType
The class types inheriting from State.