15#include "auto_apms_behavior_tree_core/tree/script.hpp"
17#include "auto_apms_behavior_tree_core/exceptions.hpp"
18#include "auto_apms_util/string.hpp"
19#include "behaviortree_cpp/scripting/script_parser.hpp"
24Script::Script(std::vector<std::string> expressions) : expressions_(expressions)
26 if (
const BT::Result res = BT::ValidateScript(
str()); !res) {
27 throw exceptions::ScriptError(res.error());
37 for (
const std::string & expr : rhs.expressions_) expressions_.push_back(expr);
41std::string
Script::str()
const {
return auto_apms_util::join(expressions_,
"; "); }
Class that encapsulates behavior tree script expressions.
Script()=default
Create an empty script.
std::string str() const
Concatenate all expressions of this instance to a single string.
Core API for AutoAPMS's behavior tree implementation.