Go to the documentation of this file.
18 #include <picovoice_msgs/GetIntentAction.h>
26 using namespace picovoice_msgs;
31 :
RecognizerNode(
"rhino",
"get_intent", parameters), contexts_directory_url_(contexts_directory_url)
46 action_result.intent = result.
intent_;
47 for (
const auto& slot : result.
slots_)
49 picovoice_msgs::KeyValue kv;
51 kv.value = slot.value_;
52 action_result.slots.push_back(kv);
78 catch (
const std::exception& e)
80 ROS_FATAL(
"RhinoNode exception: %s", e.what());
void updateParameters(const GetIntentGoal &goal, RhinoRecognizerData::Parameters ¶meters) override
std::string pathFromUrl(const std::string &url, const std::string &extension, const std::string &directory)
pathFromUrl Get a file path from an url
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
void updateResult(const RhinoRecognizerData::Result &result, GetIntentResult &action_result) override
bool require_endpoint_
require_endpoint_ If true, Rhino requires an endpoint (chunk of silence) before finishing inference.
std::string model_path_
model_path_ Path to the Picovoice model parameters
int main(int argc, char **argv)
std::string contexts_directory_url_
std::vector< KeyValue > slots_
slots_ The recognized intent slots
bool is_understood_
is_understood_ Whether the recognizer understood an intent
std::string defaultResourceUrl()
defaultResourcePath Get the default resource path
RhinoNode(const RhinoRecognizerData::Parameters ¶meters, const std::string &contexts_directory_url)
T param(const std::string ¶m_name, const T &default_val) const
std::string context_path_
context_path_ Path to the Picovoice Rhino context.rhn
std::string intent_
intent_ The recognized intent
std::vector< std::string > intents_
intents_ Indent candidates, if empty, all returned intents will be considered valid