CRINSA-team2025 V1
Documentation du Club Robot INSA Rennes 2025
Chargement...
Recherche...
Aucune correspondance
Elevator.h
1
2//
3// Created by Romain Pouvreau on 08/03/2026.
4//
5
6#ifndef ELEVATOR_H
7#define ELEVATOR_H
8#include "DifferentialController.h"
9
10namespace HazelnutGripper
11{
19 {
20 public:
21 virtual ~AbstractAbsoluteEncoder() = default;
22
27 virtual float getAngle() = 0;
28
32 virtual void init() = 0;
33 };
34
41 namespace Elevator
42 {
43 inline AbstractMotor* m_motor = nullptr;
44 inline AbstractAbsoluteEncoder* m_encoder = nullptr;
45 inline float m_currentAngle = 0.0f;
46 inline float m_angleSetpoint = 0.0f;
47 inline PID* m_pid = nullptr;
48 constexpr float m_maxAngle = 83;
49 constexpr float m_minAngle = 160.312500;
50 constexpr float m_maxRange = m_minAngle - m_maxAngle;
51
52 enum elevatorHeight {
53 BAS = 0,
54 CAPTEURS = 10,
55 HAUT = static_cast<int>(m_maxRange),
56 };
57
58
66 void init(AbstractMotor* motor, AbstractAbsoluteEncoder* encoder);
67
72 inline void setAngle(float angle) { m_angleSetpoint = m_minAngle - angle; }
73
74 inline float getAngle() {return m_minAngle - m_angleSetpoint;}
75
82 [[noreturn]] void task(void *pvParameters);
83
88 inline void setPID(PID& pid) { m_pid = &pid; }
89
90 };
91}
92
93#endif // ELEVATOR_H
Definition Elevator.h:11
Interface pour un encodeur de position absolue.
Definition Elevator.h:19
virtual float getAngle()=0
Récupère la position angulaire actuelle.
virtual void init()=0
Initialise le matériel de l'encodeur.
Classe d'asservissement.
Definition PID.h:13
Namespace gérant l'asservissement en position de l'ascenseur.
Espace de noms regroupant les fonctionnalités de contrôle de la pince Baguette.
Definition BournsACEncoder.h:10