提交 ef922a9f 编写于 作者: U unacao 提交者: siyangy

reduce some point cloud rendering (#2981)

上级 2a64039c
......@@ -38,6 +38,7 @@ using Json = nlohmann::json;
PointCloudUpdater::PointCloudUpdater(WebSocketHandler *websocket)
: websocket_(websocket) {
RegisterMessageHandlers();
point_cloud_.SerializeToString(&point_cloud_str_);
}
void PointCloudUpdater::RegisterMessageHandlers() {
......
......@@ -4,6 +4,124 @@
"nested": {
"hdmap": {
"nested": {
"Projection": {
"fields": {
"proj": {
"type": "string",
"id": 1
}
}
},
"Header": {
"fields": {
"version": {
"type": "bytes",
"id": 1
},
"date": {
"type": "bytes",
"id": 2
},
"projection": {
"type": "Projection",
"id": 3
},
"district": {
"type": "bytes",
"id": 4
},
"generation": {
"type": "bytes",
"id": 5
},
"revMajor": {
"type": "bytes",
"id": 6
},
"revMinor": {
"type": "bytes",
"id": 7
},
"left": {
"type": "double",
"id": 8
},
"top": {
"type": "double",
"id": 9
},
"right": {
"type": "double",
"id": 10
},
"bottom": {
"type": "double",
"id": 11
},
"vendor": {
"type": "bytes",
"id": 12
}
}
},
"Map": {
"fields": {
"header": {
"type": "Header",
"id": 1
},
"crosswalk": {
"rule": "repeated",
"type": "Crosswalk",
"id": 2
},
"junction": {
"rule": "repeated",
"type": "Junction",
"id": 3
},
"lane": {
"rule": "repeated",
"type": "Lane",
"id": 4
},
"stopSign": {
"rule": "repeated",
"type": "StopSign",
"id": 5
},
"signal": {
"rule": "repeated",
"type": "Signal",
"id": 6
},
"yield": {
"rule": "repeated",
"type": "YieldSign",
"id": 7
},
"overlap": {
"rule": "repeated",
"type": "Overlap",
"id": 8
},
"clearArea": {
"rule": "repeated",
"type": "ClearArea",
"id": 9
},
"speedBump": {
"rule": "repeated",
"type": "SpeedBump",
"id": 10
},
"road": {
"rule": "repeated",
"type": "Road",
"id": 11
}
}
},
"ClearArea": {
"fields": {
"id": {
......@@ -420,124 +538,6 @@
}
}
},
"Projection": {
"fields": {
"proj": {
"type": "string",
"id": 1
}
}
},
"Header": {
"fields": {
"version": {
"type": "bytes",
"id": 1
},
"date": {
"type": "bytes",
"id": 2
},
"projection": {
"type": "Projection",
"id": 3
},
"district": {
"type": "bytes",
"id": 4
},
"generation": {
"type": "bytes",
"id": 5
},
"revMajor": {
"type": "bytes",
"id": 6
},
"revMinor": {
"type": "bytes",
"id": 7
},
"left": {
"type": "double",
"id": 8
},
"top": {
"type": "double",
"id": 9
},
"right": {
"type": "double",
"id": 10
},
"bottom": {
"type": "double",
"id": 11
},
"vendor": {
"type": "bytes",
"id": 12
}
}
},
"Map": {
"fields": {
"header": {
"type": "Header",
"id": 1
},
"crosswalk": {
"rule": "repeated",
"type": "Crosswalk",
"id": 2
},
"junction": {
"rule": "repeated",
"type": "Junction",
"id": 3
},
"lane": {
"rule": "repeated",
"type": "Lane",
"id": 4
},
"stopSign": {
"rule": "repeated",
"type": "StopSign",
"id": 5
},
"signal": {
"rule": "repeated",
"type": "Signal",
"id": 6
},
"yield": {
"rule": "repeated",
"type": "YieldSign",
"id": 7
},
"overlap": {
"rule": "repeated",
"type": "Overlap",
"id": 8
},
"clearArea": {
"rule": "repeated",
"type": "ClearArea",
"id": 9
},
"speedBump": {
"rule": "repeated",
"type": "SpeedBump",
"id": 10
},
"road": {
"rule": "repeated",
"type": "Road",
"id": 11
}
}
},
"BoundaryEdge": {
"fields": {
"curve": {
......
......@@ -71,7 +71,7 @@ options:
showObstaclesVelocity: true
showObstaclesHeading: true
showObstaclesId: true
showPointCloud: true
showPointCloud: false
showPositionGps: false
showPositionLocalization: true
cameraAngle: Default
......
......@@ -41,14 +41,11 @@ export default class PointCloudWebSocketEndpoint {
// Request point cloud every 100ms.
clearInterval(this.timer);
this.timer = setInterval(() => {
if (this.websocket.readyState === this.websocket.OPEN) {
if (STORE.options.showPointCloud === true) {
this.websocket.send(JSON.stringify({
type : "RequestPointCloud"
}));
} else {
RENDERER.updatePointCloud({num:[]});
}
if (this.websocket.readyState === this.websocket.OPEN
&& STORE.options.showPointCloud === true) {
this.websocket.send(JSON.stringify({
type : "RequestPointCloud"
}));
}
}, 100);
}
......@@ -58,5 +55,8 @@ export default class PointCloudWebSocketEndpoint {
type: "TogglePointCloud",
enable: enable,
}));
if (STORE.options.showPointCloud === false) {
RENDERER.updatePointCloud({num:[]});
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册