Skip to content

Commit

Permalink
Rename RoadNetworkExporter to PascalCase, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aivora-beamng committed Apr 4, 2023
1 parent 9ef2298 commit df97d29
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 8 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@
Changelog
=========

Version 1.26
============
- RADAR sensor

- Sensor currently works with static scenery but not vehicles. Will be added in later update.
- Sensor comes with standard Lua API and BeamNGpy API.
- Example scripts `provided <https://github.com/BeamNG/BeamNGpy/blob/master/examples/radar_analysis.ipynb>`_ in BeamNGpy.
- Vehicle meshes now available in BeamNGpy

- Can provide data up to 2000 times per second.
- Vehicle nodes and physics triangle data available in BeamNGpy, including for individual vehicle wheels.
- Comes with standard Lua API and BeamNGpy API.
- Post-processing written in BeamNGpy to compute mesh connectivity data and analyse the mesh data (position, mass, force, velocity).
- Example scripts `provided <https://github.com/BeamNG/BeamNGpy/blob/master/examples/vehicle_mesh_data.py>`_ in BeamNGpy.
- IMU sensor

- Added ability to filter gyroscopic readings (as well as acceleration readings). Separate data filtering is used for each.
- Sensor suite bug fixes

- Fix: problem when changing the requested update times/priority parameters after various sensors were already created, sensor would not update correctly/quickly.
- Fix: gravity vector was not being applied correctly in IMU sensor.
- Fix: camera images from static sensors were being rendered upside down.
- Fix: LiDAR sensor was not returning the whole point cloud in BeamNGpy
- Export BeamNG maps as .xodr files (OpenDrive)

- BeamNGpy now provides the option to export our map road networks as .xodr files (OpenDrive). The exported road networks contain elevation and road wideness data, along with junction connectivity. On top of this, BeamNGpy also includes a new `class <https://beamngpy.readthedocs.io/en/latest/beamngpy.html#beamngpy.tools.RoadNetworkExporter>`_ with which to analyse the road network data oneself, and process it as required.
- BeamNGpy fixes / improvements

- Optimized the speed of depth camera processing
- Added new API:

- ``BeamNGpy.env.get_tod`` for getting the information about the time of day
- ``BeamNGpy.env.set_tod`` for setting the time-of-day information, allowing to control the day/night cycle from Python
- ``BeamNGpy.env.get_gravity`` for getting the current value of the strength of gravity in the simulator.
- ``Vehicle.get_center_of_gravity`` for getting the center of gravity of a vehicle.

- Added option to remove procedural meshes
- Added new option to ``BeamNGpy.open`` called ``crash_lua_on_error``

- If ``False`` (the default), then Lua crashes in the simulator will not break the connection between BeamNG.tech and BeamNGpy. Set to ``True`` for getting proper stacktraces and easier debugging.
- Added new option to ``BeamNGpy.scenario.load`` called ``precompile_shaders``

- If ``True`` (the default), asynchronous shader compilation is disabled. That means the first loading of a map will take longer time, but all parts of the map will be preloaded. If ``False``, the camera sensor can have issues shortly after starting the scenario.
- Better handling of errors and crashes in the BeamNGpy TCP protocol.
- Fixed ``vehicle.control`` with zero integer arguments being ignored.
- Re-added ``BeamNGpy.scenario.get_vehicle`` (removed by accident in the last release).
- ``BeamNGpy.settings.set_deterministic`` and ``BeamNGpy.settings.set_steps_per_second`` are not persistent anymore and are applied only for a single run of the simulation.

Version 1.25.1
==============
- fixed in BeamNG.tech v0.27.1.0: converted all vehicle rotations sent to BeamNGpy to be consistent with each other
Expand Down
7 changes: 7 additions & 0 deletions docs/source/beamngpy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ Logging
:members:
:undoc-members:

Tools
=====

.. autoclass:: beamngpy.tools.RoadNetworkExporter
:members:
:undoc-members:

Miscellaneous
=============

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# -- Project information -----------------------------------------------------

project = 'BeamNGpy'
copyright = '2022, BeamNG GmbH'
copyright = '2023, BeamNG GmbH'
author = 'BeamNG GmbH'


Expand Down
4 changes: 2 additions & 2 deletions examples/road_network_exporter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from time import sleep

import beamngpy.tools.road_network_exporter as rne
from beamngpy import BeamNGpy, Scenario, Vehicle, set_up_simple_logging
from beamngpy.tools import RoadNetworkExporter


def main():
Expand All @@ -19,7 +19,7 @@ def main():
bng.scenario.start()

# Get the road graph data for the map.
graph = rne.Road_Network_Exporter(bng)
graph = RoadNetworkExporter(bng)
path_segments = graph.compute_path_segments()
graph.plot_path_segments(path_segments) # Plots the road data with Matplotlib.
graph.export_xodr('test_od') # export to OpenDrive (.xodr) format.
Expand Down
1 change: 1 addition & 0 deletions src/beamngpy/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .road_network_exporter import RoadNetworkExporter
10 changes: 5 additions & 5 deletions src/beamngpy/tools/road_network_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
if TYPE_CHECKING:
from beamngpy.beamng import BeamNGpy

__all__ = ['Road_Network_Exporter']
__all__ = ['RoadNetworkExporter']


class explicit_cubic:
class ExplicitCubic:
"""
A class for representing explicit cubic polynomials of the form: [ p(x) := a + b*x + c*x^2 + d*x^3 ].
"""
Expand Down Expand Up @@ -96,7 +96,7 @@ def approx_length(self, x0, x1, n=9000) -> float:
return sum


class parametric_cubic:
class ParametricCubic:
"""
A class for representing parametric cubic polynomials of the form:
[ u(x) := Bu*x + Cu^2 + Du^3, v(x) := Bv*x + Cv^2 + Dv^3 ].
Expand Down Expand Up @@ -178,7 +178,7 @@ def __init__(self, connection_type, id, contact_point):
self.contact_point = contact_point


class Road_Network_Exporter:
class RoadNetworkExporter:
"""
A class for retrieving and exporting BeamNG road network data.
"""
Expand Down Expand Up @@ -347,7 +347,7 @@ def _fit_parametric_cubic(self, p1, p2, t_start, t_end):
Cv = (3.0 * y2) - tan.y
Dv = tan.y - (2.0 * y2)

return parametric_cubic(Bu, Cu, Du, Cv, Dv)
return ParametricCubic(Bu, Cu, Du, Cv, Dv)

def compute_roads(self):
"""
Expand Down

0 comments on commit df97d29

Please sign in to comment.