21 for (
const auto& param : list) {
22 if (name == param.name()) {
31 for (
const auto& param : list) {
32 if (name == param.name()) {
36 yError() <<
"Param" << name <<
"not found";
42 for (
const auto& param : list) {
43 if (param.isGroup() && name == param.name()) {
52 for (
const auto& param : list) {
53 if (param.isGroup() && name == param.name()) {
57 yError() <<
"Param" << name <<
"not found";
64 for (
auto it1 = params.begin(); it1 != params.end(); ++it1) {
66 for (
auto it2 = it1 + 1; it2 != params.end();) {
68 if (param1.
name() == param2.
name()) {
70 yFatal() <<
"Duplicate parameter \"" << param1.
name() <<
"\" found and at least one of them is not a group.";
72 param1.
value() += std::string(
" ");
74 it2 = params.erase(it2);
85 if (phase ==
"startup") {
87 }
else if (phase ==
"run") {
89 }
else if (phase ==
"interrupt1") {
91 }
else if (phase ==
"interrupt2") {
93 }
else if (phase ==
"interrupt3") {
95 }
else if (phase ==
"shutdown") {
103 switch (actionphase) {
105 return std::string(
"startup");
107 return std::string(
"run");
109 return std::string(
"interrupt1");
111 return std::string(
"interrupt2");
113 return std::string(
"interrupt3");
115 return std::string(
"shutdown");
130 if (type ==
"configure") {
132 }
else if (type ==
"calibrate") {
134 }
else if (type ==
"attach") {
136 }
else if (type ==
"abort") {
138 }
else if (type ==
"detach") {
140 }
else if (type ==
"park") {
142 }
else if (type ==
"custom") {
151 switch (actiontype) {
153 return std::string(
"configure");
155 return std::string(
"calibrate");
157 return std::string(
"attach");
159 return std::string(
"abort");
161 return std::string(
"detach");
163 return std::string(
"park");
165 return std::string(
"custom");
std::string findParam(const robotinterface::experimental::ParamList &list, const std::string &name)
robotinterface::experimental::ActionType StringToActionType(const std::string &type)
robotinterface::experimental::ParamList mergeDuplicateGroups(const robotinterface::experimental::ParamList &list)
bool hasParam(const robotinterface::experimental::ParamList &list, const std::string &name)
bool hasGroup(const robotinterface::experimental::ParamList &list, const std::string &name)
std::string ActionPhaseToString(robotinterface::experimental::ActionPhase actionphase)
robotinterface::experimental::ActionPhase StringToActionPhase(const std::string &phase)
std::string ActionTypeToString(robotinterface::experimental::ActionType actiontype)
std::vector< robotinterface::experimental::Param > ParamList
void operator>>(const std::stringstream &sstream, robotinterface::experimental::ActionPhase &actionphase)
std::string findGroup(const robotinterface::experimental::ParamList &list, const std::string &name)