Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
simulators
server
Commits
8688064d
Commit
8688064d
authored
May 20, 2019
by
hengwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add street sign
parent
d3446a30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
123 additions
and
8 deletions
+123
-8
restful/src/main/java/server/restful/model/Dataframe.java
restful/src/main/java/server/restful/model/Dataframe.java
+32
-5
restful/src/main/java/server/restful/model/MapModel.java
restful/src/main/java/server/restful/model/MapModel.java
+74
-1
restful/src/main/java/server/restful/service/SimulatorService.java
...rc/main/java/server/restful/service/SimulatorService.java
+9
-1
restful/src/main/java/server/restful/service/WorldBuilderService.java
...main/java/server/restful/service/WorldBuilderService.java
+8
-1
No files found.
restful/src/main/java/server/restful/model/Dataframe.java
View file @
8688064d
...
...
@@ -8,12 +8,15 @@ public class Dataframe {
private
double
posY
;
private
double
posZ
;
private
double
steering
=
4
;
private
double
engine
=
5
;
private
double
brake
=
6
;
private
double
steering
;
private
double
engine
;
private
double
brake
;
private
double
[][]
rotation
;
private
double
[]
velocity
;
private
double
[]
acceleration
;
private
double
deltaTime
=
7
;
private
double
totalTime
=
8
;
private
double
deltaTime
;
private
double
totalTime
;
public
double
getPosX
()
{
return
posX
;
...
...
@@ -63,6 +66,30 @@ public class Dataframe {
this
.
brake
=
brake
;
}
public
double
[][]
getRotation
()
{
return
rotation
;
}
public
void
setRotation
(
double
[][]
rotation
)
{
this
.
rotation
=
rotation
;
}
public
double
[]
getVelocity
()
{
return
velocity
;
}
public
void
setVelocity
(
double
[]
velocity
)
{
this
.
velocity
=
velocity
;
}
public
double
[]
getAcceleration
()
{
return
acceleration
;
}
public
void
setAcceleration
(
double
[]
acceleration
)
{
this
.
acceleration
=
acceleration
;
}
public
double
getDeltaTime
()
{
return
deltaTime
;
}
...
...
restful/src/main/java/server/restful/model/MapModel.java
View file @
8688064d
...
...
@@ -12,12 +12,14 @@ public class MapModel {
private
double
longitude
;
private
double
latitude
;
private
double
altitude
;
private
StreetSign
streetSign
;
public
Node
(
long
id
,
double
longitude
,
double
latitude
,
double
altitude
)
{
public
Node
(
long
id
,
double
longitude
,
double
latitude
,
double
altitude
,
StreetSign
streetSign
)
{
this
.
id
=
id
;
this
.
longitude
=
longitude
;
this
.
latitude
=
latitude
;
this
.
altitude
=
altitude
;
this
.
streetSign
=
streetSign
;
}
public
long
getId
()
{
...
...
@@ -35,6 +37,77 @@ public class MapModel {
public
double
getAltitude
()
{
return
altitude
;
}
public
StreetSign
getStreetSign
()
{
return
streetSign
;
}
}
public
static
class
StreetSign
{
private
long
id
;
private
String
type
;
private
boolean
one
;
private
boolean
two
;
private
double
x1
;
private
double
x2
;
private
double
y1
;
private
double
y2
;
private
double
z1
;
private
double
z2
;
public
StreetSign
(
long
id
,
String
type
,
boolean
one
,
boolean
two
,
double
x1
,
double
x2
,
double
y1
,
double
y2
,
double
z1
,
double
z2
)
{
this
.
id
=
id
;
this
.
type
=
type
;
this
.
one
=
one
;
this
.
two
=
two
;
this
.
x1
=
x1
;
this
.
x2
=
x2
;
this
.
y1
=
y1
;
this
.
y2
=
y2
;
this
.
z1
=
z1
;
this
.
z2
=
z2
;
}
public
long
getId
()
{
return
id
;
}
public
String
getType
()
{
return
type
;
}
public
boolean
isOne
()
{
return
one
;
}
public
boolean
isTwo
()
{
return
two
;
}
public
double
getX1
()
{
return
x1
;
}
public
double
getX2
()
{
return
x2
;
}
public
double
getY1
()
{
return
y1
;
}
public
double
getY2
()
{
return
y2
;
}
public
double
getZ1
()
{
return
z1
;
}
public
double
getZ2
()
{
return
z2
;
}
}
public
static
class
Street
{
...
...
restful/src/main/java/server/restful/service/SimulatorService.java
View file @
8688064d
...
...
@@ -117,6 +117,10 @@ public class SimulatorService {
List
<
Dataframe
>
frames
=
new
ArrayList
<>();
for
(
SimulationDataFrame
f:
vframe
.
getFramesList
()){
double
[][]
rotation
=
new
double
[
f
.
getRotationCount
()][
f
.
getRotation
(
0
).
getValueCount
()];
for
(
int
i
=
0
;
i
<
f
.
getRotationCount
();
i
++)
{
rotation
[
i
]
=
f
.
getRotation
(
i
).
getValueList
().
stream
().
mapToDouble
(
Double:
:
doubleValue
).
toArray
();
}
frames
.
add
(
new
Dataframe
(){{
setPosX
(
f
.
getPosX
());
setPosY
(
f
.
getPosY
());
...
...
@@ -125,6 +129,9 @@ public class SimulatorService {
setSteering
(
f
.
getSteering
());
setEngine
(
f
.
getEngine
());
setBrake
(
f
.
getBrake
());
setRotation
(
rotation
);
setVelocity
(
f
.
getVelocity
().
getValueList
().
stream
().
mapToDouble
(
Double:
:
doubleValue
).
toArray
());
setAcceleration
(
f
.
getAcceleration
().
getValueList
().
stream
().
mapToDouble
(
Double:
:
doubleValue
).
toArray
());
setDeltaTime
(
f
.
getDeltaTime
());
setTotalTime
(
f
.
getTotalTime
());
...
...
@@ -244,7 +251,8 @@ public class SimulatorService {
node
.
getId
(),
node
.
getLonitude
(),
node
.
getLatitude
(),
node
.
getAltitude
()
node
.
getAltitude
(),
null
));
}
return
result
;
...
...
restful/src/main/java/server/restful/service/WorldBuilderService.java
View file @
8688064d
...
...
@@ -65,12 +65,19 @@ public class WorldBuilderService {
List
<
MapModel
.
Node
>
result
=
new
ArrayList
<>();
for
(
EnvNode
node
:
nodes
)
{
double
x
=
node
.
getX
().
doubleValue
(),
y
=
node
.
getY
().
doubleValue
();
StreetSign
sign
=
node
.
getStreetSign
();
result
.
add
(
new
MapModel
.
Node
(
node
.
getOsmId
(),
(
float
)
converter
.
convertXToLong
(
x
,
y
),
(
float
)
converter
.
convertYToLat
(
y
),
node
.
getZ
().
floatValue
()
node
.
getZ
().
floatValue
(),
sign
==
null
?
null
:
new
MapModel
.
StreetSign
(
sign
.
getId
(),
sign
.
getType
().
toString
(),
sign
.
isOne
(),
sign
.
isTwo
(),
sign
.
getX1
(),
sign
.
getX2
(),
sign
.
getY1
(),
sign
.
getY2
(),
sign
.
getZ1
(),
sign
.
getZ2
()
)
));
}
return
result
;
...
...
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