ObjectSpokenNames Class Reference

Spoken object names from PriorKnowledgeData, for use as a SpokenNameLookup. More...

#include <RobotAPI/components/opossum_logger/ObjectSpokenNames.h>

Public Member Functions

SpokenNameLookup asLookup ()
 This resolver as a SpokenNameLookup. Must not outlive this object.
 
 ObjectSpokenNames ()=default
 
std::optional< std::string > operator() (const std::string &dataset, const std::string &className)
 The spoken name of an object class, or std::nullopt if it has none.
 

Detailed Description

Spoken object names from PriorKnowledgeData, for use as a SpokenNameLookup.

Looks up <dataset>/<className>/<className>_names.json via ObjectFinder; if that yields nothing (the dataset is unknown to PriorKnowledgeData, as for MobileKitchen/mobile-fridge), the class name is searched in all datasets. Results, including misses, are cached: only about a quarter of the known classes carry a names file, so misses are common and re-checking the filesystem for them would be wasteful.

Thread-safe.

Definition at line 51 of file ObjectSpokenNames.h.

Constructor & Destructor Documentation

◆ ObjectSpokenNames()

ObjectSpokenNames ( )
default

Member Function Documentation

◆ asLookup()

SpokenNameLookup asLookup ( )

This resolver as a SpokenNameLookup. Must not outlive this object.

Definition at line 86 of file ObjectSpokenNames.cpp.

◆ operator()()

std::optional< std::string > operator() ( const std::string & dataset,
const std::string & className )

The spoken name of an object class, or std::nullopt if it has none.

Definition at line 33 of file ObjectSpokenNames.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: