Nasal: minor fixes
This commit is contained in:
parent
850fafed3d
commit
2e50a9ad8c
|
@ -22,21 +22,21 @@ var autoHoldMainLoop = func(){
|
|||
if(!door1.getpos() and !door2.getpos() and !door3.getpos() and !door4.getpos() and engineNode.getValue()){
|
||||
followme.brakeController.applyBrakes(1);
|
||||
working = 1;
|
||||
workingNode.setValue(1);
|
||||
workingNode.setIntValue(1);
|
||||
}else{
|
||||
stopAndSwitchToParking();
|
||||
}
|
||||
}else if(!math.round(currentSpeed)){
|
||||
followme.brakeController.applyBrakes(0);
|
||||
working = 0;
|
||||
workingNode.setValue(0);
|
||||
workingNode.setIntValue(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
var stopAndSwitchToParking = func(){
|
||||
followme.brakeController.applyBrakes(0);
|
||||
working = 0;
|
||||
workingNode.setValue(0);
|
||||
workingNode.setIntValue(0);
|
||||
followme.brakeController.enableHandBrake();
|
||||
}
|
||||
|
||||
|
@ -45,17 +45,17 @@ var autoHoldTimer = maketimer(0.05,autoHoldMainLoop);
|
|||
var startAutoHold = func(){
|
||||
autoHoldTimer.start();
|
||||
active = 1;
|
||||
activeNode.setValue(1);
|
||||
activeNode.setIntValue(1);
|
||||
}
|
||||
|
||||
var stopAutoHold = func(){
|
||||
active = 0;
|
||||
activeNode.setValue(0);
|
||||
activeNode.setIntValue(0);
|
||||
autoHoldTimer.stop();
|
||||
currentSpeed = speedNode.getValue();
|
||||
if(followme.brakeController.applyingFeetBrake){
|
||||
working = 0;
|
||||
workingNode.setValue(0);
|
||||
workingNode.setIntValue(0);
|
||||
followme.brakeController.applyBrakes(0);
|
||||
}else if(!math.round(currentSpeed)){
|
||||
stopAndSwitchToParking();
|
||||
|
|
|
@ -551,7 +551,7 @@ var Safety = {
|
|||
me.aebEnabled = 1;
|
||||
me.frontRadar.initWithoutStarting();
|
||||
#//me.frontRadar.stop();
|
||||
me.aebOnProp.setValue(1);
|
||||
me.aebOnProp.setIntValue(1);
|
||||
print("AEB enabled");
|
||||
},
|
||||
disableAEB: func(){
|
||||
|
@ -559,7 +559,7 @@ var Safety = {
|
|||
me.aebTimer.stop();
|
||||
if(me.aebEnabled) me.frontRadar.stop();
|
||||
me.aebEnabled = 0;
|
||||
me.aebOnProp.setValue(0);
|
||||
me.aebOnProp.setIntValue(0);
|
||||
print("AEB disabled");
|
||||
},
|
||||
toggleAEB: func(){
|
||||
|
@ -583,9 +583,9 @@ var Safety = {
|
|||
print("AEB Slow Mode");
|
||||
},
|
||||
aebFastMode: func(){
|
||||
me.frontRadar.maxRange = 18;
|
||||
me.frontRadar.maxRange = 20;
|
||||
#me.frontRadar.maxWidth = 0.05;
|
||||
me.aebThreshold = 18;
|
||||
me.aebThreshold = 20;
|
||||
me.aebFullThreshold = 16;
|
||||
me.aebMode = 2;
|
||||
print("AEB Fast Mode");
|
||||
|
@ -653,7 +653,7 @@ var Safety = {
|
|||
if(currentSpeed <= 0){
|
||||
me.aebStop();
|
||||
#print("1");
|
||||
}else if(me.aebCount >= 20){
|
||||
}else if(me.aebCount >= 15){
|
||||
me.aebStop();
|
||||
#print("2");
|
||||
}
|
||||
|
@ -664,7 +664,7 @@ var Safety = {
|
|||
if(currentSpeed <= 0){
|
||||
me.aebStop();
|
||||
#print("11");
|
||||
}else if(me.aebCount >= 20){
|
||||
}else if(me.aebCount >= 15){
|
||||
me.aebStop();
|
||||
#print("22");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue