Khangai Robot Play - Naive  01
THe naive play of the Khangai Robot
Actuator Class Referencefinal

#include <actuator.h>

Collaboration diagram for Actuator:

Public Member Functions

 Actuator (Actuator &&)=default
 
 Actuator (const Actuator &)=default
 
Actuatoroperator= (Actuator &&)=default
 
Actuatoroperator= (const Actuator &)=default
 
 ~Actuator ()
 
int init ()
 Function that initializes all the required components for the robot's actuator(omni-base) More...
 
Vec3< float > actuate (Vec3< float > vel, Vec3< float > psis, uint32_t dt_millis, int8_t test=0)
 Function that actuate the robot's base(omni-base) More...
 
uint32_t stop (uint32_t dt_millis, float ramp_factor=2.0, uint32_t max_time=1000)
 
void clear ()
 
void profile (Vec3< float > vel, uint32_t dt_millis)
 
void check ()
 

Static Public Member Functions

static Actuatorget_Instance ()
 

Private Member Functions

 Actuator ()
 
void wheels_Init ()
 Function that initializes all the required components for the wheels of the robot. More...
 
void pid_Init ()
 Function that initializes all the required components for the wheel's pid controller. More...
 
void set_AnglePID (PID *pid)
 

Private Attributes

Wheel wheels_ [4]
 
PIDangle_pid_
 

Constructor & Destructor Documentation

◆ Actuator() [1/3]

Actuator::Actuator ( Actuator &&  )
default

◆ Actuator() [2/3]

Actuator::Actuator ( const Actuator )
default

◆ ~Actuator()

Actuator::~Actuator ( )
inline

◆ Actuator() [3/3]

Actuator::Actuator ( )
inlineprivate

Member Function Documentation

◆ actuate()

Vec3< float > Actuator::actuate ( Vec3< float >  vel,
Vec3< float >  psis,
uint32_t  dt_millis,
int8_t  test = 0 
)

Function that actuate the robot's base(omni-base)

Parameters
vel: A vector that holds vx, vy and omega
psis: A vector that holds psi_target, psi and psi_dot
dt_millis: The time period at which this function is called periodically
Return values
Avector that holds vx, vy and omega of the base in the last frame
Tasks performed by this function
1) Calculates omegas of each wheel to reach the given velocities using the
   Coupling Matrix
2) Measure omega of each wheels
3) Compute error
4) Compute PID using available PID_Algorithm
5) set Omega of each wheel
6) update new omegas of all wheels at once
7) Calculates vx, vy and rw of the base from the measured omegas of each
   wheel using the inverse Coupling Matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check()

void Actuator::check ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void Actuator::clear ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_Instance()

Actuator & Actuator::get_Instance ( )
static
Here is the caller graph for this function:

◆ init()

int Actuator::init ( )

Function that initializes all the required components for the robot's actuator(omni-base)

Return values
None
Tasks performed by this function
1) Call the devices initializations in correct order
2) Call the software initializations for utilities like pid for wheels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

Actuator& Actuator::operator= ( Actuator &&  )
default

◆ operator=() [2/2]

Actuator& Actuator::operator= ( const Actuator )
default

◆ pid_Init()

void Actuator::pid_Init ( )
private

Function that initializes all the required components for the wheel's pid controller.

Return values
None
Tasks performed by this function
1) Assigns gains for PID controller of each wheel
2) Assigns separate PID controllers for each wheel
Here is the caller graph for this function:

◆ profile()

void Actuator::profile ( Vec3< float >  vel,
uint32_t  dt_millis 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_AnglePID()

void Actuator::set_AnglePID ( PID pid)
inlineprivate

◆ stop()

uint32_t Actuator::stop ( uint32_t  dt_millis,
float  ramp_factor = 2.0,
uint32_t  max_time = 1000 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wheels_Init()

void Actuator::wheels_Init ( void  )
private

Function that initializes all the required components for the wheels of the robot.

Return values
None
Tasks performed by this function
1) Assigns appropriate IDs to each wheel
2) Give each wheel the respective radius
3) Assign a timer and a channel to each wheel for it's motor to run in PWM
   mode. A timer is shared among all the available wheels since we have
   four wheels.
4) Assigns the ppr of each wheel's encoder
5) Assigns the direction pins for each motor's direction
6) Assigns timer for each wheel's encoder
7) Starts the timers to run each wheel in respective configured modes like PWM
   mode and the Encoder mode

Need to make sure the following value is correct

Here is the caller graph for this function:

Member Data Documentation

◆ angle_pid_

PID* Actuator::angle_pid_
private

◆ wheels_

Wheel Actuator::wheels_[4]
private

The documentation for this class was generated from the following files: