18 for (
const auto& param : list) {
19 if (name == param.name()) {
28 for (
const auto& param : list) {
29 if (name == param.name()) {
33 yError() <<
"Param" << name <<
"not found";
39 for (
const auto& param : list) {
40 if (param.isGroup() && name == param.name()) {
49 for (
const auto& param : list) {
50 if (param.isGroup() && name == param.name()) {
54 yError() <<
"Param" << name <<
"not found";
61 for (
auto it1 = params.begin(); it1 != params.end(); ++it1) {
63 for (
auto it2 = it1 + 1; it2 != params.end();) {
65 if (param1.
name() == param2.
name()) {
67 yFatal() <<
"Duplicate parameter \"" << param1.
name() <<
"\" found and at least one of them is not a group.";
69 param1.
value() += std::string(
" ");
71 it2 = params.erase(it2);
83 if (phase ==
"startup") {
85 }
else if (phase ==
"run") {
87 }
else if (phase ==
"interrupt1") {
89 }
else if (phase ==
"interrupt2") {
91 }
else if (phase ==
"interrupt3") {
93 }
else if (phase ==
"shutdown") {
101 switch (actionphase) {
103 return std::string(
"startup");
105 return std::string(
"run");
107 return std::string(
"interrupt1");
109 return std::string(
"interrupt2");
111 return std::string(
"interrupt3");
113 return std::string(
"shutdown");
128 if (type ==
"configure") {
130 }
else if (type ==
"calibrate") {
132 }
else if (type ==
"attach") {
134 }
else if (type ==
"abort") {
136 }
else if (type ==
"detach") {
138 }
else if (type ==
"park") {
140 }
else if (type ==
"custom") {
149 switch (actiontype) {
151 return std::string(
"configure");
153 return std::string(
"calibrate");
155 return std::string(
"attach");
157 return std::string(
"abort");
159 return std::string(
"detach");
161 return std::string(
"park");
163 return std::string(
"custom");
robotinterface::ParamList mergeDuplicateGroups(const robotinterface::ParamList &list)
std::string ActionTypeToString(robotinterface::ActionType actiontype)
void operator>>(const std::stringstream &sstream, robotinterface::ActionPhase &actionphase)
bool hasParam(const robotinterface::ParamList &list, const std::string &name)
std::vector< robotinterface::Param > ParamList
std::string findGroup(const robotinterface::ParamList &list, const std::string &name)
robotinterface::ActionPhase StringToActionPhase(const std::string &phase)
robotinterface::ActionType StringToActionType(const std::string &type)
bool hasGroup(const robotinterface::ParamList &list, const std::string &name)
std::string findParam(const robotinterface::ParamList &list, const std::string &name)
std::string ActionPhaseToString(robotinterface::ActionPhase actionphase)