Add firmware code to repo (#8)

* Added primary stepper motor driver code to repo
* Added odometery encoder code to repo
* Added the ability to update encoder wheel ratio via ros service
Co-authored-by: Pimpest <82343504+Pimpest@users.noreply.github.com>
Co-committed-by: Pimpest <82343504+Pimpest@users.noreply.github.com>
This commit is contained in:
2025-04-09 14:49:19 +00:00
committed by Pimpest
parent c1b5a3ea1c
commit a4691caeed
19 changed files with 1131 additions and 4 deletions

View File

@ -0,0 +1,25 @@
#pragma once
//############## CONFIG STEPPERS ################
#define DIR_PIN_A 16
#define DIR_PIN_B 26
#define PULSE_PIN_A 17
#define PULSE_PIN_B 27
#define SM_A 0
#define SM_B 1
#define PULSE_PER_REV (1 / 3200.0)
//###############################################
//================ CONFIG ENCODERS =====================
#define ENCODER_RIGHT_PIN_A 12 // Lupio sam ove vrednosti
#define ENCODER_RIGHT_PIN_B 13
#define ENCODER_LEFT_PIN_A 6
#define ENCODER_LEFT_PIN_B 7
#define ENCODER_CPR 3840
#define WHEEL_RADIUS 0.0279
#define WHEEL_SEPARATION 0.31133
#define TIMER_CYCLE_US 1000
//======================================================