fix steering implementation
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
#include "drive.h"
|
||||
#include "car.h"
|
||||
#include "can_message.h"
|
||||
#include "steering.h"
|
||||
#include "factory/factory.h"
|
||||
//#include "steering.h"
|
||||
//#include "factory/factory.h"
|
||||
|
||||
void DRIVE_init(DRIVE* me){
|
||||
me->state = STDR_INIT;
|
||||
@@ -33,7 +33,7 @@ bool DRIVE_processEvent(Event* ev) {
|
||||
DRIVE_STATES oldState = me->state;
|
||||
evIDT evid = Event_getId(ev);
|
||||
uint64_t data = Event_getData(ev);
|
||||
STEERING_STATES steeringState = steering()->state;
|
||||
// STEERING_STATES steeringState = steering()->state;
|
||||
|
||||
|
||||
switch (me->state) { // onState
|
||||
@@ -59,9 +59,9 @@ bool DRIVE_processEvent(Event* ev) {
|
||||
}
|
||||
|
||||
if (ev->id == evDRpollTorque) {
|
||||
if(steeringState == STST_RUN) {
|
||||
//if(steeringState == STST_RUN) {
|
||||
CM_DRIVE_POWER(&eKart.torque);
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
if (ev->id == evDRpollSpeed) {
|
||||
|
||||
@@ -105,8 +105,8 @@ void Factory_build() {
|
||||
DRIVE_onRun(drive(), LED_on, l2());
|
||||
DRIVE_onDead(drive(), LED_off, l2());
|
||||
|
||||
STEERING_onRun(drive(), LED_on, l3());
|
||||
STEERING_onDead(drive(), LED_off, l3());
|
||||
STEERING_onRun(steering(), LED_on, l3());
|
||||
STEERING_onDead(steering(), LED_off, l3());
|
||||
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ void Factory_start() {
|
||||
STEERING_startBehaviour(steering());
|
||||
|
||||
ALIVE_startBehaviourSender(ALcontroller());
|
||||
|
||||
ALIVE_startBehaviourChecker(ALjoy());
|
||||
ALIVE_emitBorn(ALjoy(), 100, 0);
|
||||
ALIVE_emitReady(ALjoy(), 200, 0);
|
||||
|
||||
Reference in New Issue
Block a user