gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
fallback_step.cpp
1 #include "gaze/pipeline_steps/fallback_step.h"
2 
3 #include <string>
4 
5 #include "yaml-cpp/yaml.h"
6 
7 #include "gaze/util/config.h"
8 #include "gaze/util/data.h"
9 
10 
11 namespace gaze {
12 
13 namespace pipeline {
14 
16  YAML::Node config = util::get_config(this->number);
17  this->name = config["name"] ?
18  config["name"].as<std::string>() : "Fallback Step";
19  YAML::Emitter emitter;
20  emitter << config;
21  this->config = emitter.c_str();
22 }
23 
25 }
26 
28  std::string text(""
29  "This is a fallback in case something goes wrong.\n"
30  "If you see this, then either your configuration is wrong (see below)\n"
31  "or you forgot to implement one place where pipeline steps have to go.\n"
32  "\nThis is your configuration:\n\n"
33  + this->config +
34  "\n\nAnd here is a checklist of what to do to develop a new step:\n"
35  "- Create include/gaze/pipeline_steps/....h\n"
36  "- Create src/gaze/pipeline_steps/....cpp\n"
37  "- Add an #include to include/gaze/pipeline_steps.h\n"
38  "- Add the *.cpp file to src/gaze/CMakeLists.txt\n"
39  "- Add a case to init_pipeline in src/gaze/gaze_tracker.cpp\n"
40  "- If you use a new widget, add traits to "
41  "include/gaze/gui/visualizeable.h");
42  this->widget->set_text(text);
43 }
44 
45 } // namespace pipeline
46 
47 } // namespace gaze
std::shared_ptr< widget_type > widget
const char * c_str() const noexcept
std::string name
Definition: pipeline_step.h:31
Wraps the data acquired per frame into a single instance.
Definition: data.h:27
void visualize(util::Data &) override
void process(util::Data &) override
YAML::Node get_config()
Definition: config.in.cpp:12