Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
T
torcs_dl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
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
autonomousdriving
torcs_dl
Commits
b16a9a20
Commit
b16a9a20
authored
Jul 03, 2018
by
Svetlana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Single-lane driving controller implementation.
parent
8ef40f25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
TorcsEMAMGenerator/pom.xml
TorcsEMAMGenerator/pom.xml
+6
-0
TorcsEMAMGenerator/src/main/java/de/monticore/lang/monticar/torcs_dl/Generator.java
...n/java/de/monticore/lang/monticar/torcs_dl/Generator.java
+2
-1
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Drivercontroller.emadl
...r/src/main/models/dp/subcomponents/Drivercontroller.emadl
+17
-3
No files found.
TorcsEMAMGenerator/pom.xml
View file @
b16a9a20
...
...
@@ -12,6 +12,7 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
2.5
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
...
...
@@ -41,6 +42,11 @@
<artifactId>
embedded-montiarc-math-middleware-generator
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
embedded-montiarc-deeplearning
</artifactId>
<version>
0.2.1-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
embedded-montiarc-emadl-generator
</artifactId>
...
...
TorcsEMAMGenerator/src/main/java/de/monticore/lang/monticar/torcs_dl/Generator.java
View file @
b16a9a20
...
...
@@ -2,6 +2,7 @@ package de.monticore.lang.monticar.torcs_dl;
import
de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol
;
import
de.monticore.lang.embeddedmontiarc.tagging.RosToEmamTagSchema
;
import
de.monticore.lang.monticar.emadl.generator.AbstractSymtab
;
import
de.monticore.lang.monticar.generator.middleware.MiddlewareGenerator
;
import
de.monticore.lang.monticar.generator.middleware.impls.RosCppGenImpl
;
import
de.monticore.lang.monticar.generator.roscpp.helper.TagHelper
;
...
...
@@ -23,7 +24,7 @@ public class Generator {
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Starting code generation..."
);
TaggingResolver
taggingResolver
=
de
.
monticore
.
lang
.
monticar
.
emadl
.
generator
.
AbstractSymtab
.
createSymTabAndTaggingResolver
(
MODELS_PATH
);
TaggingResolver
taggingResolver
=
AbstractSymtab
.
createSymTabAndTaggingResolver
(
MODELS_PATH
);
RosToEmamTagSchema
.
registerTagTypes
(
taggingResolver
);
try
{
...
...
TorcsEMAMGenerator/src/main/models/dp/subcomponents/Drivercontroller.emadl
View file @
b16a9a20
...
...
@@ -2,12 +2,26 @@ package dp.subcomponents;
component
Drivercontroller
{
ports
in
Q
(
0
:
1
)^{
1
3
,
1
,
1
}
affordanceIn
,
in
Q
(
0
:
1
)^{
1
,
1
,
13
}
affordanceIn
,
out
Q
(
0
:
1
)^{
3
,
1
,
1
}
commandsOut
;
implementation
Math
{
commandsOut
(
1
,
1
,
1
)=
0.5
;
//
steering
commandsOut
(
2
,
1
,
1
)=
0.8
;
//
acceleration
Q
Constant
=
1
;
Q
angle
=
affordanceIn
(
0
,
0
,
0
);
Q
roadWidth
=
affordanceIn
(
0
,
0
,
1
)
+
affordanceIn
(
0
,
0
,
4
);
Q
laneWidth
=
affordanceIn
(
0
,
0
,
2
)
+
affordanceIn
(
0
,
0
,
3
);
Q
distToLaneCenter
=
abs
(
laneWidth
/
2
-
affordanceIn
(
0
,
0
,
2
));
//
Steering
commandsOut
(
2
,
1
,
1
)
=
Constant
*
(
angle
-
distToLaneCenter
/
roadWidth
);
//
steering
//
Acceleration
Q
vMax
=
72
;
Q
vC
=
1
;
Q
vD
=
0
;
Q
desiredSpeed
=
vMax
*
(
exp
(-(
vC
/
vMax
)
*
affordanceIn
(
0
,
0
,
6
)
-
vD
));
commandsOut
(
1
,
1
,
1
)
=
desiredSpeed
/
vMax
;
//
acceleration
commandsOut
(
3
,
1
,
1
)=
0.0
;
//
brake
}
}
\ No newline at end of file
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