34 static constexpr const char* TAG =
"Robot";
123 static Robot _instance;
Definition colorsensor.h:17
Definition linefollower.h:17
motor_direction_t
Definition motors.h:46
Definition ultrasonic.h:17
The ADC hardware abstraction layer's control class.
Definition adc.h:31
The GPIO hardware abstraction layer's control class.
Definition gpio.h:41
The I2C hardware abstraction layer's control class.
Definition i2c.h:35
The LEDC hardware abstraction layer's control class.
Definition ledc.h:36
Device::Display display
Definition robot.h:82
Robot & operator=(const Robot &)=delete
Device::Leds leds
Definition robot.h:81
Device::Motors motors
Definition robot.h:85
Device::Encoders encoders
Definition robot.h:87
Robot(const Robot &)=delete
protected_struct< data_struct > data
Definition robot.h:110
void create_task(const task_config_t &config)
Creates a FreeRTOS task.
Definition robot.cpp:52
void set_bottom_led(bool state) const
Sets the bottom LED state.
Definition robot.cpp:105
HAL::GPIO::Controller & gpio
Definition robot.h:75
Device::Buttons buttons
Definition robot.h:83
Device::Ultrasonic ultrasonic
Definition robot.h:88
Device::Bumpers bumpers
Definition robot.h:86
HAL::I2C::Controller & i2c
Definition robot.h:78
Device::Colorsensor colorsensor
Definition robot.h:90
robot_mode_t
Definition robot.h:54
@ APP
Definition robot.h:56
@ GAMEPAD
Definition robot.h:57
@ NONE
Definition robot.h:55
static constexpr gpio_num_t BOTTOM_LED_PIN
Definition robot.h:42
status_led_mode_t
Definition robot.h:60
@ OFF
Definition robot.h:61
@ ON
Definition robot.h:62
@ BLINK_FAST
Definition robot.h:64
@ BLINK_SLOW
Definition robot.h:63
void set_status_led(bool state) const
Sets the status LED.
Definition robot.cpp:98
Device::Buzzer buzzer
Definition robot.h:84
void enter_permanent_sleep()
Shuts down all HALs, pulls down a few pins and puts the ESP32 into deep sleep mode.
Definition robot.cpp:68
Device::Battery battery
Definition robot.h:80
rgb_leds_mode_t
Definition robot.h:67
@ HEADLIGHTS
Definition robot.h:69
@ RANDOM_COLORS
Definition robot.h:70
@ POLICE
Definition robot.h:71
Device::Imu imu
Definition robot.h:89
HAL::ADC::Controller & adc
Definition robot.h:77
static Robot & get_instance()
Gets the robot instance.
Definition robot.h:122
static constexpr gpio_num_t STATUS_LED_PIN
Definition robot.h:41
Device::Linefollower linefollower
Definition robot.h:91
HAL::LEDC::Controller & ledc
Definition robot.h:76
A RAII type used to make structs thread-safe for FreeRTOS via mutexes.
Definition protected_struct.h:43
log_source
Definition log_sources.h:12
@ LOG_SOURCE_CLASS_ROBOT
Definition log_sources.h:14
rgb_leds_mode_t rgb_leds_mode
Definition robot.h:98
status_led_mode_t status_led_mode
Definition robot.h:97
Device::Motors::motor_direction_t direction_right
Definition robot.h:107
uint16_t ramp_time_left
Definition robot.h:104
uint16_t target_speed_left
Definition robot.h:102
uint16_t ramp_time_right
Definition robot.h:105
Device::Motors::motor_direction_t direction_left
Definition robot.h:106
uint16_t target_speed_right
Definition robot.h:103
robot_mode_t mode
Definition robot.h:94
TaskFunction_t task_function
Definition robot.h:45
const uint32_t stack_size
Definition robot.h:47
UBaseType_t priority
Definition robot.h:49
void *const params_for_task
Definition robot.h:48
TaskHandle_t *const created_task_handle
Definition robot.h:50
const char * task_name
Definition robot.h:46
const BaseType_t core_id
Definition robot.h:51