提交 d753e8e5 编写于 作者: V vlin17 提交者: Qi Luo

Dreamview: replacing parking_space_id with parking_info for POI

上级 d78942b4
......@@ -208,7 +208,12 @@ void SimulationWorldUpdater::RegisterMessageHandlers() {
for (const auto &landmark : poi_.landmark()) {
Json place;
place["name"] = landmark.name();
place["parkingSpaceId"] = landmark.parking_space_id();
Json parking_info =
apollo::common::util::JsonUtil::ProtoToTypedJson(
"parkingInfo", landmark.parking_info());
place["parkingInfo"] = parking_info["data"];
Json waypoint_list;
for (const auto &waypoint : landmark.waypoint()) {
Json point;
......@@ -217,6 +222,7 @@ void SimulationWorldUpdater::RegisterMessageHandlers() {
waypoint_list.push_back(point);
}
place["waypoint"] = waypoint_list;
poi_list.push_back(place);
}
} else {
......@@ -366,11 +372,15 @@ bool SimulationWorldUpdater::ConstructRoutingRequest(
return false;
}
// set parking space
if (ContainsKey(json, "parkingSpaceId") &&
json.find("parkingSpaceId")->is_string()) {
routing_request->mutable_parking_space()->mutable_id()->set_id(
json["parkingSpaceId"]);
// set parking info
if (ContainsKey(json, "parkingInfo")) {
auto *requested_parking_info = routing_request->mutable_parking_info();
if (!JsonStringToMessage(json["parkingInfo"].dump(), requested_parking_info)
.ok()) {
AERROR << "Failed to prepare a routing request: invalid parking info."
<< json["parkingInfo"].dump();
return false;
}
}
AINFO << "Constructed RoutingRequest to be sent:\n"
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -24,7 +24,8 @@ COMMON_PROTOS='../../common/proto/*.proto ../../common/configs/proto/vehicle_con
LOCALIZATION_PROTOS='../../localization/proto/localization.proto ../../localization/proto/pose.proto ../../localization/proto/localization_status.proto'
CHASSIS_PROTOS='../../canbus/proto/chassis.proto'
PLANNING_PROTOS='../../planning/proto/*.proto'
PREDICTION_PROTOS='../../prediction/proto/feature.proto ../../prediction/proto/lane_graph.proto ../../prediction/proto/prediction_point.proto'
PREDICTION_PROTOS='../../prediction/proto/feature.proto ../../prediction/proto/lane_graph.proto ../../prediction/proto/prediction_point.proto ../../prediction/proto/prediction_obstacle.proto ../../prediction/proto/scenario.proto'
PERCEPTION_PROTOS='../../perception/proto/traffic_light_detection.proto ../../perception/proto/perception_obstacle.proto'
REALTIVE_MAP_PROTOS='../../map/relative_map/proto/*.proto'
MAP_PROTOS='../../map/proto/*.proto'
......
......@@ -4164,6 +4164,229 @@
}
}
},
"ChassisFeature": {
"fields": {
"speedMps": {
"type": "float",
"id": 1
},
"throttlePercentage": {
"type": "float",
"id": 2
},
"brakePercentage": {
"type": "float",
"id": 3
},
"steeringPercentage": {
"type": "float",
"id": 4
},
"gearLocation": {
"type": "apollo.canbus.Chassis.GearPosition",
"id": 5
}
}
},
"LocalizationFeature": {
"fields": {
"position": {
"type": "apollo.common.PointENU",
"id": 1
},
"heading": {
"type": "double",
"id": 2
},
"linearVelocity": {
"type": "apollo.common.Point3D",
"id": 3
},
"linearAcceleration": {
"type": "apollo.common.Point3D",
"id": 4
},
"angularVelocity": {
"type": "apollo.common.Point3D",
"id": 5
}
}
},
"ObstacleTrajectoryPoint": {
"fields": {
"timestampSec": {
"type": "double",
"id": 1
},
"position": {
"type": "apollo.common.Point3D",
"id": 2
},
"theta": {
"type": "double",
"id": 3
},
"velocity": {
"type": "apollo.common.Point3D",
"id": 4
},
"polygonPoint": {
"rule": "repeated",
"type": "apollo.common.Point3D",
"id": 5
},
"acceleration": {
"type": "apollo.common.Point3D",
"id": 6
}
}
},
"ObstaclePrediction": {
"fields": {
"timestampSec": {
"type": "double",
"id": 1
},
"predictedPeriod": {
"type": "double",
"id": 2
},
"trajectory": {
"rule": "repeated",
"type": "apollo.prediction.Trajectory",
"id": 3
},
"intent": {
"type": "apollo.prediction.ObstacleIntent",
"id": 4
},
"priority": {
"type": "apollo.prediction.ObstaclePriority",
"id": 5
},
"isStatic": {
"type": "bool",
"id": 6,
"options": {
"default": false
}
}
}
},
"ObstacleFeature": {
"fields": {
"id": {
"type": "int32",
"id": 1
},
"length": {
"type": "double",
"id": 2
},
"width": {
"type": "double",
"id": 3
},
"height": {
"type": "double",
"id": 4
},
"type": {
"type": "apollo.perception.PerceptionObstacle.Type",
"id": 5
},
"obstacleTrajectoryPoint": {
"rule": "repeated",
"type": "ObstacleTrajectoryPoint",
"id": 6
},
"obstaclePrediction": {
"type": "ObstaclePrediction",
"id": 7
}
}
},
"RoutingResponseFeature": {
"fields": {
"laneId": {
"rule": "repeated",
"type": "string",
"id": 1
}
}
},
"TrafficLightFeature": {
"fields": {
"id": {
"type": "string",
"id": 1
},
"color": {
"type": "apollo.perception.TrafficLight.Color",
"id": 2
}
}
},
"ADCTrajectoryPoint": {
"fields": {
"timestampSec": {
"type": "double",
"id": 1
},
"trajectoryPoint": {
"type": "apollo.common.TrajectoryPoint",
"id": 2
}
}
},
"LearningDataFrame": {
"fields": {
"timestampSec": {
"type": "double",
"id": 1
},
"frameNum": {
"type": "uint32",
"id": 2
},
"chassis": {
"type": "ChassisFeature",
"id": 3
},
"localization": {
"type": "LocalizationFeature",
"id": 4
},
"obstacle": {
"rule": "repeated",
"type": "ObstacleFeature",
"id": 5
},
"routingResponse": {
"type": "RoutingResponseFeature",
"id": 6
},
"trafficLight": {
"rule": "repeated",
"type": "TrafficLightFeature",
"id": 7
},
"adcTrajectoryPoint": {
"rule": "repeated",
"type": "ADCTrajectoryPoint",
"id": 8
}
}
},
"LearningData": {
"fields": {
"learningData": {
"rule": "repeated",
"type": "LearningDataFrame",
"id": 1
}
}
},
"NaviObstacleDeciderConfig": {
"fields": {
"minNudgeDistance": {
......@@ -4550,73 +4773,87 @@
"type": "RoiType",
"id": 1
},
"roiLongitudinalRange": {
"roiLongitudinalRangeStart": {
"type": "double",
"id": 2,
"options": {
"default": 10
}
},
"parkingStartRange": {
"roiLongitudinalRangeEnd": {
"type": "double",
"id": 3,
"options": {
"default": 10
}
},
"parkingStartRange": {
"type": "double",
"id": 4,
"options": {
"default": 7
}
},
"parkingInwards": {
"type": "bool",
"id": 4,
"id": 5,
"options": {
"default": false
}
},
"enablePerceptionObstacles": {
"type": "bool",
"id": 5
"id": 6
},
"parkingDepthBuffer": {
"type": "double",
"id": 6,
"id": 7,
"options": {
"default": 0.1
}
},
"roiLinesegmentMinAngle": {
"roiLineSegmentMinAngle": {
"type": "double",
"id": 7,
"id": 8,
"options": {
"default": 0.3
}
},
"roiLinesegmentLength": {
"roiLineSegmentLength": {
"type": "double",
"id": 8,
"id": 9,
"options": {
"default": 1
}
},
"roiLineSegmentLengthFromMap": {
"type": "double",
"id": 10,
"options": {
"default": 10
}
},
"perceptionObstacleFilteringDistance": {
"type": "double",
"id": 9,
"id": 11,
"options": {
"default": 1000
}
},
"perceptionObstacleBuffer": {
"type": "double",
"id": 10
"id": 12
},
"curbHeadingTangentChangeUppperLimit": {
"curbHeadingTangentChangeUpperLimit": {
"type": "double",
"id": 11,
"id": 13,
"options": {
"default": 1
}
},
"endPoseSDistance": {
"type": "double",
"id": 12,
"id": 14,
"options": {
"default": 10
}
......@@ -5403,23 +5640,30 @@
},
"ROIConfig": {
"fields": {
"roiLongitudinalRange": {
"roiLongitudinalRangeStart": {
"type": "double",
"id": 1,
"options": {
"default": 10
}
},
"parkingStartRange": {
"roiLongitudinalRangeEnd": {
"type": "double",
"id": 2,
"options": {
"default": 10
}
},
"parkingStartRange": {
"type": "double",
"id": 3,
"options": {
"default": 7
}
},
"parkingInwards": {
"type": "bool",
"id": 3,
"id": 4,
"options": {
"default": false
}
......@@ -9731,6 +9975,18 @@
}
}
},
"ParkingInfo": {
"fields": {
"parkingSpaceId": {
"type": "string",
"id": 1
},
"parkingPoint": {
"type": "apollo.common.PointENU",
"id": 2
}
}
},
"RoutingRequest": {
"fields": {
"header": {
......@@ -9761,7 +10017,14 @@
},
"parkingSpace": {
"type": "apollo.hdmap.ParkingSpace",
"id": 6
"id": 6,
"options": {
"deprecated": true
}
},
"parkingInfo": {
"type": "ParkingInfo",
"id": 7
}
}
},
......@@ -11569,6 +11832,155 @@
"id": 2
}
}
},
"ObstacleIntent": {
"fields": {
"type": {
"type": "Type",
"id": 1,
"options": {
"default": "UNKNOWN"
}
}
},
"nested": {
"Type": {
"values": {
"UNKNOWN": 0,
"STOP": 1,
"STATIONARY": 2,
"MOVING": 3,
"CHANGE_LANE": 4,
"LOW_ACCELERATION": 5,
"HIGH_ACCELERATION": 6,
"LOW_DECELERATION": 7,
"HIGH_DECELERATION": 8
}
}
}
},
"Intent": {
"fields": {
"type": {
"type": "Type",
"id": 1,
"options": {
"default": "UNKNOWN"
}
}
},
"nested": {
"Type": {
"values": {
"UNKNOWN": 0,
"STOP": 1,
"CRUISE": 2,
"CHANGE_LANE": 3
}
}
}
},
"PredictionObstacle": {
"fields": {
"perceptionObstacle": {
"type": "apollo.perception.PerceptionObstacle",
"id": 1
},
"timestamp": {
"type": "double",
"id": 2
},
"predictedPeriod": {
"type": "double",
"id": 3
},
"trajectory": {
"rule": "repeated",
"type": "Trajectory",
"id": 4
},
"intent": {
"type": "ObstacleIntent",
"id": 5
},
"priority": {
"type": "ObstaclePriority",
"id": 6
},
"isStatic": {
"type": "bool",
"id": 7,
"options": {
"default": false
}
},
"feature": {
"rule": "repeated",
"type": "Feature",
"id": 8
}
}
},
"PredictionObstacles": {
"fields": {
"header": {
"type": "apollo.common.Header",
"id": 1
},
"predictionObstacle": {
"rule": "repeated",
"type": "PredictionObstacle",
"id": 2
},
"perceptionErrorCode": {
"type": "apollo.common.ErrorCode",
"id": 3
},
"startTimestamp": {
"type": "double",
"id": 4
},
"endTimestamp": {
"type": "double",
"id": 5
},
"intent": {
"type": "Intent",
"id": 6
},
"scenario": {
"type": "Scenario",
"id": 7
}
}
},
"Scenario": {
"fields": {
"type": {
"type": "Type",
"id": 1,
"options": {
"default": "UNKNOWN"
}
},
"junctionId": {
"type": "string",
"id": 2
}
},
"nested": {
"Type": {
"values": {
"UNKNOWN": 0,
"CRUISE": 1000,
"CRUISE_URBAN": 1001,
"CRUISE_HIGHWAY": 1002,
"JUNCTION": 2000,
"JUNCTION_TRAFFIC_LIGHT": 2001,
"JUNCTION_STOP_SIGN": 2002
}
}
}
}
}
},
......
......@@ -333,8 +333,8 @@ class Renderer {
this.routingEditor.removeInvalidRoutingPoint(pointId, error, this.scene);
}
setParkingSpaceId(id) {
this.routingEditor.setParkingSpaceId(id);
setParkingInfo(info) {
this.routingEditor.setParkingInfo(info);
}
removeAllRoutingPoints() {
......
import * as THREE from "three";
import STORE from "store";
import { drawThickBandFromPoints } from "utils/draw";
......
import * as THREE from "three";
import "imports-loader?THREE=three!three/examples/js/controls/OrbitControls.js";
import routingPointPin from "assets/images/routing/pin.png";
import STORE from "store";
import WS from "store/websocket";
import { drawImage } from "utils/draw";
export default class RoutingEditor {
constructor() {
this.routePoints = [];
this.parkingSpaceId = null;
this.parkingInfo = null;
this.inEditingMode = false;
this.pointId = 0;
}
......@@ -34,7 +32,7 @@ export default class RoutingEditor {
disableEditingMode(scene) {
this.inEditingMode = false;
this.removeAllRoutePoints(scene);
this.parkingSpaceId = null;
this.parkingInfo = null;
this.pointId = 0;
}
......@@ -49,8 +47,8 @@ export default class RoutingEditor {
WS.checkRoutingPoint(point);
}
setParkingSpaceId(id) {
this.parkingSpaceId = id;
setParkingInfo(info) {
this.parkingInfo = info;
}
removeInvalidRoutingPoint(pointId, msg, scene) {
......@@ -105,7 +103,7 @@ export default class RoutingEditor {
const start_heading = (points.length > 1) ? null : carHeading;
const end = points[points.length-1];
const waypoint = (points.length > 1) ? points.slice(1,-1) : [];
WS.requestRoute(start, start_heading, waypoint, end, this.parkingSpaceId);
WS.requestRoute(start, start_heading, waypoint, end, this.parkingInfo);
return true;
}
......
import { observable, action } from "mobx";
import _ from "lodash";
import RENDERER from "renderer";
import MAP_NAVIGATOR from "components/Navigation/MapNavigator";
......@@ -8,27 +10,38 @@ export default class RouteEditingManager {
// Map from POI name to its x,y coordinates,
// e.g. {POI-1: [{x: 1.0, y: 1.2}, {x: 101.0, y: 10.2}]}
@observable defaultRoutingEndPoint = {};
@observable defaultParkingSpaceId = {};
@observable currentPOI = "none";
defaultParkingInfo = {};
@action updateDefaultRoutingEndPoint(data) {
if (data.poi === undefined) {
return;
}
this.defaultRoutingEndPoint = {};
this.defaultParkingSpaceId = {};
this.defaultParkingInfo = {};
for (let i = 0; i < data.poi.length; ++i) {
const place = data.poi[i];
this.defaultRoutingEndPoint[place.name] = place.waypoint;
this.defaultParkingSpaceId[place.name] = place.parkingSpaceId;
this.defaultParkingInfo[place.name] = place.parkingInfo;
// Default string value is empty string in proto.
// Remove this unset field here to prevent empty string
// sends in routing request.
if (this.defaultParkingInfo[place.name].parkingSpaceId === "") {
delete this.defaultParkingInfo[place.name].parkingSpaceId;
if (_.isEmpty(this.defaultParkingInfo[place.name])) {
delete this.defaultParkingInfo[place.name];
}
}
}
}
@action addDefaultEndPoint(poiName, inNavigationMode) {
if (_.isEmpty(this.defaultRoutingEndPoint)) {
alert("Failed to get default routing end point, make sure there's " +
"a default end point file under the map data directory.");
"a default end point file under the map data directory.");
return;
}
if (poiName === undefined || poiName === ""
......@@ -42,7 +55,7 @@ export default class RouteEditingManager {
MAP_NAVIGATOR.addDefaultEndPoint(this.defaultRoutingEndPoint[poiName]);
} else {
RENDERER.addDefaultEndPoint(this.defaultRoutingEndPoint[poiName]);
RENDERER.setParkingSpaceId(this.defaultParkingSpaceId[poiName]);
RENDERER.setParkingInfo(this.defaultParkingInfo[poiName]);
}
}
......
......@@ -200,7 +200,7 @@ export default class RealtimeWebSocketEndpoint {
}));
}
requestRoute(start, start_heading, waypoint, end, parkingSpaceId) {
requestRoute(start, start_heading, waypoint, end, parkingInfo) {
const request = {
type: "SendRoutingRequest",
start: start,
......@@ -208,8 +208,8 @@ export default class RealtimeWebSocketEndpoint {
waypoint: waypoint,
};
if (parkingSpaceId) {
request.parkingSpaceId = parkingSpaceId;
if (parkingInfo) {
request.parkingInfo = parkingInfo;
}
if (start_heading) {
......
......@@ -29,6 +29,7 @@ py_proto(
name = "poi_pb2",
src = "poi.proto",
deps = [
"//modules/common/proto:geometry_pb2",
"//modules/routing/proto:routing_pb2",
],
)
......
......@@ -2,12 +2,14 @@ syntax = "proto2";
package apollo.routing;
import "modules/common/proto/geometry.proto";
import "modules/routing/proto/routing.proto";
message Landmark {
optional string name = 1;
repeated LaneWaypoint waypoint = 2;
optional string parking_space_id = 3;
optional string parking_space_id = 3 [deprecated = true];
optional apollo.routing.ParkingInfo parking_info = 4;
}
message POI {
......
......@@ -19,6 +19,11 @@ message LaneSegment {
optional double end_s = 3;
}
message ParkingInfo {
optional string parking_space_id = 1;
optional apollo.common.PointENU parking_point = 2;
}
message RoutingRequest {
optional apollo.common.Header header = 1;
// at least two points. The first is start point, the end is final point.
......@@ -28,7 +33,7 @@ message RoutingRequest {
repeated string blacklisted_road = 4;
optional bool broadcast = 5 [default = true];
optional apollo.hdmap.ParkingSpace parking_space = 6 [deprecated = true];
optional apollo.common.PointENU parking_point = 7;
optional ParkingInfo parking_info = 7;
}
message Measurement {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册