[6.7.0][道路施工] 三角锥模型调小

This commit is contained in:
renwj
2024-10-24 19:14:09 +08:00
parent be160ed6f6
commit 6305a7f0bb
2 changed files with 45 additions and 8 deletions

View File

@@ -59,11 +59,15 @@ class V2NTest {
delay(millis)
}
FunctionBuildConfig.v2nTotalSwitch = true
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
val isDriver = arguments.getString("isDriver", "1").toInt() == 1
val times = arguments.getString("times", "100").toInt()
if (isDriver) {
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
delay(2000)
val targetX = arguments.getString("lon", "0").toDouble()
@@ -83,10 +87,43 @@ class V2NTest {
car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val point = DrivingDirectionUtils.calculateNewPoint(car.longitude, car.latitude, car.heading , eventDistance)
val polygon = generateTriangle(point.first, point.second, car.heading, r * 1e-5)
val data = TrackedObject.getDefaultInstance().toBuilder().setType(501).setLongitude(point.first).setLatitude(point.second).setAltitude(0.0).setSystemTime(System.currentTimeMillis() * 1.0 / 1000).setSatelliteTime(1.0).setUuid(10).setCarID("1").setColor("#ffffff").setHeading(car.heading).setSpeed(0.0).setDrawLevel(1).setDriverTime(1.0).setCameraIp("172.18.7.40").setVideoUrl("").addAllImageUrl(Collections.singletonList("http://www.baidu.com")).addAllPolygon(polygon.map { Location.getDefaultInstance().toBuilder().setLongitude(it.first).setLatitude(it.second).setAltitude(0.0).setHeading(0.0).setStation(false).build() }).setDetectStartTime(System.currentTimeMillis()).setV2XUuid("xxxxx1").setStrUuid("xxxxx2").build()
var data = TrackedObject.getDefaultInstance().toBuilder()
.setType(501)
.setLongitude(point.first)
.setLatitude(point.second)
.setAltitude(0.0)
.setSystemTime(System.currentTimeMillis() * 1.0 / 1000)
.setSatelliteTime(1.0)
.setUuid(10)
.setCarID("1")
.setColor("#ffffff")
.setHeading(car.heading)
.setSpeed(0.0)
.setDrawLevel(1)
.setDriverTime(1.0)
.setCameraIp("172.18.7.40")
.setVideoUrl("")
.addTrackedSource(MessagePad.TrackedSource.getDefaultInstance().toBuilder().setSource(2).addSubSource(MessagePad.SubSource.getDefaultInstance().toBuilder().setSource(1)).build())
.addAllImageUrl(Collections.singletonList("http://www.baidu.com"))
.addAllPolygon(polygon.map { Location.getDefaultInstance().toBuilder().setLongitude(it.first).setLatitude(it.second).setAltitude(0.0).setHeading(0.0).setStation(false).build() })
.setDetectStartTime(System.currentTimeMillis())
.setV2XUuid("xxxxx1")
.setStrUuid("xxxxx2")
.build()
val trafficData = Collections.singletonList(data)
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_AI_ROAD_SHI_GONG, data.toByteArray())
CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(trafficData)
if (isDriver) {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_AI_ROAD_SHI_GONG, data.toByteArray())
}
var cur = 0
while (cur < times) {
cur ++
FunctionBuildConfig.v2nTotalSwitch = true
FunctionBuildConfig.v2nNewLinkedToPNC = true
FunctionBuildConfig.v2xTotalSwitch = true
CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(trafficData)
data = data.newBuilderForType().build()
delay(50)
}
delay(TimeUnit.MINUTES.toMillis(10))
}