Commit 36917379 authored by Arnaud CADOT's avatar Arnaud CADOT
Browse files

Removed obsolete code, added periodic call to Remote::update

parent 0d58475f
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "asservissement/asservissement.h" #include "asservissement/asservissement.h"
#include "hardware/tourelle.h" #include "hardware/tourelle.h"
#include "hardware/leds.h" #include "hardware/leds.h"
#include "hardware/remote.h"
#ifndef ROBOTHW #ifndef ROBOTHW
#include <QTimer> #include <QTimer>
...@@ -22,6 +23,7 @@ void Clock::everyTick() ...@@ -22,6 +23,7 @@ void Clock::everyTick()
void Clock::every5ms() void Clock::every5ms()
{ {
#ifndef STM32F40_41xxx #ifndef STM32F40_41xxx
Remote::getSingleton()->update();
Odometrie::odometrie->update(); Odometrie::odometrie->update();
Asservissement::asservissement->update(); Asservissement::asservissement->update();
Tourelle::getSingleton()->update(); Tourelle::getSingleton()->update();
......
...@@ -89,11 +89,6 @@ StrategieV2::StrategieV2(bool yellow) ...@@ -89,11 +89,6 @@ StrategieV2::StrategieV2(bool yellow)
sharps = sensors->getSharpSensorsList(); sharps = sensors->getSharpSensorsList();
emptySharpsToCheck(); emptySharpsToCheck();
#ifdef ROBOTHW
// tourelle = new Tourelle(TIM6, 0);//TIM parameter is not implemented yet
// tourelle = new Tourelle();
//tourelle->setZoneCritique(10, 27000);
#endif
updateCount = 0; updateCount = 0;
} }
...@@ -119,41 +114,15 @@ void StrategieV2::resetTime() ...@@ -119,41 +114,15 @@ void StrategieV2::resetTime()
void StrategieV2::update() void StrategieV2::update()
{ {
#ifndef NO_REMOTE /*#ifndef NO_REMOTE
Remote::getSingleton()->update(); Remote::getSingleton()->update();
#endif #endif*/
if (!currentAction) if (!currentAction)
{ {
Asservissement::asservissement->setCommandSpeeds(NULL); Asservissement::asservissement->setCommandSpeeds(NULL);
return; return;
} }
//Tourelle* tourelle = new Tourelle(TIM6, 0);
/*
uint8_t resultZoneCritique = tourelle->setZoneCritique(10, 27000);
uint16_t resultAngle = tourelle->calculAngle(0);
// objectDetectionInstant[0] = 0;
// resultAngle = tourelle->calculAngle(0);
// objectDetectionInstant[0] = 10;
// resultAngle = tourelle->calculAngle(0);
// objectDetectionInstant[0] = 20;
// resultAngle = tourelle->calculAngle(0);
// objectDetectionInstant[0] = 40;
// resultAngle = tourelle->calculAngle(0);
bool resultUpdate = tourelle->update();
resultUpdate = tourelle->update();
nombreObjetDetecte = 1;
resultUpdate = tourelle->update();
*/
if (StrategieV2::strategie == NULL) if (StrategieV2::strategie == NULL)
return; return;
...@@ -162,33 +131,7 @@ void StrategieV2::update() ...@@ -162,33 +131,7 @@ void StrategieV2::update()
if(currentAction) if(currentAction)
currentAction->updateTime(90*1000-updateCount*5); currentAction->updateTime(90*1000-updateCount*5);
#ifdef ROBOTHW
// if (updateCount % 6 == 2)
// {
// EXTI_GenerateSWInterrupt(EXTI_Line2);
// }
// if (updateCount % 6 == 3)
// {
// EXTI_GenerateSWInterrupt(EXTI_Line3);
// }
//On met à jour l'indicateur de "on doit rallentir"
// bool returnTourelle = tourelle->updateSimple();
// if(returnTourelle)
// {
// //allumerLED();
// hysteresisTourelle = 100;// On ralenti pendant 0,5s mini
// }
// else if (hysteresisTourelle > 0)
// {
// hysteresisTourelle--;
// }
//
// //On donne l'ordre de ralentir, si besoin
// currentCommand->limitSpeed(hysteresisTourelle);
#endif
if (updateCount < 0) if (updateCount < 0)
{ {
updateCount = 50000; updateCount = 50000;
......
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