Commit 95d7f260 authored by Arnaud Cadot's avatar Arnaud Cadot

Fixed simulator code not compiling because of missing ifdef.

Fixed some warnings
parent 63f3e35b
......@@ -10,6 +10,8 @@ greaterThan(QT_MAJOR_VERSION, 4) {
DEFINES += BLUETOOTH QT5 USE_PLOT
}
QMAKE_CXXFLAGS += -Wno-reorder -Wno-unused-variable
INCLUDEPATH += ../../include ../../../stm32/Libraries/CMSIS/Core/CM3 ../../../stm32/Libraries/STM32F10x_StdPeriph_Driver/inc /usr/local/include/Box2D
INCLUDEPATH += ../../include/simul ../../include/strategie ../../include/asservissement ../../include/actionneurs ../../include/hardware
......
#ifndef LOOP_H
#define LOOP_H
static long systick_count = 0;
/**@brief fonction externe appellé directement par le microcontroleur à chaque mise à jour. C'est grace à cette fonction que des actions sont exécutés à intervalle régulier */
extern "C" void SysTick_Handler();
static long systick_count = 0;
/**@brief fonction externe appellé directement par le microcontroleur à chaque mise à jour. C'est grace à cette fonction que des actions sont exécutés à intervalle régulier */
extern "C" void SysTick_Handler();
#endif // LOOP_H
This diff is collapsed.
......@@ -11,17 +11,19 @@ bool Command::limiter = false;
bool Command::previousWasSmooth = false;
Command::Command() : mFinished(false), linSpeed(Odometrie::odometrie->getVitesseLineaire()), angSpeed(Odometrie::odometrie->getVitesseAngulaire())
Command::Command()
{
Command::stop = false;
fromSmoothMovement = previousWasSmooth;
previousWasSmooth = false;
angSpeed = Odometrie::odometrie->getVitesseAngulaire();
linSpeed = Odometrie::odometrie->getVitesseLineaire();
mFinished = false;
fromSmoothMovement = previousWasSmooth;
previousWasSmooth = false;
}
Command::~Command()
{
}
{}
bool Command::getStop(void)
{
......
......@@ -13,9 +13,14 @@
#include "debugwindow.h"
#endif
CommandAllerA::CommandAllerA(Position p, bool reculer, float vitesseLineaireMax, float vitesseFin, float precisionAngle, float stopAtDistance)
: Command(), smoothFactor(0.f), requireSmoothMovement(false), bonAngle(false), angleSmoothEnd(false), stopAtDistance(stopAtDistance)
CommandAllerA::CommandAllerA(Position p, bool reculer, float vitesseLineaireMax, float vitesseFin, float /*precisionAngle*/, float distance): Command()
{
smoothFactor = 0.f;
requireSmoothMovement = false;
bonAngle = false;
angleSmoothEnd = false;
stopAtDistance = distance;
but = p;
vitesseLinMax = vitesseLineaireMax;
vFin2 = vitesseFin*vitesseFin;
......
......@@ -2,7 +2,7 @@
PIDFilterAngle::PIDFilterAngle() :
sommeErreurs(0), erreurPrecedente(0),
Kp(FILTER_ANGLE_KP), Kd(FILTER_ANGLE_KD), Ki(FILTER_ANGLE_KI)
Kp(FILTER_ANGLE_KP), Ki(FILTER_ANGLE_KI), Kd(FILTER_ANGLE_KD)
{
}
......
......@@ -2,7 +2,7 @@
PIDFilterDistance::PIDFilterDistance() :
sommeErreurs(0), erreurPrecedente(0),
Kp(FILTER_LINEAIRE_KP), Kd(FILTER_LINEAIRE_KD), Ki(FILTER_LINEAIRE_KI)
Kp(FILTER_LINEAIRE_KP), Ki(FILTER_LINEAIRE_KI), Kd(FILTER_LINEAIRE_KD)
{
}
......
......@@ -22,8 +22,10 @@ void InitKrabiJunior::setYellow()
/** Initialisation roues codeuses **/
void InitKrabiJunior::initRotaryEncoders()
{
#ifdef ROBOTHW
rcd = new QuadratureCoderHandler(TIM4, GPIOB, GPIO_Pin_6, GPIOB, GPIO_Pin_7, GPIO_AF_TIM4, GPIO_PinSource6, GPIO_PinSource7);
rcg = new QuadratureCoderHandler(TIM1, GPIOA, GPIO_Pin_8, GPIOA, GPIO_Pin_9, GPIO_AF_TIM1, GPIO_PinSource8, GPIO_PinSource9);
#endif
}
......
......@@ -11,6 +11,7 @@
#include "initialisation.h"
#include "hardware/tourelle.h"
//pour lancer l'update à chaque tic d'horloge
extern "C" void SysTick_Handler()
......@@ -249,13 +250,13 @@ void initialisationDesPIN()
#ifdef STM32F40_41xxx // pour la STM32 H405 2014 v1 :
// Roues codeuses
/*GPIO_PinAFConfig (GPIOB, GPIO_PinSource6, GPIO_AF_TIM4);
GPIO_PinAFConfig (GPIOB, GPIO_PinSource6, GPIO_AF_TIM4);
GPIO_PinAFConfig (GPIOB, GPIO_PinSource7, GPIO_AF_TIM4);
GPIO_PinAFConfig (GPIOA, GPIO_PinSource8, GPIO_AF_TIM1);
GPIO_PinAFConfig (GPIOA, GPIO_PinSource9, GPIO_AF_TIM1);*/
GPIO_PinAFConfig (GPIOA, GPIO_PinSource9, GPIO_AF_TIM1);
// Moteurs
/*GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
......
......@@ -22,8 +22,10 @@ void InitKrabi::setYellow()
/** Initialisation roues codeuses **/
void InitKrabi::initRotaryEncoders()
{
#ifdef ROBOTHW
rcd = new QuadratureCoderHandler(TIM4, GPIOD, GPIO_Pin_12, GPIOD, GPIO_Pin_13);
rcg = new QuadratureCoderHandler(TIM3, GPIOA, GPIO_Pin_6, GPIOA, GPIO_Pin_7);
#endif
}
void InitKrabi::initClock()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment