Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Seminar-HFO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
Seminar-HFO
Commits
9422cc3d
Commit
9422cc3d
authored
Sep 22, 2015
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated build system.
parent
aaf8751c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
32 deletions
+61
-32
CMakeLists.txt
CMakeLists.txt
+53
-26
bin/start.py
bin/start.py
+8
-6
No files found.
CMakeLists.txt
View file @
9422cc3d
cmake_minimum_required
(
VERSION 2.8.3
)
cmake_minimum_required
(
VERSION 2.8.3
)
project
(
hfo
)
project
(
hfo
)
include
(
ExternalProject
)
# Change these to reflect the location of your librcsc-4.1.0 install
option
(
BUILD_SOCCERWINDOW
"Build Soccerwindow Visualizer"
ON
)
set
(
LIBRCSC_INCLUDE ~/.local/include
)
set
(
LIBRCSC_LINK ~/.local/lib
)
# Add this definition if using Librcsc from https://github.com/mhauskn/librcsc
# add_definitions(-DELOG)
set
(
SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
add_definitions
(
-DELOG
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY bin
)
ExternalProject_Add
(
rcssserver
GIT_REPOSITORY
"git@github.com:mhauskn/rcssserver.git"
GIT_TAG
"master"
UPDATE_COMMAND
""
INSTALL_COMMAND
""
)
ExternalProject_Get_Property
(
rcssserver SOURCE_DIR
)
include_directories
(
${
SOURCE_DIR
}
/rcssbase
${
SOURCE_DIR
}
/src
)
ExternalProject_Get_Property
(
rcssserver BINARY_DIR
)
link_directories
(
${
BINARY_DIR
}
/lib
)
set
(
RCSSSERVER_BINARY_DIR
${
BINARY_DIR
}
/bin
)
include_directories
(
ExternalProject_Add
(
librcsc
${
SOURCE_DIR
}
GIT_REPOSITORY
"git@github.com:mhauskn/librcsc.git"
${
SOURCE_DIR
}
/chain_action
GIT_TAG
"master"
${
LIBRCSC_INCLUDE
}
UPDATE_COMMAND
""
)
INSTALL_COMMAND
""
)
ExternalProject_Get_Property
(
librcsc SOURCE_DIR
)
include_directories
(
${
SOURCE_DIR
}
)
set
(
LIBRCSC_INCLUDE_DIR
${
SOURCE_DIR
}
)
message
(
STATUS
"LIBRCSC_INCLUDE_DIR:
${
LIBRCSC_INCLUDE_DIR
}
"
)
ExternalProject_Get_Property
(
librcsc BINARY_DIR
)
link_directories
(
${
BINARY_DIR
}
/lib
)
set
(
LIBRCSC_LINK_DIR
${
BINARY_DIR
}
/lib
)
message
(
STATUS
"LIBRCSC_LINK_DIR:
${
LIBRCSC_LINK_DIR
}
"
)
link_directories
(
if
(
BUILD_SOCCERWINDOW
)
${
LIBRCSC_LINK
}
ExternalProject_Add
(
soccerwindow2
)
DEPENDS librcsc
GIT_REPOSITORY
"git@github.com:mhauskn/soccerwindow2.git"
GIT_TAG
"master"
CMAKE_ARGS -DLIBRCSC_INCLUDE_DIR=
${
LIBRCSC_INCLUDE_DIR
}
-DLIBRCSC_LINK_DIR=
${
LIBRCSC_LINK_DIR
}
UPDATE_COMMAND
""
INSTALL_COMMAND
""
)
ExternalProject_Get_Property
(
soccerwindow2 BINARY_DIR
)
set
(
SOCCERWINDOW2_BINARY_DIR
${
BINARY_DIR
}
/bin
)
install
(
DIRECTORY
${
SOCCERWINDOW2_BINARY_DIR
}
DESTINATION
${
CMAKE_CURRENT_SOURCE_DIR
}
/ USE_SOURCE_PERMISSIONS
)
endif
()
set
(
SOURCE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY bin
)
include_directories
(
${
SOURCE_DIR
}
${
SOURCE_DIR
}
/chain_action
)
file
(
GLOB SOURCES
${
SOURCE_DIR
}
/*.cpp
${
SOURCE_DIR
}
/chain_action/*.cpp
)
file
(
GLOB SOURCES
${
SOURCE_DIR
}
/*.cpp
${
SOURCE_DIR
}
/chain_action/*.cpp
)
list
(
REMOVE_ITEM SOURCES
${
SOURCE_DIR
}
/main_coach.cpp
${
SOURCE_DIR
}
/main_player.cpp
${
SOURCE_DIR
}
/main_trainer.cpp
${
SOURCE_DIR
}
/main_agent.cpp
${
SOURCE_DIR
}
/sample_coach.cpp
${
SOURCE_DIR
}
/sample_player.cpp
${
SOURCE_DIR
}
/sample_trainer.cpp
${
SOURCE_DIR
}
/agent.cpp
${
SOURCE_DIR
}
/HFO.cpp
)
list
(
REMOVE_ITEM SOURCES
${
SOURCE_DIR
}
/main_coach.cpp
${
SOURCE_DIR
}
/main_player.cpp
${
SOURCE_DIR
}
/main_trainer.cpp
${
SOURCE_DIR
}
/main_agent.cpp
${
SOURCE_DIR
}
/sample_coach.cpp
${
SOURCE_DIR
}
/sample_player.cpp
${
SOURCE_DIR
}
/sample_trainer.cpp
${
SOURCE_DIR
}
/agent.cpp
${
SOURCE_DIR
}
/HFO.cpp
)
list
(
APPEND LINK_LIBS
list
(
APPEND LINK_LIBS rcsc_agent rcsc_geom rcsc_param rcsc_ann
rcsc_agent
rcsc_net rcsc_gz rcsc_time rcsc_rcg
)
rcsc_geom
rcsc_param
rcsc_ann
rcsc_net
rcsc_gz
rcsc_time
rcsc_rcg
)
add_executable
(
sample_coach
${
SOURCE_DIR
}
/main_coach.cpp
${
SOURCE_DIR
}
/sample_coach.cpp
${
SOURCES
}
)
add_executable
(
sample_coach
${
SOURCE_DIR
}
/main_coach.cpp
${
SOURCE_DIR
}
/sample_coach.cpp
${
SOURCES
}
)
add_executable
(
sample_player
${
SOURCE_DIR
}
/HFO.cpp
${
SOURCE_DIR
}
/main_player.cpp
${
SOURCE_DIR
}
/sample_player.cpp
${
SOURCE_DIR
}
/agent.cpp
${
SOURCES
}
)
add_executable
(
sample_player
${
SOURCE_DIR
}
/HFO.cpp
${
SOURCE_DIR
}
/main_player.cpp
${
SOURCE_DIR
}
/sample_player.cpp
${
SOURCE_DIR
}
/agent.cpp
${
SOURCES
}
)
...
@@ -42,14 +62,21 @@ add_library(hfo-lib SHARED ${SOURCE_DIR}/HFO.hpp ${SOURCE_DIR}/HFO.cpp)
...
@@ -42,14 +62,21 @@ add_library(hfo-lib SHARED ${SOURCE_DIR}/HFO.hpp ${SOURCE_DIR}/HFO.cpp)
set_target_properties
(
hfo-lib PROPERTIES OUTPUT_NAME hfo
)
set_target_properties
(
hfo-lib PROPERTIES OUTPUT_NAME hfo
)
set_target_properties
(
hfo-lib PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/lib
)
set_target_properties
(
hfo-lib PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/lib
)
add_dependencies
(
sample_coach librcsc
)
add_dependencies
(
sample_player librcsc
)
add_dependencies
(
sample_trainer librcsc
)
add_dependencies
(
agent librcsc
)
add_dependencies
(
hfo-lib librcsc
)
target_link_libraries
(
sample_coach
${
LINK_LIBS
}
)
target_link_libraries
(
sample_coach
${
LINK_LIBS
}
)
target_link_libraries
(
sample_player
${
LINK_LIBS
}
)
target_link_libraries
(
sample_player
${
LINK_LIBS
}
)
target_link_libraries
(
sample_trainer
${
LINK_LIBS
}
)
target_link_libraries
(
sample_trainer
${
LINK_LIBS
}
)
target_link_libraries
(
agent
${
LINK_LIBS
}
)
target_link_libraries
(
agent
${
LINK_LIBS
}
)
link_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/lib
)
link_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/lib
)
add_executable
(
hfo_example_agent
${
CMAKE_CURRENT_SOURCE_DIR
}
/example/hfo_example_agent.cpp
)
add_executable
(
hfo_example_agent
${
CMAKE_CURRENT_SOURCE_DIR
}
/example/hfo_example_agent.cpp
)
set_target_properties
(
hfo_example_agent PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/example
)
set_target_properties
(
hfo_example_agent PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/example
)
target_link_libraries
(
hfo_example_agent hfo
)
target_link_libraries
(
hfo_example_agent hfo
)
add_dependencies
(
hfo_example_agent hfo-lib
)
add_dependencies
(
hfo_example_agent hfo-lib
)
install
(
DIRECTORY
${
RCSSSERVER_BINARY_DIR
}
${
CMAKE_CURRENT_BINARY_DIR
}
/bin DESTINATION
${
CMAKE_CURRENT_SOURCE_DIR
}
/ USE_SOURCE_PERMISSIONS
)
bin/start.py
View file @
9422cc3d
...
@@ -7,9 +7,9 @@ from signal import SIGKILL
...
@@ -7,9 +7,9 @@ from signal import SIGKILL
# Global list of all/essential running processes
# Global list of all/essential running processes
processes
,
necProcesses
=
[],
[]
processes
,
necProcesses
=
[],
[]
# Command to run the rcssserver. Edit as needed.
# Command to run the rcssserver. Edit as needed.
SERVER_
CMD
=
'rcssserver'
SERVER_
BIN
=
'rcssserver'
# Command to run the monitor. Edit as needed.
# Command to run the monitor. Edit as needed.
MONITOR_
CMD
=
'soccerwindow2'
MONITOR_
BIN
=
'soccerwindow2'
def
getAgentDirCmd
(
binary_dir
,
teamname
,
server_port
=
6000
,
coach_port
=
6002
,
def
getAgentDirCmd
(
binary_dir
,
teamname
,
server_port
=
6000
,
coach_port
=
6002
,
logDir
=
'log'
,
record
=
False
):
logDir
=
'log'
,
record
=
False
):
...
@@ -53,6 +53,7 @@ def main(args, team1='left', team2='right', rng=numpy.random.RandomState()):
...
@@ -53,6 +53,7 @@ def main(args, team1='left', team2='right', rng=numpy.random.RandomState()):
server_port
=
args
.
port
+
num_agents
server_port
=
args
.
port
+
num_agents
coach_port
=
args
.
port
+
num_agents
+
1
coach_port
=
args
.
port
+
num_agents
+
1
olcoach_port
=
args
.
port
+
num_agents
+
2
olcoach_port
=
args
.
port
+
num_agents
+
2
serverCommand
=
os
.
path
.
join
(
binary_dir
,
SERVER_BIN
)
serverOptions
=
' server::port=
%
i server::coach_port=
%
i '
\
serverOptions
=
' server::port=
%
i server::coach_port=
%
i '
\
'server::olcoach_port=
%
i server::coach=1 '
\
'server::olcoach_port=
%
i server::coach=1 '
\
'server::game_logging=
%
i server::text_logging=
%
i '
\
'server::game_logging=
%
i server::text_logging=
%
i '
\
...
@@ -70,14 +71,15 @@ def main(args, team1='left', team2='right', rng=numpy.random.RandomState()):
...
@@ -70,14 +71,15 @@ def main(args, team1='left', team2='right', rng=numpy.random.RandomState()):
args
.
logDir
,
args
.
record
)
args
.
logDir
,
args
.
record
)
try
:
try
:
# Launch the Server
# Launch the Server
server
=
launch
(
SERVER_CMD
+
serverOptions
,
name
=
'server'
)
server
=
launch
(
serverCommand
+
serverOptions
,
name
=
'server'
)
time
.
sleep
(
0.2
)
time
.
sleep
(
0.2
)
assert
server
.
poll
()
is
None
,
\
assert
server
.
poll
()
is
None
,
\
'[start.py] Failed to launch Server with command:
\"
%
s
\"
'
\
'[start.py] Failed to launch Server with command:
\"
%
s
\"
'
\
%
(
SERVER_CMD
+
serverOptions
)
%
(
serverCommand
+
serverOptions
)
if
not
args
.
headless
:
if
not
args
.
headless
:
monitorOptions
=
' --port=
%
i'
%
(
server_port
)
monitorCommand
=
os
.
path
.
join
(
binary_dir
,
MONITOR_BIN
)
launch
(
MONITOR_CMD
+
monitorOptions
,
name
=
'monitor'
)
monitorOptions
=
' --connect --port=
%
i'
%
(
server_port
)
launch
(
monitorCommand
+
monitorOptions
,
name
=
'monitor'
)
# Launch the Trainer
# Launch the Trainer
from
Trainer
import
Trainer
from
Trainer
import
Trainer
trainer
=
Trainer
(
args
=
args
,
rng
=
rng
,
server_port
=
server_port
,
trainer
=
Trainer
(
args
=
args
,
rng
=
rng
,
server_port
=
server_port
,
...
...
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