fix. roadlimitspeed
fix.. navInstruction speedLimit
This commit is contained in:
parent
d770b4f578
commit
3687f7a012
@ -847,6 +847,7 @@ class CarrotServ:
|
|||||||
self.params_memory = Params("/dev/shm/params")
|
self.params_memory = Params("/dev/shm/params")
|
||||||
|
|
||||||
self.nRoadLimitSpeed = 30
|
self.nRoadLimitSpeed = 30
|
||||||
|
self.nRoadLimitSpeed_counter = 0
|
||||||
|
|
||||||
self.active_carrot = 0 ## 1: CarrotMan Active, 2: sdi active , 3: speed decel active, 4: section active, 5: bump active, 6: speed limit active
|
self.active_carrot = 0 ## 1: CarrotMan Active, 2: sdi active , 3: speed decel active, 4: section active, 5: bump active, 6: speed limit active
|
||||||
self.active_count = 0
|
self.active_count = 0
|
||||||
@ -1746,7 +1747,13 @@ class CarrotServ:
|
|||||||
nRoadLimitSpeed = 30
|
nRoadLimitSpeed = 30
|
||||||
else:
|
else:
|
||||||
nRoadLimitSpeed = 30
|
nRoadLimitSpeed = 30
|
||||||
self.nRoadLimitSpeed = nRoadLimitSpeed
|
#self.nRoadLimitSpeed = nRoadLimitSpeed
|
||||||
|
if self.nRoadLimitSpeed != nRoadLimitSpeed:
|
||||||
|
self.nRoadLimitSpeed_counter += 1
|
||||||
|
if self.nRoadLimitSpeed_counter > 5:
|
||||||
|
self.nRoadLimitSpeed = nRoadLimitSpeed
|
||||||
|
else:
|
||||||
|
self.nRoadLimitSpeed_counter = 0
|
||||||
|
|
||||||
### SDI
|
### SDI
|
||||||
self.nSdiType = int(json.get("nSdiType", -1))
|
self.nSdiType = int(json.get("nSdiType", -1))
|
||||||
|
@ -298,6 +298,8 @@ class RouteEngine:
|
|||||||
|
|
||||||
if ('maxspeed' in closest.annotations) and self.localizer_valid:
|
if ('maxspeed' in closest.annotations) and self.localizer_valid:
|
||||||
msg.navInstruction.speedLimit = closest.annotations['maxspeed']
|
msg.navInstruction.speedLimit = closest.annotations['maxspeed']
|
||||||
|
print(closest.annotations)
|
||||||
|
|
||||||
|
|
||||||
# Speed limit sign type
|
# Speed limit sign type
|
||||||
if 'speedLimitSign' in step:
|
if 'speedLimitSign' in step:
|
||||||
|
@ -1155,7 +1155,7 @@ public:
|
|||||||
const auto nav_inst = sm["navInstruction"].getNavInstruction();
|
const auto nav_inst = sm["navInstruction"].getNavInstruction();
|
||||||
xTurnInfo = 0;
|
xTurnInfo = 0;
|
||||||
xDistToTurn = nav_inst.getManeuverDistance();
|
xDistToTurn = nav_inst.getManeuverDistance();
|
||||||
nRoadLimitSpeed = nav_inst.getSpeedLimit();
|
nRoadLimitSpeed = nav_inst.getSpeedLimit() * 3.6;
|
||||||
QString maneuverType = QString::fromStdString(nav_inst.getManeuverType());
|
QString maneuverType = QString::fromStdString(nav_inst.getManeuverType());
|
||||||
QString manuverModifier = QString::fromStdString(nav_inst.getManeuverModifier());
|
QString manuverModifier = QString::fromStdString(nav_inst.getManeuverModifier());
|
||||||
if (maneuverType == "turn") {
|
if (maneuverType == "turn") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user