diff --git a/software/raspberry/superviseur-robot/tasks.cpp b/software/raspberry/superviseur-robot/tasks.cpp index 770ed3c..ae5b94d 100644 --- a/software/raspberry/superviseur-robot/tasks.cpp +++ b/software/raspberry/superviseur-robot/tasks.cpp @@ -404,7 +404,7 @@ void Tasks::ReceiveFromMonTask(void *arg) { } else if (msgRcv->CompareID(MESSAGE_ROBOT_START_WITH_WD)) { cout << "Command Start Robot with Watchdog Received" << endl << flush; - rt_sem_v(&sem_startRobotWithoutWatchdog); + rt_sem_v(&sem_startRobotWithWatchdog); } else if (msgRcv->CompareID(MESSAGE_CAM_ASK_ARENA)) { cout << "Command Search Arena Received" << endl << flush; @@ -591,7 +591,9 @@ void Tasks::StartRobotTaskWithWatchdog(void *arg) { while (killBatteryOk==0) { cpt++; if(cpt==2){ + rt_mutex_acquire(&mutex_robot, TM_INFINITE); robot.Write(robot.ReloadWD()); + rt_mutex_release(&mutex_robot); cpt=0; } rt_task_wait_period(NULL); @@ -656,8 +658,10 @@ void Tasks::AskBattery(void *arg){ rt_mutex_acquire(&mutex_robot, TM_INFINITE); p_mess_answer_battery = robot.Write(robot.GetBattery()); rt_mutex_release(&mutex_robot); - WriteInQueue(&q_messageToMon, p_mess_answer_battery); - cout << endl << flush; + if(p_mess_answer_battery->GetID()==MESSAGE_ROBOT_BATTERY_LEVEL){ + WriteInQueue(&q_messageToMon, p_mess_answer_battery); + cout << endl << flush; + } } }