Skip to content

mode='front_of_car' argument for environment.spawn_despawn_obstacles does NOT spawn obstacles in front #1

@usbt0p

Description

@usbt0p

Explanation:

Using the front_of_car argument for the spawn_despawn_obstacles method causes the obstacles to spawn NOT in front.
This happens only with certain image sizes for the obstacles and car, since there where some versions in which this mode worked.

Possible fixes:

  • Figure out a formula to align obstacle and car by their center, which might be impossible for all car/obstacle pairs given the x and y coordinates are integers.
  • Another option would be to force the images to have a certain width ratio with respect to one another, so that the formula can always apply, while allowing width modification.
  • Finally the easiest would be just to enforce constant widths, non mutable, and ensure all of them allow the proper center spawn calculations.

What to look for:

  • In commit 48827c233a56f99b606449f4cd9120b32acbba0d it doesn't work.
  • Apparently it worked previously.
  • Old image sizes where left commented, although they where used with the coche_blanco.png and not the coche_estrecho.png.
  • Look mainly in the environment.py module for the solution, although another modules might have something to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions