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
3d9fbed8
Commit
3d9fbed8
authored
Apr 17, 2018
by
Svetlana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes in torcs client
parent
e2c29491
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
254 additions
and
1442 deletions
+254
-1442
.gitignore
.gitignore
+1
-0
TorcsClient/CMakeLists.txt
TorcsClient/CMakeLists.txt
+7
-4
TorcsClient/CMakeLists.txt.user
TorcsClient/CMakeLists.txt.user
+0
-251
TorcsClient/cmake_install.cmake
TorcsClient/cmake_install.cmake
+44
-0
TorcsClient/compile_commands.json
TorcsClient/compile_commands.json
+7
-0
TorcsClient/torcs.cpp
TorcsClient/torcs.cpp
+47
-0
TorcsClient/torcsclient.cpp
TorcsClient/torcsclient.cpp
+69
-109
TorcsClient/torcsclient.h
TorcsClient/torcsclient.h
+70
-0
TorcsEMAMGenerator/.idea/libraries/Maven__de_monticore_lang_NumberUnit_0_0_10_SNAPSHOT.xml
...s/Maven__de_monticore_lang_NumberUnit_0_0_10_SNAPSHOT.xml
+0
-13
TorcsEMAMGenerator/.idea/libraries/Maven__de_monticore_lang_monticar_embedded_montiarc_math_0_0_10_SNAPSHOT.xml
..._lang_monticar_embedded_montiarc_math_0_0_10_SNAPSHOT.xml
+0
-13
TorcsEMAMGenerator/.idea/workspace.xml
TorcsEMAMGenerator/.idea/workspace.xml
+0
-1043
TorcsEMAMGenerator/src/main/models/dp/Featureextraction.emam
TorcsEMAMGenerator/src/main/models/dp/Featureextraction.emam
+1
-1
TorcsEMAMGenerator/src/main/models/dp/Featureextraction.tag
TorcsEMAMGenerator/src/main/models/dp/Featureextraction.tag
+2
-2
TorcsEMAMGenerator/src/main/models/dp/Imagepreprocessing.emam
...sEMAMGenerator/src/main/models/dp/Imagepreprocessing.emam
+2
-2
TorcsEMAMGenerator/src/main/models/dp/Imagepreprocessing.tag
TorcsEMAMGenerator/src/main/models/dp/Imagepreprocessing.tag
+2
-2
TorcsEMAMGenerator/src/main/models/dp/Safetycontroller.emam
TorcsEMAMGenerator/src/main/models/dp/Safetycontroller.emam
+1
-1
TorcsEMAMGenerator/src/main/models/dp/Safetycontroller.tag
TorcsEMAMGenerator/src/main/models/dp/Safetycontroller.tag
+1
-1
No files found.
.gitignore
View file @
3d9fbed8
...
...
@@ -37,3 +37,4 @@ torcs/src/tools/package/specfiles/torcs-robot-base.spec
torcs/src/tools/package/specfiles/torcs.spec
torcs/src/tools/texmapper/texmapper-bin
torcs/src/tools/trackgen/trackgen-bin
/TorcsClient/build/
\ No newline at end of file
TorcsClient/CMakeLists.txt
View file @
3d9fbed8
...
...
@@ -5,12 +5,15 @@ project(TorcsClient)
SET
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
SET
(
CMAKE_CXX_STANDARD 14
)
message
(
${
CMAKE_MODULE_PATH
}
)
find_package
(
roscpp REQUIRED
)
find_package
(
std_msgs REQUIRED
)
find_package
(
FreeImage
)
#
find_package(FreeImage)
INCLUDE_DIRECTORIES
(
"
${
CMAKE_SOURCE_DIR
}
/../experiments/output/cpp"
)
add_executable
(
${
PROJECT_NAME
}
"main.cpp"
)
add_executable
(
${
PROJECT_NAME
}
torcs.cpp torcsclient.cpp
)
target_link_libraries
(
TorcsClient freeimage
)
target_link_libraries
(
TorcsClient freeimage
${
roscpp_LIBRARIES
}
${
std_msgs_LIBRARIES
}
)
target_include_directories
(
TorcsClient PUBLIC
${
roscpp_INCLUDE_DIRS
}
${
std_msgs_INCLUDE_DIRS
}
)
set_target_properties
(
TorcsClient PROPERTIES LINKER_LANGUAGE CXX
)
TorcsClient/CMakeLists.txt.user
deleted
100644 → 0
View file @
e2c29491
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.3.1, 2018-02-11T22:37:47. -->
<qtcreator>
<data>
<variable>
EnvironmentId
</variable>
<value
type=
"QByteArray"
>
{a358912b-8071-419f-839b-8836ba6c9080}
</value>
</data>
<data>
<variable>
ProjectExplorer.Project.ActiveTarget
</variable>
<value
type=
"int"
>
0
</value>
</data>
<data>
<variable>
ProjectExplorer.Project.EditorSettings
</variable>
<valuemap
type=
"QVariantMap"
>
<value
type=
"bool"
key=
"EditorConfiguration.AutoIndent"
>
true
</value>
<value
type=
"bool"
key=
"EditorConfiguration.AutoSpacesForTabs"
>
false
</value>
<value
type=
"bool"
key=
"EditorConfiguration.CamelCaseNavigation"
>
true
</value>
<valuemap
type=
"QVariantMap"
key=
"EditorConfiguration.CodeStyle.0"
>
<value
type=
"QString"
key=
"language"
>
Cpp
</value>
<valuemap
type=
"QVariantMap"
key=
"value"
>
<value
type=
"QByteArray"
key=
"CurrentPreferences"
>
CppGlobal
</value>
</valuemap>
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"EditorConfiguration.CodeStyle.1"
>
<value
type=
"QString"
key=
"language"
>
QmlJS
</value>
<valuemap
type=
"QVariantMap"
key=
"value"
>
<value
type=
"QByteArray"
key=
"CurrentPreferences"
>
QmlJSGlobal
</value>
</valuemap>
</valuemap>
<value
type=
"int"
key=
"EditorConfiguration.CodeStyle.Count"
>
2
</value>
<value
type=
"QByteArray"
key=
"EditorConfiguration.Codec"
>
UTF-8
</value>
<value
type=
"bool"
key=
"EditorConfiguration.ConstrainTooltips"
>
false
</value>
<value
type=
"int"
key=
"EditorConfiguration.IndentSize"
>
4
</value>
<value
type=
"bool"
key=
"EditorConfiguration.KeyboardTooltips"
>
false
</value>
<value
type=
"int"
key=
"EditorConfiguration.MarginColumn"
>
80
</value>
<value
type=
"bool"
key=
"EditorConfiguration.MouseHiding"
>
true
</value>
<value
type=
"bool"
key=
"EditorConfiguration.MouseNavigation"
>
true
</value>
<value
type=
"int"
key=
"EditorConfiguration.PaddingMode"
>
1
</value>
<value
type=
"bool"
key=
"EditorConfiguration.ScrollWheelZooming"
>
true
</value>
<value
type=
"bool"
key=
"EditorConfiguration.ShowMargin"
>
false
</value>
<value
type=
"int"
key=
"EditorConfiguration.SmartBackspaceBehavior"
>
0
</value>
<value
type=
"bool"
key=
"EditorConfiguration.SmartSelectionChanging"
>
true
</value>
<value
type=
"bool"
key=
"EditorConfiguration.SpacesForTabs"
>
true
</value>
<value
type=
"int"
key=
"EditorConfiguration.TabKeyBehavior"
>
0
</value>
<value
type=
"int"
key=
"EditorConfiguration.TabSize"
>
8
</value>
<value
type=
"bool"
key=
"EditorConfiguration.UseGlobal"
>
true
</value>
<value
type=
"int"
key=
"EditorConfiguration.Utf8BomBehavior"
>
1
</value>
<value
type=
"bool"
key=
"EditorConfiguration.addFinalNewLine"
>
true
</value>
<value
type=
"bool"
key=
"EditorConfiguration.cleanIndentation"
>
true
</value>
<value
type=
"bool"
key=
"EditorConfiguration.cleanWhitespace"
>
true
</value>
<value
type=
"bool"
key=
"EditorConfiguration.inEntireDocument"
>
false
</value>
</valuemap>
</data>
<data>
<variable>
ProjectExplorer.Project.PluginSettings
</variable>
<valuemap
type=
"QVariantMap"
/>
</data>
<data>
<variable>
ProjectExplorer.Project.Target.0
</variable>
<valuemap
type=
"QVariantMap"
>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Desktop
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Desktop
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
{ec686e2a-51dd-4f8d-9605-fe4379ba79aa}
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveBuildConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveDeployConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveRunConfiguration"
>
0
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.0"
>
<valuelist
type=
"QVariantList"
key=
"CMake.Configuration"
>
<value
type=
"QString"
>
CMAKE_BUILD_TYPE:STRING=Debug
</value>
<value
type=
"QString"
>
CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
</value>
<value
type=
"QString"
>
CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
</value>
<value
type=
"QString"
>
CMAKE_EXE_LINKER_FLAGS:STRING=
</value>
<value
type=
"QString"
>
CMAKE_MODULE_LINKER_FLAGS:STRING=-lfreeimage
</value>
<value
type=
"QString"
>
CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
</value>
<value
type=
"QString"
>
CMAKE_SHARED_LINKER_FLAGS:STRING=
</value>
<value
type=
"QString"
>
CMAKE_STATIC_LINKER_FLAGS:STRING=
</value>
<value
type=
"QString"
>
FreeImage_DIR:PATH=cmake
</value>
<value
type=
"QString"
>
QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
</value>
</valuelist>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/home/alex/MA_sveta/build-TorcsClient-Desktop-Debug
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"QString"
key=
"CMakeProjectManager.MakeStep.AdditionalArguments"
></value>
<valuelist
type=
"QVariantList"
key=
"CMakeProjectManager.MakeStep.BuildTargets"
>
<value
type=
"QString"
>
all
</value>
</valuelist>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
CMake Build
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
CMakeProjectManager.MakeStep
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.BuildStepList.StepsCount"
>
1
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Build
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
ProjectExplorer.BuildSteps.Build
</value>
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.1"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"QString"
key=
"CMakeProjectManager.MakeStep.AdditionalArguments"
></value>
<valuelist
type=
"QVariantList"
key=
"CMakeProjectManager.MakeStep.BuildTargets"
>
<value
type=
"QString"
>
clean
</value>
</valuelist>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
CMake Build
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
CMakeProjectManager.MakeStep
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.BuildStepList.StepsCount"
>
1
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Clean
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
ProjectExplorer.BuildSteps.Clean
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.BuildConfiguration.BuildStepListCount"
>
2
</value>
<value
type=
"bool"
key=
"ProjectExplorer.BuildConfiguration.ClearSystemEnvironment"
>
false
</value>
<valuelist
type=
"QVariantList"
key=
"ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"
/>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
CMakeProjectManager.CMakeBuildConfiguration
</value>
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.1"
>
<valuelist
type=
"QVariantList"
key=
"CMake.Configuration"
>
<value
type=
"QString"
>
CMAKE_BUILD_TYPE:STRING=Release
</value>
</valuelist>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/home/alex/MA_sveta/build-TorcsClient-Desktop-Release
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"QString"
key=
"CMakeProjectManager.MakeStep.AdditionalArguments"
></value>
<valuelist
type=
"QVariantList"
key=
"CMakeProjectManager.MakeStep.BuildTargets"
>
<value
type=
"QString"
>
all
</value>
</valuelist>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
CMake Build
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
CMakeProjectManager.MakeStep
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.BuildStepList.StepsCount"
>
1
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Build
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
ProjectExplorer.BuildSteps.Build
</value>
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.1"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"QString"
key=
"CMakeProjectManager.MakeStep.AdditionalArguments"
></value>
<valuelist
type=
"QVariantList"
key=
"CMakeProjectManager.MakeStep.BuildTargets"
>
<value
type=
"QString"
>
clean
</value>
</valuelist>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
CMake Build
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
CMakeProjectManager.MakeStep
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.BuildStepList.StepsCount"
>
1
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Clean
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
ProjectExplorer.BuildSteps.Clean
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.BuildConfiguration.BuildStepListCount"
>
2
</value>
<value
type=
"bool"
key=
"ProjectExplorer.BuildConfiguration.ClearSystemEnvironment"
>
false
</value>
<valuelist
type=
"QVariantList"
key=
"ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"
/>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
CMakeProjectManager.CMakeBuildConfiguration
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.Target.BuildConfigurationCount"
>
2
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.DeployConfiguration.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<value
type=
"int"
key=
"ProjectExplorer.BuildStepList.StepsCount"
>
0
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Deploy
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
ProjectExplorer.BuildSteps.Deploy
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.BuildConfiguration.BuildStepListCount"
>
1
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Deploy locally
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
ProjectExplorer.DefaultDeployConfiguration
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.Target.DeployConfigurationCount"
>
1
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.PluginSettings"
/>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.RunConfiguration.0"
>
<value
type=
"bool"
key=
"Analyzer.QmlProfiler.AggregateTraces"
>
false
</value>
<value
type=
"bool"
key=
"Analyzer.QmlProfiler.FlushEnabled"
>
false
</value>
<value
type=
"uint"
key=
"Analyzer.QmlProfiler.FlushInterval"
>
1000
</value>
<value
type=
"QString"
key=
"Analyzer.QmlProfiler.LastTraceFile"
></value>
<value
type=
"bool"
key=
"Analyzer.QmlProfiler.Settings.UseGlobalSettings"
>
true
</value>
<valuelist
type=
"QVariantList"
key=
"Analyzer.Valgrind.AddedSuppressionFiles"
/>
<value
type=
"bool"
key=
"Analyzer.Valgrind.Callgrind.CollectBusEvents"
>
false
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.Callgrind.CollectSystime"
>
false
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.Callgrind.EnableBranchSim"
>
false
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.Callgrind.EnableCacheSim"
>
false
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.Callgrind.EnableEventToolTips"
>
true
</value>
<value
type=
"double"
key=
"Analyzer.Valgrind.Callgrind.MinimumCostRatio"
>
0.01
</value>
<value
type=
"double"
key=
"Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio"
>
10
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.FilterExternalIssues"
>
true
</value>
<value
type=
"int"
key=
"Analyzer.Valgrind.LeakCheckOnFinish"
>
1
</value>
<value
type=
"int"
key=
"Analyzer.Valgrind.NumCallers"
>
25
</value>
<valuelist
type=
"QVariantList"
key=
"Analyzer.Valgrind.RemovedSuppressionFiles"
/>
<value
type=
"int"
key=
"Analyzer.Valgrind.SelfModifyingCodeDetection"
>
1
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.Settings.UseGlobalSettings"
>
true
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.ShowReachable"
>
false
</value>
<value
type=
"bool"
key=
"Analyzer.Valgrind.TrackOrigins"
>
true
</value>
<value
type=
"QString"
key=
"Analyzer.Valgrind.ValgrindExecutable"
>
valgrind
</value>
<valuelist
type=
"QVariantList"
key=
"Analyzer.Valgrind.VisibleErrorKinds"
>
<value
type=
"int"
>
0
</value>
<value
type=
"int"
>
1
</value>
<value
type=
"int"
>
2
</value>
<value
type=
"int"
>
3
</value>
<value
type=
"int"
>
4
</value>
<value
type=
"int"
>
5
</value>
<value
type=
"int"
>
6
</value>
<value
type=
"int"
>
7
</value>
<value
type=
"int"
>
8
</value>
<value
type=
"int"
>
9
</value>
<value
type=
"int"
>
10
</value>
<value
type=
"int"
>
11
</value>
<value
type=
"int"
>
12
</value>
<value
type=
"int"
>
13
</value>
<value
type=
"int"
>
14
</value>
</valuelist>
<value
type=
"QString"
key=
"CMakeProjectManager.CMakeRunConfiguation.Title"
>
TorcsClient
</value>
<value
type=
"QString"
key=
"CMakeProjectManager.CMakeRunConfiguration.Arguments"
></value>
<value
type=
"QString"
key=
"CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"
></value>
<value
type=
"QString"
key=
"CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory.default"
>
/tmp/QtCreator-ViQ1rd/qtc-cmake-XXpJzi57
</value>
<value
type=
"int"
key=
"PE.EnvironmentAspect.Base"
>
2
</value>
<valuelist
type=
"QVariantList"
key=
"PE.EnvironmentAspect.Changes"
/>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
TorcsClient
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
></value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
CMakeProjectManager.CMakeRunConfiguration.TorcsClient
</value>
<value
type=
"uint"
key=
"RunConfiguration.QmlDebugServerPort"
>
3768
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseCppDebugger"
>
false
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseCppDebuggerAuto"
>
true
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseMultiProcess"
>
false
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebugger"
>
false
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebuggerAuto"
>
true
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.Target.RunConfigurationCount"
>
1
</value>
</valuemap>
</data>
<data>
<variable>
ProjectExplorer.Project.TargetCount
</variable>
<value
type=
"int"
>
1
</value>
</data>
<data>
<variable>
ProjectExplorer.Project.Updater.FileVersion
</variable>
<value
type=
"int"
>
18
</value>
</data>
<data>
<variable>
Version
</variable>
<value
type=
"int"
>
18
</value>
</data>
</qtcreator>
TorcsClient/cmake_install.cmake
0 → 100644
View file @
3d9fbed8
# Install script for directory: /home/alex/MA_sveta/torcs_dl/TorcsClient
# Set the install prefix
if
(
NOT DEFINED CMAKE_INSTALL_PREFIX
)
set
(
CMAKE_INSTALL_PREFIX
"/usr/local"
)
endif
()
string
(
REGEX REPLACE
"/$"
""
CMAKE_INSTALL_PREFIX
"
${
CMAKE_INSTALL_PREFIX
}
"
)
# Set the install configuration name.
if
(
NOT DEFINED CMAKE_INSTALL_CONFIG_NAME
)
if
(
BUILD_TYPE
)
string
(
REGEX REPLACE
"^[^A-Za-z0-9_]+"
""
CMAKE_INSTALL_CONFIG_NAME
"
${
BUILD_TYPE
}
"
)
else
()
set
(
CMAKE_INSTALL_CONFIG_NAME
"Debug"
)
endif
()
message
(
STATUS
"Install configuration:
\"
${
CMAKE_INSTALL_CONFIG_NAME
}
\"
"
)
endif
()
# Set the component getting installed.
if
(
NOT CMAKE_INSTALL_COMPONENT
)
if
(
COMPONENT
)
message
(
STATUS
"Install component:
\"
${
COMPONENT
}
\"
"
)
set
(
CMAKE_INSTALL_COMPONENT
"
${
COMPONENT
}
"
)
else
()
set
(
CMAKE_INSTALL_COMPONENT
)
endif
()
endif
()
# Install shared libraries without execute permission?
if
(
NOT DEFINED CMAKE_INSTALL_SO_NO_EXE
)
set
(
CMAKE_INSTALL_SO_NO_EXE
"1"
)
endif
()
if
(
CMAKE_INSTALL_COMPONENT
)
set
(
CMAKE_INSTALL_MANIFEST
"install_manifest_
${
CMAKE_INSTALL_COMPONENT
}
.txt"
)
else
()
set
(
CMAKE_INSTALL_MANIFEST
"install_manifest.txt"
)
endif
()
string
(
REPLACE
";"
"
\n
"
CMAKE_INSTALL_MANIFEST_CONTENT
"
${
CMAKE_INSTALL_MANIFEST_FILES
}
"
)
file
(
WRITE
"/home/alex/MA_sveta/torcs_dl/TorcsClient/
${
CMAKE_INSTALL_MANIFEST
}
"
"
${
CMAKE_INSTALL_MANIFEST_CONTENT
}
"
)
TorcsClient/compile_commands.json
0 → 100644
View file @
3d9fbed8
[
{
"directory"
:
"/home/alex/MA_sveta/torcs_dl/TorcsClient"
,
"command"
:
"/usr/bin/g++ -DROSCONSOLE_BACKEND_LOG4CXX -DROS_PACKAGE_NAME=
\\\"
TorcsClient
\\\"
-I/home/alex/MA_sveta/torcs_dl/TorcsClient/../experiments/output/cpp -I/opt/ros/lunar/include -I/opt/ros/lunar/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -g3 -gdwarf-2 -std=gnu++14 -o CMakeFiles/TorcsClient.dir/main.cpp.o -c /home/alex/MA_sveta/torcs_dl/TorcsClient/main.cpp"
,
"file"
:
"/home/alex/MA_sveta/torcs_dl/TorcsClient/main.cpp"
}
]
\ No newline at end of file
TorcsClient/torcs.cpp
0 → 100644
View file @
3d9fbed8
#include <ros/ros.h>
#include <std_msgs/Int8MultiArray.h>
#include <std_msgs/Float32MultiArray.h>
#include "torcsclient.h"
#include <sstream>
torcs
::
TorcsClient
client
;
void
commandMsgCallback
(
const
std_msgs
::
Float32MultiArray
::
ConstPtr
&
msg
)
{
torcs
::
Command
cmd
;
cmd
.
accelCmd
=
msg
->
data
[
0
];
cmd
.
steerCmd
=
msg
->
data
[
1
];
cmd
.
brakeCmd
=
msg
->
data
[
2
];
ROS_INFO
(
"Received command."
);
ROS_INFO
(
" accel: %f"
,
cmd
.
accelCmd
);
ROS_INFO
(
" steer: %f"
,
cmd
.
steerCmd
);
ROS_INFO
(
" break: %f"
,
cmd
.
brakeCmd
);
client
.
sendCommand
(
cmd
);
}
int
main
(
int
argc
,
char
**
argv
)
{
ros
::
init
(
argc
,
argv
,
"torcs"
);
ros
::
NodeHandle
n
;
ros
::
Subscriber
sub
=
n
.
subscribe
(
"/commands"
,
1000
,
commandMsgCallback
);
ros
::
Publisher
pub
=
n
.
advertise
<
std_msgs
::
Int8MultiArray
>
(
"/camera"
,
1000
);
ros
::
Rate
loop_rate
(
100
);
while
(
ros
::
ok
())
{
std_msgs
::
Int8MultiArray
msg
;
msg
.
data
.
clear
();
msg
.
data
.
resize
(
torcs
::
IMAGE_SIZE_BYTES
);
const
auto
imageData
=
client
.
getScreenshot
();
memcpy
(
msg
.
data
.
data
(),
imageData
->
data
(),
imageData
->
size
());
pub
.
publish
(
msg
);
loop_rate
.
sleep
();
}
return
0
;
}
TorcsClient/
main
.cpp
→
TorcsClient/
torcsclient
.cpp
View file @
3d9fbed8
#include "torcsclient.h"
#include <iostream>
#include <chrono>
#include <thread>
#include <cstring>
#include <sys/shm.h>
#include <assert.h>
#include <FreeImage.h>
constexpr
auto
IMAGE_WIDTH
=
640
;
constexpr
auto
IMAGE_HEIGHT
=
480
;
constexpr
auto
IMAGE_CHANNELS
=
3
;
using
namespace
std
::
chrono_literals
;
struct
shared_use_st
{
int
written
=
0
;
//a label, if 1: available to read, if 0: available to write
uint8_t
data
[
IMAGE_WIDTH
*
IMAGE_HEIGHT
*
IMAGE_CHANNELS
];
// image data field
int
control
=
0
;
int
pause
=
0
;
double
fast
=
0.0
;
double
dist_L
=
0.0
;
double
dist_R
=
0.0
;
double
toMarking_L
=
0.0
;
double
toMarking_M
=
0.0
;
double
toMarking_R
=
0.0
;
double
dist_LL
=
0.0
;
double
dist_MM
=
0.0
;
double
dist_RR
=
0.0
;
double
toMarking_LL
=
0.0
;
double
toMarking_ML
=
0.0
;
double
toMarking_MR
=
0.0
;
double
toMarking_RR
=
0.0
;
double
toMiddle
=
0.0
;
double
angle
=
0.0
;
double
speed
=
0.0
;
double
steerCmd
=
0.0
;
double
accelCmd
=
0.0
;
double
brakeCmd
=
0.0
;
};
void
writeScreenshot
(
shared_use_st
*
shared
,
unsigned
int
&
num
)
{
std
::
cout
<<
"Read image."
<<
std
::
endl
;
FIBITMAP
*
newShot
=
FreeImage_Allocate
(
IMAGE_WIDTH
,
IMAGE_HEIGHT
,
24
);
if
(
!
newShot
)
{
std
::
cerr
<<
"Failed to allocate freeimage file."
<<
std
::
endl
;
FreeImage_Unload
(
newShot
);
return
;
}
BYTE
*
bits
=
(
BYTE
*
)
FreeImage_GetBits
(
newShot
);
for
(
int
h
=
0
;
h
<
IMAGE_HEIGHT
;
h
++
)
{
BYTE
*
pixel
=
(
BYTE
*
)
bits
;
for
(
int
w
=
0
;
w
<
IMAGE_WIDTH
;
w
++
)
{
pixel
[
FI_RGBA_RED
]
=
shared
->
data
[((
h
)
*
IMAGE_WIDTH
+
w
)
*
3
+
0
];
pixel
[
FI_RGBA_GREEN
]
=
shared
->
data
[((
h
)
*
IMAGE_WIDTH
+
w
)
*
3
+
1
];
pixel
[
FI_RGBA_BLUE
]
=
shared
->
data
[((
h
)
*
IMAGE_WIDTH
+
w
)
*
3
+
2
];
pixel
+=
3
;
}
bits
+=
3
*
IMAGE_WIDTH
;
}
FreeImage_Save
(
FIF_BMP
,
newShot
,
(
std
::
string
(
"shot-"
)
+
std
::
to_string
(
num
)).
c_str
());
FreeImage_Unload
(
newShot
);
shared
->
control
=
0
;
shared
->
written
=
0
;
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
2
));
std
::
cout
<<
"Read image."
<<
std
::
endl
;
using
namespace
torcs
;
shared
->
control
=
0
;
shared
->
written
=
0
;
}
int
main
()
TorcsClient
::
TorcsClient
()
{
std
::
cout
<<
"TORCS Client!"
<<
std
::
endl
;
FreeImage_Initialise
();
void
*
shm
=
NULL
;
struct
shared_use_st
*
shared
;
int
shmid
;
shmid
=
shmget
((
key_t
)
4567
,
sizeof
(
struct
shared_use_st
),
0666
);
if
(
shmid
<
0
)
{
std
::
cerr
<<
"Failed to get shared memory!"
<<
std
::
endl
;
exit
(
EXIT_FAILURE
)
;
return
;
}
shm
=
shmat
(
shmid
,
0
,
0
);
if
(
shm
==
(
void
*
)
-
1
)
{
std
::
cerr
<<
"Failed to shmat()!"
<<
std
::
endl
;
exit
(
EXIT_FAILURE
)
;
return
;
}
connected
=
true
;
std
::
cout
<<
"Started shared memory at "
<<
std
::
hex
<<
shm
<<
std
::
endl
;
...
...
@@ -136,36 +63,69 @@ int main()
shared
->
steerCmd
=
0.0
;
shared
->
accelCmd
=
0.0
;
shared
->
brakeCmd
=
0.0
;
}
unsigned
num
=
0
;
while
(
1
)
{
if
(
shared
->
control
==
1
)
{
std
::
cout
<<
"Control == 1!"
<<
std
::
endl
;
shared
->
control
=
1
;
shared
->
accelCmd
=
10.0
;
shared
->
steerCmd
=
1.0
;
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
500
));
}
else
{
std
::
cout
<<
"Control == 0!"
<<
std
::
endl
;
shared
->
control
=
1
;
shared
->
accelCmd
=
10.0
;
shared
->
steerCmd
=
1.0
;
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
500
));
}
if
(
shared
->
written
==
1
)
{
//writeScreenshot(shared, num);
std
::
unique_ptr
<
DataContainer
>
TorcsClient
::
getScreenshot
()
{
assert
(
connected
);
while
(
shared
->
written
==
0
)
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
100
));
}
auto
result
=
std
::
make_unique
<
DataContainer
>
();
memcpy
(
result
->
data
(),
shared
->
data
,
result
->
size
());
shared
->
written
=
0
;
return
result
;
}
void
TorcsClient
::
sendCommand
(
Command
cmd
)
{
assert
(
connected
);
while
(
shared
->
control
==
0
)
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
100
));
}
shared
->
accelCmd
=
cmd
.
accelCmd
;
shared
->
steerCmd
=
cmd
.
steerCmd
;
shared
->
brakeCmd
=
cmd
.
brakeCmd
;
shared
->
control
=
0
;
}
std
::
cout
<<
"Speed: "
<<
shared
->
speed
<<
std
::
endl
;
std
::
cout
<<
"Steer: "
<<
shared
->
angle
<<
std
::
endl
;
std
::
cout
<<
"ToMiddle: "
<<
shared
->
toMiddle
<<
std
::
endl
;
/*void writeScreenshot(shared_use_st* shared, unsigned int& num)
{
std::cout << "Read image."
<< std::endl;
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
1
));
num
++
;
FIBITMAP* newShot = FreeImage_Allocate(IMAGE_WIDTH, IMAGE_HEIGHT, 24);
if (!newShot)
{
std::cerr << "Failed to allocate freeimage file." << std::endl;
FreeImage_Unload(newShot);
return;
}
BYTE *bits = (BYTE*)FreeImage_GetBits(newShot);
for (int h = 0; h < IMAGE_HEIGHT; h++) {
BYTE *pixel = (BYTE*)bits;
for (int w = 0; w < IMAGE_WIDTH; w++) {
pixel[FI_RGBA_RED] = shared->data[((h)*IMAGE_WIDTH+w)*3+0];
pixel[FI_RGBA_GREEN] = shared->data[((h)*IMAGE_WIDTH+w)*3+1];
pixel[FI_RGBA_BLUE] = shared->data[((h)*IMAGE_WIDTH+w)*3+2];
pixel += 3;
}
bits += 3*IMAGE_WIDTH;
}
FreeImage_DeInitialise
();
FreeImage_Save(FIF_BMP, newShot, (std::string("shot-")+std::to_string(num)).c_str());
FreeImage_Unload(newShot);
shared->control = 0;
shared->written = 0;
std::this_thread::sleep_for(std::chrono::seconds(2));std::cout << "Read image." << std::endl;
}*/
return
0
;
}
TorcsClient/torcsclient.h
0 → 100644
View file @
3d9fbed8
#pragma once
#include <cstdint>
#include <array>
#include <memory>
namespace
torcs
{
constexpr
auto
IMAGE_WIDTH
=
640
;
constexpr
auto
IMAGE_HEIGHT
=
480
;
constexpr
auto
IMAGE_CHANNELS
=
1
;
constexpr
auto
IMAGE_SIZE_BYTES
=
IMAGE_WIDTH
*
IMAGE_HEIGHT
*
IMAGE_CHANNELS
;
struct
shared_use_st
{
int
written
=
0
;
//a label, if 1: available to read, if 0: available to write
uint8_t
data
[
IMAGE_SIZE_BYTES
];
// image data field
int
control
=
0
;
int
pause
=
0
;
double
fast
=
0.0
;