Skip to content

Commit

Permalink
Merge pull request #11 from sisl/cleanup
Browse files Browse the repository at this point in the history
Fix crosswalk
  • Loading branch information
MaximeBouton committed Nov 13, 2019
2 parents 60f1294 + 96e8e42 commit adfa44e
Show file tree
Hide file tree
Showing 70 changed files with 1,831 additions and 357 deletions.
13 changes: 3 additions & 10 deletions .travis.yml
Expand Up @@ -2,10 +2,11 @@
language: julia
os:
- linux
# - osx
- osx
- windows
julia:
- 1.0
- 1.1
- 1.2
- nightly
notifications:
email: false
Expand All @@ -16,14 +17,6 @@ matrix:
allow_failures:
- julia: nightly

## uncomment and modify the following lines to manually install system packages
addons:
apt: # apt-get for linux
packages:
- libgtk-3-dev
# before_script: # homebrew for mac
# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi

## uncomment the following lines to override the default test script
script:
- git clone https://github.com/JuliaRegistries/General $(julia -e 'import Pkg; println(joinpath(Pkg.depots1(), "registries", "General"))')
Expand Down
5 changes: 3 additions & 2 deletions Project.toml
@@ -1,7 +1,7 @@
name = "AutomotivePOMDPs"
uuid = "dca8afc0-c686-11e8-0934-712707da73aa"
repo = "https://github.com/sisl/AutomotivePOMDPs.jl"
version = "0.1.0"
version = "0.2.0"

[deps]
AutoUrban = "1385418a-9289-5a49-ab93-843b508de4cb"
Expand All @@ -28,7 +28,8 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Vec = "44eeaf0b-fee4-471f-9310-ed6585cb3142"

