32 #include "pteros/core/system.h"
33 #include "pteros/analysis/frame_info.h"
34 #include <spdlog/spdlog.h>
37 template<
class T>
class MessageChannel;
47 friend class TaskDriver;
48 friend class TrajectoryReader;
52 TaskBase(
const TaskBase& other);
54 virtual TaskBase* clone()
const = 0;
56 int get_id(){
return task_id; }
60 std::shared_ptr<spdlog::logger> log;
62 virtual void pre_process() = 0;
63 virtual void process_frame(
const FrameInfo& info) = 0;
64 virtual void post_process(
const FrameInfo& info) = 0;
67 virtual void collect_data(
const std::vector<std::shared_ptr<TaskBase>>& tasks,
int n_frames){}
70 virtual void before_spawn(){}
73 virtual void set_id(
int _id){ task_id = _id; }
75 virtual bool is_parallel() = 0;
79 virtual void before_spawn_handler(){
83 virtual void pre_process_handler(){
87 virtual void process_frame_handler(
const FrameInfo& info){
91 virtual void post_process_handler(
const FrameInfo& info){
100 void put_frame(
const Frame& frame);
101 void put_system(
const System& sys);
103 std::shared_ptr<TaskDriver> driver;