Skip to content

taka-rl/car_simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Car Simulator

Overview

Top-down 2D car simulator: car body + 4 wheels, meters-first physics with a fixed timestep, and smooth rendering via a single unit-quad mesh and a RectShader (scale → rotate → translate).

Simulation Environment

OS Windows 10

Library

Library version link
GLFW 3.4 https://www.glfw.org/download.html
GLAD Refer to https://rpxomi.github.io/ https://glad.dav1d.de/
C++ g++ compiler (Windows 10) 13.1.0 -

Controls

A discrete action space is currently implemented and the car movement is calculated by a kinematic bicycle model with the input controls. Combined actions (e.g. accelerate + steer) are possible.

Controls Description
Up +acceleration
Down -acceleration
Left +steer(CCW)
Right -steer(CW)
Escape Quit

Documentation

Build setting

Build command

  • without CMake
g++ -std=c++17 src/glad.c src/main.cpp src/Loader.cpp src/shaders/ShaderProgram.cpp src/shaders/RectShader.cpp src/entities/Entity.cpp src/renderers/Renderer.cpp src/vehicledynamics/BicycleModel.cpp -o output/program -Llib -Iinclude -lglfw3dll
  • CMake
  1. Configure & Generate Build Files
cmake -B build -S . -DBUILD_TESTING=OFF (Without tests)

or

cmake -B build -S . -DBUILD_TESTING=ON (With tests)
  1. Build / Link the Project
cmake --build build --config Release

CI process

Refer to this page

Development Plan

Simulation environment

  • Introduce reinforcement learning for the parking
    • Research RL libraries for C++
    • Build an environment like gymnasium-style environment in Python
    • Introduce continuous action space
    • Implement RL
    • Training
    • Evaluation

Future development ideas

  • Path finding
  • Decision making
  • Reinforcement learning
  • Sensors
  • 3D environment

Reference

Draw 2D Shapes C++ OpenGL from Scratch
OpenGL 入門
Hello Triangle
https://tokoik.github.io/GLFWdraft.pdf https://zenn.dev/nyanchu_program/articles/97637278839801 https://codelabo.com/posts/20200228150223

About

Car Simulator ---Under development---

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published