[extras]
POMDPTesting = "92e6a534-49c2-5324-9027-86e3c861ab81"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["POMDPTesting", "Test"]
52 changes: 15 additions & 37 deletions docs/Urban POMDP tutorial.ipynb
Expand Up @@ -19,18 +19,7 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Info: Recompiling stale cache file /mnt/c/Users/Maxime/wsl/.julia/compiled/v1.0/POMDPSimulators/i1HOp.ji for POMDPSimulators [e0d0a172-29c6-5d4e-96d0-f262df5d01fd]\n",
"└ @ Base loading.jl:1190\n",
"┌ Info: Recompiling stale cache file /mnt/c/Users/Maxime/wsl/.julia/compiled/v1.0/AutomotivePOMDPs/L1lsd.ji for AutomotivePOMDPs [dca8afc0-c686-11e8-0934-712707da73aa]\n",
"└ @ Base loading.jl:1190\n"
]
}
],
"outputs": [],
"source": [
"using Random\n",
"using POMDPs\n",
Expand Down Expand Up @@ -137,14 +126,14 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.195128 seconds (316.75 k allocations: 17.772 MiB, 5.23% gc time)\n"
" 5.738164 seconds (7.14 M allocations: 371.955 MiB, 6.87% gc time)\n"
]
}
],
Expand All @@ -168,21 +157,21 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 9,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"text/html": [
"<video autoplay controls><source src=\"files/reel-9918510249368067747.webm?10637117127676518259\" type=\"video/webm\"></video>"
"<video autoplay controls><source src=\"files/reel-473997054147348532.webm?11238503309942432567\" type=\"video/webm\"></video>"
],
"text/plain": [
"Frames{MIME{Symbol(\"image/png\")}}(\"/tmp/tmpO5qTh6\", 0x0000000000000065, 20.0, nothing)"
"Frames{MIME{Symbol(\"image/png\")}}(\"C:\\\\Users\\\\Maxime\\\\AppData\\\\Local\\\\Temp\\\\jl_z0C55C\", 0x0000000000000065, 20.0, nothing)"
]
},
"execution_count": 14,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -196,22 +185,11 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"urbanpomdp.gif\""
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"write(\"urbanpomdp.gif\", film)"
"write(\"urbanpomdp.gif\", film);"
]
},
{
Expand Down Expand Up @@ -260,19 +238,19 @@
],
"metadata": {
"@webio": {
"lastCommId": "b98c7ae9cda04228b1e3b7abc2cf0e56",
"lastKernelId": "db2c6abb-b971-474c-a72d-ed8d22f765e8"
"lastCommId": null,
"lastKernelId": null
},
"kernelspec": {
"display_name": "Julia 1.0.2",
"display_name": "Julia 1.2.0",
"language": "julia",
"name": "julia-1.0"
"name": "julia-1.2"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.0.2"
"version": "1.2.0"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/urban_pomdp.ipynb
Expand Up @@ -492,8 +492,8 @@
"source": [
"function lane_to_segment(lane::Lane, roadway::Roadway)\n",
" # only works for straight lanes\n",
" lane_a = get_posG(Frenet(lane, 0.), roadway)\n",
" lane_b = get_posG(Frenet(lane, get_end(lane)), roadway)\n",
" lane_a = posg(Frenet(lane, 0.), roadway)\n",
" lane_b = posg(Frenet(lane, get_end(lane)), roadway)\n",
" return LineSegment(lane_a, lane_b)\n",
"end\n",
"\n",
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -61,7 +61,7 @@ generate an initial state for the ego car, returns a Vehicle object
function initial_ego(env::CrosswalkEnv, rng::AbstractRNG)
x0 = env.params.start_pos
y0 = 0. # parameterize
v0 = rand(rng, Uniform(6., env.params.speed_limit))
v0 = rand(rng, Distributions.Uniform(6., env.params.speed_limit))
# v0 = 8.

return Vehicle(VehicleState(VecSE2(x0, y0, 0.0), env.roadway.segments[1].lanes[1], env.roadway, v0),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -87,7 +87,7 @@ Create a new pedestrian entity at its initial state
"""
function initial_pedestrian(scene::Scene, env::CrosswalkEnv, rng::AbstractRNG)
# lateral position
d_lat = Uniform(env.params.roadway_length - env.params.crosswalk_width + 2, env.params.roadway_length + env.params.crosswalk_width-1)
d_lat = Distributions.Uniform(env.params.roadway_length - env.params.crosswalk_width + 2, env.params.roadway_length + env.params.crosswalk_width-1)
x0 = 0.5*rand(rng, d_lat)
# x0 = 0.5*env.params.roadway_length

Expand All @@ -98,7 +98,7 @@ function initial_pedestrian(scene::Scene, env::CrosswalkEnv, rng::AbstractRNG)
θ = π/2

#velocity
v0 = rand(rng, Uniform(0., env.params.ped_max_speed))
v0 = rand(rng, Distributions.Uniform(0., env.params.ped_max_speed))
cw_roadway = Roadway([RoadSegment(2, [env.crosswalk])]);
ped_initialstate = VehicleState(VecSE2(x0, y0, θ), env.crosswalk, cw_roadway, v0);
# ped_initialstate = VehicleState(VecSE2(x0, y0, θ), env.crosswalk, env.roadway, v0)
Expand All @@ -120,7 +120,7 @@ function initial_scene(models::Dict{Int64, DriverModel}, env::CrosswalkEnv, conf
b0 = initialstate_distribution(pomdp, ego)
for i = 1:n_ped
ped_state = rand(config.rng, b0).ped
d_lat = Uniform(env.params.roadway_length - env.params.crosswalk_width + 2, env.params.roadway_length + env.params.crosswalk_width-1)
d_lat = Distributions.Uniform(env.params.roadway_length - env.params.crosswalk_width + 2, env.params.roadway_length + env.params.crosswalk_width-1)
x0 = 0.5*rand(config.rng, d_lat)
y0 = ped_state.posG.y
cw_roadway = Roadway([RoadSegment(2, [env.crosswalk])])
Expand Down
File renamed without changes.

0 comments on commit adfa44e

Please sign in to comment.