Skip to content

Commit 721364e

Browse files
authored
Merge pull request #6 from MiRON-project/feature/outputs
add feature outputs from skill
2 parents 508dab9 + 5ab5859 commit 721364e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: Executor/src/skill_action.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,21 @@ BT::NodeStatus SkillAction::convertResultToStatus(const std::string &result_stri
103103
// blackboard()->set( bb_result_key, res_value );
104104
}
105105

106+
const auto &output = json["outputs"];
107+
for (auto it = output.begin(); it != output.end(); it++)
108+
{
109+
if (it.value().is_boolean())
110+
setOutput(it.key(), it.value().get<bool>());
111+
else if (it.value().is_number_integer())
112+
setOutput(it.key(), it.value().get<int>());
113+
else if (it.value().is_number_float())
114+
setOutput(it.key(), it.value().get<double>());
115+
else if (it.value().is_string())
116+
setOutput(it.key(), it.value().get<std::string>());
117+
else
118+
throw std::runtime_error("Unsuported type json");
119+
}
120+
106121
std::transform(result.begin(), result.end(), result.begin(), ::toupper);
107122
if (result == "SUCCESS")
108123
{

0 commit comments

Comments
 (0)