Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
p x
SuZhouAvp
Commits
4faa9691
Commit
4faa9691
authored
Sep 19, 2025
by
p x
Browse files
验证流光特效
parent
a99826e3
Changes
11
Hide whitespace changes
Inline
Side-by-side
app/libs/unityLibrary-release(
5
).aar
→
app/libs/unityLibrary-release(
6
).aar
View file @
4faa9691
No preview for this file type
app/src/main/java/com/sd/cavphmi/highmap/AlertPath.kt
View file @
4faa9691
...
...
@@ -5,11 +5,11 @@ package com.sd.cavphmi.highmap
* 传入点的坐标数组绘制路面状况颜色2=(路径里的红色、施工区域红色、人行道红色) 3=绿色(绿波) 4=感知车前的红色)
*/
data class
AlertPath
(
val
alertL
ins
:
List
<
AlertLin
>,
val
l
in
e
s
:
List
<
AlertLin
e
>,
val
alertType
:
Int
)
class
AlertLin
{
class
AlertLin
e
{
// val evel: Int,
var
lat
:
Double
=
0.0
var
lon
:
Double
=
0.0
...
...
app/src/main/java/com/sd/cavphmi/highmap/BottomCircle.kt
View file @
4faa9691
...
...
@@ -4,5 +4,5 @@ package com.sd.cavphmi.highmap
* 开启(关闭)绘制主车底盘下的光圈
*/
data class
BottomCircle
(
val
is
o
n
:
Boolean
val
is
O
n
:
Boolean
)
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/highmap/CarNavPath.kt
View file @
4faa9691
...
...
@@ -7,8 +7,15 @@ data class CarNavPath(
val
lines
:
List
<
AllLine
>
)
data class
AllLine
(
// val evel: Int,
val
lat
:
Double
,
val
lon
:
Double
)
\ No newline at end of file
class
AllLine
{
// val evel: Int,
constructor
()
constructor
(
lat
:
Double
,
lon
:
Double
){
this
.
lat
=
lat
this
.
lon
=
lon
}
var
lat
:
Double
=
0.0
var
lon
:
Double
=
0.0
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/highmap/HighMapApi.kt
View file @
4faa9691
...
...
@@ -45,13 +45,14 @@ object HighMapApi {
/**
* 开启(关闭)绘制主车底盘下的光圈
*/
fun
setCarBottomCircle
(
is
o
n
:
Boolean
)
{
var
bottomCircle
=
BottomCircle
(
is
o
n
)
fun
setCarBottomCircle
(
is
O
n
:
Boolean
)
{
var
bottomCircle
=
BottomCircle
(
is
O
n
)
UnityPlayer
.
UnitySendMessage
(
MODELNAME
,
"SetCarBottomCircle"
,
gson
.
toJson
(
bottomCircle
))
}
/**
* 开启(关闭)主车前方的雷达6个方向
* 0=关闭 1=左前 2=正前 3=右前 4=右后 5=正后 6=左后
*/
fun
setCarRadarDirection
(
dirent
:
Int
)
{
var
radarDirection
=
RadarDirection
(
dirent
)
...
...
@@ -72,8 +73,8 @@ object HighMapApi {
* @param alertLins 危险路径
* @param alertType 危险类型
*/
fun
setAlertPath
(
alertLin
s
:
List
<
AlertLin
>,
alertType
:
Int
)
{
var
alertPath
=
AlertPath
(
alertLin
s
,
alertType
)
fun
setAlertPath
(
alertLin
e
:
List
<
AlertLin
e
>,
alertType
:
Int
)
{
var
alertPath
=
AlertPath
(
alertLin
e
,
alertType
)
UnityPlayer
.
UnitySendMessage
(
MODELNAME
,
"SetAlertPath"
,
gson
.
toJson
(
alertPath
))
}
...
...
@@ -102,4 +103,18 @@ object HighMapApi {
UnityPlayer
.
UnitySendMessage
(
MODELNAME
,
"ClearAllPtcData"
,
"{}"
)
}
/**
* 选中车位的动效(四周流光效果加一个P的弹跳)
* @param spaceCode 车位编号
* 目前测试ID范围:B001~B075
*/
fun
parkRoundLight
(
spaceCode
:
String
){
var
parkRoundLight
=
ParkRoundLight
().
apply
{
this
.
spaceCode
=
spaceCode
}
UnityPlayer
.
UnitySendMessage
(
MODELNAME
,
"parkRoundLight"
,
gson
.
toJson
(
parkRoundLight
))
}
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/highmap/ParkRoundLight.kt
0 → 100644
View file @
4faa9691
package
com.sd.cavphmi.highmap
/**
* Park round light
* 停车位流光特效
*/
class
ParkRoundLight
{
//车位编号
var
spaceCode
=
""
}
\ No newline at end of file
app/src/main/java/com/sd/cavphmi/highmap/PtcData.kt
View file @
4faa9691
package
com.sd.cavphmi.highmap
/**
* 感知物数据
*
...
...
@@ -27,6 +28,7 @@ data class PtcData(
class
UnityPtc
{
//闪烁时间
var
aniTime
=
0L
//感知物类型 1=车 2=人
var
pType
=
0
var
heading
=
0.0
var
isFlash
=
false
...
...
app/src/main/java/com/sd/cavphmi/ui/MainActivity.kt
View file @
4faa9691
...
...
@@ -155,6 +155,10 @@ class MainActivity : BaseActivity<ActivityMainBinding, MyBaseViewModel>(),
dialog
.
setOnItemClickListener
(
this
)
dialog
.
show
()
}
//车位四周流光
binding
.
btParkround
.
setOnClickListener
{
HighMapApi
.
parkRoundLight
(
"B050"
)
}
}
...
...
app/src/main/java/com/sd/cavphmi/ui/fragment/UnityFragment.kt
View file @
4faa9691
...
...
@@ -98,7 +98,7 @@ class UnityFragment : Fragment(), IUnityPlayerLifecycleEvents {
mUnityPlayer
.
windowFocusChanged
(
true
)
// mUnityPlayer.requestFocus()
//使用拼接服务器资源加载地图
unityMapVm
.
loadTileJson
()
//
unityMapVm.loadTileJson()
}
...
...
app/src/main/java/com/sd/cavphmi/utils/MyContants.kt
View file @
4faa9691
...
...
@@ -26,7 +26,7 @@ object MyContants {
//websocket地址
private
var
WSHOST
=
if
(
IS_DEBUG
)
"wss://${BASE_HOST}/wsplus/socket?token=121&reType=freedo&"
else
"wss://${BASE_HOST}/wsplus/socket?token=121&reType=freedo&"
var
vehicleId
=
"
17
"
var
vehicleId
=
"
YZMN004
"
/**网联车辆位姿 用于实车测试喽数据***/
var
WS_VEH_LOC
=
"${WSHOST}msgType=2&vehicleId=${vehicleId}"
...
...
app/src/main/res/layout/activity_main.xml
View file @
4faa9691
...
...
@@ -80,6 +80,13 @@
android:text=
"网联车辆状态"
android:visibility=
"gone"
/>
<Button
android:id=
"@+id/bt_parkround"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"车位四周流光"
/>
<Button
android:id=
"@+id/bt_setcar"
android:layout_width=
"wrap_content"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment