MotorController
Data Structures | Functions | Variables
position.h File Reference

Go to the source code of this file.

Data Structures

struct  ticks_t
 
struct  position_t
 

Functions

void compute_movement (void)
 Compute the coding wheels movements. More...
 
void update_position (void)
 Update the position according to the information given by the coding wheels. More...
 

Variables

ticks_t previous_ticks
 
ticks_t delta_ticks
 
position_t cur_pos
 

Function Documentation

§ compute_movement()

void compute_movement ( void  )

Compute the coding wheels movements.

Definition at line 39 of file position.c.

§ update_position()

void update_position ( void  )

Update the position according to the information given by the coding wheels.

This function must be called AFTER update_orientation(), as it considers that the 'orientation' variable holds the new orientation.

Coding wheels ticks, at previous cur_pos update. A separate variable is used because cur_pos update frequency can be different from the compute_movement one.

Definition at line 48 of file position.c.

Variable Documentation

§ cur_pos

position_t cur_pos

Current cartesian coordinates of the robot center, in mm.

Definition at line 22 of file position.c.

§ delta_ticks

ticks_t delta_ticks

Variation of the coding wheels, in ticks.

Definition at line 20 of file position.c.

§ previous_ticks

ticks_t previous_ticks

For tests only.

Definition at line 18 of file position.c.