Skip to content

Commit

Permalink
Merge pull request #118 from f1tenth/dev_packaging_update
Browse files Browse the repository at this point in the history
Packaging Update
  • Loading branch information
nandantumu authored Mar 5, 2024
2 parents f824f34 + 935cb27 commit 77518a1
Show file tree
Hide file tree
Showing 38 changed files with 311 additions and 933 deletions.
2 changes: 1 addition & 1 deletion examples/run_in_empty_track.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np

from waypoint_follow import PurePursuitPlanner
from f110_gym.envs.track import Track
from f1tenth_gym.envs.track import Track
import gymnasium as gym


Expand Down
6 changes: 6 additions & 0 deletions f1tenth_gym/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import gymnasium as gym

gym.register(
id="f1tenth-v0",
entry_point="f1tenth_gym.envs:F110Env",
)
File renamed without changes.
2 changes: 1 addition & 1 deletion gym/f110_gym/envs/action.py → f1tenth_gym/envs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import warnings
import gymnasium as gym
import numpy as np
from f110_gym.envs.dynamic_models import pid_steer, pid_accl
from .dynamic_models import pid_steer, pid_accl


class LongitudinalActionEnum(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"""
from __future__ import annotations
import numpy as np
from f110_gym.envs.dynamic_models import DynamicModel
from f110_gym.envs.action import CarAction
from f110_gym.envs.collision_models import collision_multiple, get_vertices
from f110_gym.envs.integrator import EulerIntegrator, IntegratorType
from f110_gym.envs.laser_models import ScanSimulator2D, check_ttc_jit, ray_cast
from f110_gym.envs.track import Track
from .dynamic_models import DynamicModel
from .action import CarAction
from .collision_models import collision_multiple, get_vertices
from .integrator import EulerIntegrator, IntegratorType
from .laser_models import ScanSimulator2D, check_ttc_jit, ray_cast
from .track import Track


class RaceCar(object):
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions gym/f110_gym/envs/f110_env.py → f1tenth_gym/envs/f110_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
# gym imports
import gymnasium as gym

from f110_gym.envs.action import (CarAction,
from .action import (CarAction,
from_single_to_multi_action_space)
from f110_gym.envs.integrator import IntegratorType
from f110_gym.envs.rendering import make_renderer
from .integrator import IntegratorType
from .rendering import make_renderer

from f110_gym.envs.track import Track
from .track import Track

# base classes
from f110_gym.envs.base_classes import Simulator, DynamicModel
from f110_gym.envs.observation import observation_factory
from f110_gym.envs.reset import make_reset_fn
from f110_gym.envs.track import Track
from f110_gym.envs.utils import deep_update
from .base_classes import Simulator, DynamicModel
from .observation import observation_factory
from .reset import make_reset_fn
from .track import Track
from .utils import deep_update


# others
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import unittest

import numpy as np
from f110_gym.envs.track import Track
from .track import Track
from numba import njit
from scipy.ndimage import distance_transform_edt as edt

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pathlib
from typing import Any, Optional

from f110_gym.envs.rendering.renderer import RenderSpec, EnvRenderer
from f110_gym.envs.track import Track
from .renderer import RenderSpec, EnvRenderer
from ..track import Track


def make_renderer(
Expand All @@ -28,7 +28,7 @@ def make_renderer(
render_fps : int, optional
rendering frames per second, by default 100
"""
from f110_gym.envs.rendering.rendering_pygame import PygameEnvRenderer
from .rendering_pygame import PygameEnvRenderer

cfg_file = pathlib.Path(__file__).parent.absolute() / "rendering.yaml"
render_spec = RenderSpec.from_yaml(cfg_file)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import numpy as np
import pygame

from f110_gym.envs.collision_models import get_vertices
from f110_gym.envs.rendering import RenderSpec
from ..collision_models import get_vertices
from . import RenderSpec


class TextObject:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import pygame
from PIL import ImageColor

from f110_gym.envs.rendering.objects import (
from .objects import (
Map,
Car,
TextObject,
)
from f110_gym.envs.track import Track
from f110_gym.envs.rendering.renderer import EnvRenderer, RenderSpec
from ..track import Track
from .renderer import EnvRenderer, RenderSpec

# one-line instructions visualized at the top of the screen (if show_info=True)
INSTRUCTION_TEXT = "Mouse click (L/M/R): Change POV - 'S' key: On/Off"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations
from f110_gym.envs.reset.masked_reset import GridResetFn, AllTrackResetFn
from f110_gym.envs.reset.reset_fn import ResetFn
from f110_gym.envs.track import Track
from .masked_reset import GridResetFn, AllTrackResetFn
from .reset_fn import ResetFn
from ..track import Track


def make_reset_fn(type: str | None, track: Track, num_agents: int, **kwargs) -> ResetFn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import numpy as np

from f110_gym.envs.reset.reset_fn import ResetFn
from f110_gym.envs.reset.utils import sample_around_waypoint
from f110_gym.envs.track import Track, Raceline
from .reset_fn import ResetFn
from .utils import sample_around_waypoint
from ..track import Track, Raceline


class MaskedResetFn(ResetFn):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from f110_gym.envs.track import Raceline
from ..track import Raceline


def sample_around_waypoint(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import numpy as np

from f110_gym.envs.rendering import EnvRenderer
from f110_gym.envs.track.cubic_spline import CubicSpline2D
from ..rendering import EnvRenderer
from .cubic_spline import CubicSpline2D


class Raceline:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from PIL.Image import Transpose
from yamldataclassconfig.config import YamlDataClassConfig

from f110_gym.envs.track import Raceline
from f110_gym.envs.track.cubic_spline import CubicSpline2D
from f110_gym.envs.track.utils import find_track_dir
from . import Raceline
from .cubic_spline import CubicSpline2D
from .utils import find_track_dir


@dataclass
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions gym/f110_gym/__init__.py

This file was deleted.

Loading

0 comments on commit 77518a1

Please sign in to comment.