Khangai Robot Play - Naive  01
THe naive play of the Khangai Robot
robo_tasks.cpp File Reference
#include "FreeRTOS.h"
#include "task.h"
#include "main.h"
#include "cmsis_os.h"
#include "usb_device.h"
#include "robot.h"
#include "arduino.h"
#include "usart.h"
#include "error.h"
#include "i2c.h"
#include "devs_config.h"
#include "all_tests.h"
Include dependency graph for robo_tasks.cpp:

Functions

void StartDefaultTask (void const *argument)
 Function implementing the defaultTask thread. More...
 
void RobotThread (void const *argument)
 
void LoggingThread (void const *argument)
 
void MotorThread (void const *argument)
 Function implementing the MotorSequence thread. More...
 
void log_data ()
 Function implementing the logging thread. More...
 

Variables

RobotKhangai_Robot = Robot::get_Instance()
 Function implementing the RoboSequence thread. More...
 
GameField gCurrent_Field = GameField::NONE
 

Function Documentation

◆ log_data()

void log_data ( )

Function implementing the logging thread.

Parameters
argumentNot used
Return values
None

◆ LoggingThread()

void LoggingThread ( void const *  argument)
Here is the call graph for this function:

◆ MotorThread()

void MotorThread ( void const *  argument)

Function implementing the MotorSequence thread.

Parameters
argumentNot used
Return values
None
Here is the call graph for this function:

◆ RobotThread()

void RobotThread ( void const *  argument)
Here is the call graph for this function:

◆ StartDefaultTask()

void StartDefaultTask ( void const *  argument)

Function implementing the defaultTask thread.

Parameters
argumentNot used
Return values
None

Variable Documentation

◆ gCurrent_Field

GameField gCurrent_Field = GameField::NONE

◆ Khangai_Robot

Robot& Khangai_Robot = Robot::get_Instance()

Function implementing the RoboSequence thread.

Parameters
argumentNot used
Return values
None
Note
This thread is responsible for reading the current state of the robot.
Tasks performed by this thread :
1) Read orientation given by the OrientationSensor based on the State the
   robot is in.
2) Read position given by the PositionSensor based on the State the robot is
   in.
3) Filter Orientation data.
     3.1) Filter roll
     3.2) Filter roll compensated pitch
     3.3) Filter tilt compensated pitch
4) Rotate the measured position from body frame to the field frame
5) Filter Position Data
6) Find the robot's state based on it's current position
7) Calculate the robot's angle of attack to reach the next state
8) Calculate the robot's velocity according to it's state
9) Calculate the correction angular velocity of the robot
10) Calculate the omegas of each wheel
11) Measure omega of each wheels
12) Compute error
13) Compute PID using available PID_Algorithm
14) set Omega of each wheel
15) update new omegas of all wheels at once