Commit b93d0b4a authored by Allvey's avatar Allvey

增加穿越装载区距离判断,增加配置文件因子(暂时未启用)

parent 9930df8b
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
}, },
"gothrough": { "gothrough": {
"closer_area_name": "哈装测试", "closer_area_name": "哈装测试",
"further_area_name": "哈装2" "further_area_name": "哈装2",
"factor" : 0.6
}, },
"geom": { "geom": {
"redispatch_minimal_distance": 40 "redispatch_minimal_distance": 40
......
...@@ -562,40 +562,46 @@ class GroupDispatcher: ...@@ -562,40 +562,46 @@ class GroupDispatcher:
self.logger.info("穿越装载区调度开启") self.logger.info("穿越装载区调度开启")
# 更新判定路段区域 # 更新判定路段区域
self.gothroghdispatcher.update_lanes_info() cross_lane = self.gothroghdispatcher.update_lanes_info()
try:
# 获取近端装载区入场点经纬度信息
excavator_prise_location = get_excavator_prise_location(self.gothroghdispatcher.closer_excavator_id)
# 获取车辆经纬度信息
truck_prise_location = self.group.truck.truck_current_prise_location[truck_id]
except Exception as es:
self.logger.error("挖机或车辆经纬信息未知")
self.logger.error(es)
excavator_prise_location = [-1, -1]
truck_prise_location = [-1, -1]
self.logger.info(f'挖机经纬度信息 {excavator_prise_location}')
self.logger.info(f'车辆经纬度信息 {truck_prise_location}')
from haversine import haversine # 获取车辆经纬度信息
truck_prise_location = self.group.truck.truck_current_prise_location[truck_id]
truck_to_entrance_point_dis = haversine(excavator_prise_location, truck_prise_location) if not is_close_to_cross(cross_lane, truck_prise_location):
self.logger.info(f'车辆到近端装载区入场点距离 {truck_to_entrance_point_dis}') self.logger.info(f'距离过近无法触发穿越装载区调度')
# 若车辆到入场点距离大于指定阈值
if excavator_prise_location[0] != -1 and \
truck_prise_location[0] != -1 and \
haversine(excavator_prise_location, truck_prise_location) > 0.001 and \
truck_locate in self.gothroghdispatcher.closer_area_backtrack_lanes[0:2]:
try: try:
self.logger.info("触发穿越装载区调度") # 获取近端装载区入场点经纬度信息
planned = self.gothroghdispatcher.redispatch_request(request_truck_id=truck_id, excavator_prise_location = get_excavator_prise_location(self.gothroghdispatcher.closer_excavator_id)
truck=self.group.truck, truck_dispatch=truck_dispatch, truck_info=truck_info) # 获取车辆经纬度信息
self.logger.info(f'穿越装载区调度成功? {planned}') truck_prise_location = self.group.truck.truck_current_prise_location[truck_id]
except Exception as es: except Exception as es:
self.logger.error("穿越调度失败") self.logger.error("挖机或车辆经纬信息未知")
self.logger.error(es) self.logger.error(es)
excavator_prise_location = [-1, -1]
truck_prise_location = [-1, -1]
self.logger.info(f'挖机经纬度信息 {excavator_prise_location}')
self.logger.info(f'车辆经纬度信息 {truck_prise_location}')
from haversine import haversine
truck_to_entrance_point_dis = haversine(excavator_prise_location, truck_prise_location)
self.logger.info(f'车辆到近端装载区入场点距离 {truck_to_entrance_point_dis}')
# 若车辆到入场点距离大于指定阈值
if excavator_prise_location[0] != -1 and \
truck_prise_location[0] != -1 and \
haversine(excavator_prise_location, truck_prise_location) > 0.001 and \
truck_locate in self.gothroghdispatcher.closer_area_backtrack_lanes[0:2]:
try:
self.logger.info("触发穿越装载区调度")
planned = self.gothroghdispatcher.redispatch_request(request_truck_id=truck_id,
truck=self.group.truck, truck_dispatch=truck_dispatch, truck_info=truck_info)
self.logger.info(f'穿越装载区调度成功? {planned}')
except Exception as es:
self.logger.error("穿越调度失败")
self.logger.error(es)
# 未触发穿越装载区调度, 判断是否开启二次调度 # 未触发穿越装载区调度, 判断是否开启二次调度
if not planned and self.group.topo is not None and truck_locate is not None: if not planned and self.group.topo is not None and truck_locate is not None:
...@@ -1306,6 +1312,8 @@ class GoThroughDispatcher: ...@@ -1306,6 +1312,8 @@ class GoThroughDispatcher:
self.logger.info("cross_lane") self.logger.info("cross_lane")
self.logger.info(cross_lane) self.logger.info(cross_lane)
return cross_lane
# 截取远端入场点到交叉口的路段 # 截取远端入场点到交叉口的路段
# self.further_area_backtrack_lanes = self.further_area_backtrack_lanes[ # self.further_area_backtrack_lanes = self.further_area_backtrack_lanes[
# 0:self.further_area_backtrack_lanes.index(cross_lane)] # 0:self.further_area_backtrack_lanes.index(cross_lane)]
......
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
# @File : versiontag.py.py # @File : versiontag.py.py
# @Software: PyCharm # @Software: PyCharm
VERSION_TAG = '78' VERSION_TAG = '79'
\ No newline at end of file \ No newline at end of file
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