Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

31 create a method to record the simulation #32

Merged
merged 22 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b3e2031
Update .gitignore. ignore recordings. sort alphabetically
ll7 Jun 3, 2024
a4881b5
chore: Add recording functionality to RobotEnv
ll7 Jun 3, 2024
04962a4
chore: Add test for recording functionality
ll7 Jun 3, 2024
955d62f
chore: Update .gitignore to ignore recordings/*.pkl and add readme to…
ll7 Jun 3, 2024
1e64380
chore: Add README.md for Pygame specific test
ll7 Jun 3, 2024
5f7cc68
chore: Add playback_recording module for loading and visualizing reco…
ll7 Jun 3, 2024
19667d2
test: Add test for loading and visualizing recorded states
ll7 Jun 3, 2024
5b1b150
chore: Add loguru logger to robot_env.py
ll7 Jun 3, 2024
d1f8fb6
chore: Enable recording of states in RobotEnv
ll7 Jun 3, 2024
8b2f561
try to add a few recordings
ll7 Jun 3, 2024
db5ef2d
Merge branch 'main' into 31-create-a-method-to-record-the-simulation
ll7 Jun 4, 2024
a06362c
remove the old recordings
ll7 Jun 4, 2024
91fa56d
change map_def to self.map_def
ll7 Jun 4, 2024
0583ee9
safe states and map definiton, after recording, reset state list
ll7 Jun 4, 2024
2d82f33
remove reset of states, now handled in method
ll7 Jun 4, 2024
5cc758b
before opening a file, check if it is empty
ll7 Jun 4, 2024
9ced30c
now load states and map definition
ll7 Jun 4, 2024
eefcd41
specify to open the file as read binary
ll7 Jun 4, 2024
cf31c7e
mention that the render sleep should be a configurable parameter in t…
ll7 Jun 4, 2024
e6e5c78
rewrite visualization test for recorded states
ll7 Jun 4, 2024
dd4c9fd
add a state recording for testing
ll7 Jun 4, 2024
6e6597a
add compatability for sh instead of bash
ll7 Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pip install -e . || { echo "Failed to install the current directory as a package
pip install -e ./fast-pysf || { echo "Failed to install ./fast-pysf as a package"; exit 1; }

# Set the display environment variable for GUI applications based on the host OS
if [[ $HOST_OS == *"Windows"* ]]; then
if [ $HOST_OS == *"Windows"* ]; then
# We are in Windows
echo "export DISPLAY=host.docker.internal:0.0" >> ~/.bashrc || { echo "Failed to set DISPLAY environment variable for Windows"; exit 1; }
else
Expand Down
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
__pycache__/
.scannerwork
.pytest_cache
*.c
*.egg-info
*.o
*.so
profile.json
*training*.zip
.pytest_cache
.scannerwork
__pycache__/
build
*.egg-info
file.log
profiles
model
images
logs
model
profile.json
profiles
pysf_tests
pysocialforce
logs
*training*.zip
recordings/*.pkl
wandb
2 changes: 1 addition & 1 deletion examples/demo_offensive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def training():
env_config = EnvSettings(
sim_config=SimulationSettings(difficulty=0, ped_density_by_difficulty=[0.02]),
robot_config=BicycleDriveSettings(radius=0.5, max_accel=3.0, allow_backwards=True))
env = RobotEnv(env_config, debug=True)
env = RobotEnv(env_config, debug=True, recording_enabled=True)
model = PPO.load("./model/run_043", env=env)

obs = env.reset()
Expand Down
4 changes: 4 additions & 0 deletions recordings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Recordings

The folder where recordings are stored by default.
However, recordings are in the `.gitignore` file, so they are not uploaded to the repository.
Loading
Loading