Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
base_robot.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "irobot.hpp"
4
5#include "driver/drivers.hpp"
7
10
11#include <memory>
12
13namespace fang::robot
14{
19 class BaseRobot : public IRobot
20 {
21 public:
22 // Even though inheritors need to use maker functions, the benefits
23 // of testability and ownership are worth it
24 using Subsystems = std::vector<std::unique_ptr<tap::control::Subsystem>>;
25 using CommandPacks = std::vector<std::unique_ptr<command::CommandPack>>;
26
31 (
32 tap::control::CommandScheduler& commandScheduler,
33 Subsystems&& subsystems,
34 CommandPacks&& commandPacks
35 );
36
40 BaseRobot(BaseRobot&& baseRobot);
41
42 virtual void initialize() override;
43
45 virtual void update() {};
46 protected:
47 void registerSubsystems();
50 private:
51 tap::control::CommandScheduler& commandScheduler_;
52 Subsystems subsystems_;
53 CommandPacks commandPacks_;
54 };
55}
Definition base_robot.hpp:20
void registerSubsystems()
Definition base_robot.cpp:40
virtual void update()
Not virtual so that it can be passed around in maker functions.
Definition base_robot.hpp:45
void initializeCommandPacks()
Definition base_robot.cpp:50
void initializeSubsystems()
Definition base_robot.cpp:32
std::vector< std::unique_ptr< tap::control::Subsystem > > Subsystems
Definition base_robot.hpp:24
virtual void initialize() override
Definition base_robot.cpp:25
std::vector< std::unique_ptr< command::CommandPack > > CommandPacks
Definition base_robot.hpp:25
Definition irobot.hpp:11
Definition command_scheduler.hpp:118
Definition base_robot.cpp:4