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
earlywarning
Commits
f2e07035
Commit
f2e07035
authored
Jun 09, 2025
by
p x
Browse files
调整偏移量
parent
101e1aa2
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/cusc/adas/v2x/dto/VehicleInfoDto.java
View file @
f2e07035
...
...
@@ -36,7 +36,7 @@ public class VehicleInfoDto {
//档位
@Order
(
7
)
private
short
tapPos
;
private
byte
tapPos
;
//方向盘转角
@Order
(
8
)
private
double
steeringAngle
;
...
...
src/main/java/com/cusc/adas/v2x/utils/OffsetDef.java
View file @
f2e07035
...
...
@@ -8,7 +8,7 @@ import java.lang.annotation.Target;
@Retention
(
RetentionPolicy
.
RUNTIME
)
// 注解在运行时可用
@Target
(
ElementType
.
FIELD
)
// 注解只能用于字段(属性)
public
@interface
OffsetDef
{
double
value
()
default
1
;
int
type
()
default
1
;
//1:除法 2:乘法;
int
minValidLength
()
default
0
;
double
value
()
default
1
;
//偏移量
int
type
()
default
2
;
//1:除法 2:乘法;
int
minValidLength
()
default
0
;
//数据最小位数,不够补0
}
src/main/java/com/cusc/adas/v2x/utils/Parse.java
View file @
f2e07035
...
...
@@ -216,7 +216,7 @@ public class Parse {
Class
<?>
type
=
field
.
getType
();
if
(
offsetDef
!=
null
)
{
double
offset
=
offsetDef
.
value
();
int
t
ype
1
=
offsetDef
.
type
();
int
ofsetT
ype
=
offsetDef
.
type
();
int
minValidLength
=
offsetDef
.
minValidLength
();
//startindex
...
...
@@ -254,7 +254,8 @@ public class Parse {
tField
.
set
(
target
,
(
float
)
f
);
}
}
else
{
double
f
=(
Integer
)
o
*
offset
;
// double f =(Integer)o*offset;
float
f
=
(
float
)
((
Integer
)
o
*
offset
);
tField
.
set
(
target
,
(
float
)
f
);
}
}
else
if
(
type
==
long
.
class
)
{
...
...
@@ -329,13 +330,5 @@ public class Parse {
}
}
public
static
byte
[]
convoter
(
Byte
[]
bytes
)
{
byte
[]
bs
=
new
byte
[
bytes
.
length
];
int
i
=
0
;
for
(
Byte
b
:
bytes
)
{
bs
[
i
++]
=
b
;
}
return
bs
;
}
}
src/main/java/com/cusc/adas/v2x/vo/VehicleInfo.java
View file @
f2e07035
...
...
@@ -27,26 +27,26 @@ public class VehicleInfo {
private
long
timestampGNSS
;
//GNSS 速度 单位:0.01 m/s
@Order
(
4
)
@OffsetDef
(
value
=
36
,
type
=
2
)
@OffsetDef
(
value
=
0.0
36
,
type
=
2
)
private
int
velocityGNSS
;
//位置
@Order
(
5
)
private
Position
position
;
//航向角 单位为 1e-4 °
@Order
(
6
)
@OffsetDef
(
value
=
1
000
0
)
private
long
heading
;
@OffsetDef
(
value
=
0.
000
1
,
type
=
2
)
private
int
heading
;
//档位
@Order
(
7
)
private
short
tapPos
;
private
byte
tapPos
;
//方向盘转角 单位为 1e-4 °
@Order
(
8
)
@OffsetDef
(
value
=
1
000
0
)
@OffsetDef
(
value
=
0.
000
1
)
private
long
steeringAngle
;
//当前车速 单位:0.01m/s
@Order
(
9
)
@OffsetDef
(
value
=
36
,
type
=
2
)
@OffsetDef
(
value
=
0.0
36
,
type
=
2
)
private
int
velocity
;
//纵向加速度 单位:0.01m/s
@Order
(
10
)
...
...
@@ -98,7 +98,7 @@ public class VehicleInfo {
//车辆驾驶模式
@Order
(
21
)
private
short
driveMode
;
private
byte
driveMode
;
//目的地位置
@Order
(
22
)
...
...
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