-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve documents to include action space, obs details, and fix links (…
…#52) * fix some error link * finish action space * finish navi and obs details
- Loading branch information
PENG Zhenghao
committed
Sep 5, 2021
1 parent
f622a92
commit 4fd2000
Showing
7 changed files
with
97 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
.. _action_and_dynamics: | ||
|
||
###################################### | ||
Action Space and Vehicular Dynamics | ||
###################################### | ||
############### | ||
Action Space | ||
############### | ||
|
||
MetaDrive receives normalized action as input to control each target vehicle: :math:`\mathbf a = [a_1, a_2]^T \in [-1, 1]^2`. | ||
|
||
.. warning:: This page is under construction! | ||
At each environmental time step, MetaDrive converts the normalized action into the steering :math:`u_s` (degree), acceleration :math:`u_a` (hp) and brake signal :math:`u_b` (hp) in the following ways: | ||
|
||
|
||
.. math:: | ||
u_s & = S_{max} a_1 ~\\ | ||
u_a & = F_{max} \max(0, a_2) ~\\ | ||
u_b & = -B_{max} \min(0, a_2) | ||
wherein :math:`S_{max}` (degree) is the maximal steering angle, :math:`F_{max}` (hp) is the maximal engine force, and :math:`B_{max}` (hp) is the maximal brake force. | ||
Since the accurate values of these parameters are varying across different types of vehicle, please refer to the `VehicleParameterSpace Class <https://github.com/decisionforce/metadrive/blob/main/metadrive/utils/space.py#L219>`_ for details. | ||
|
||
By such design, the action space for each agent is always fixed to :code:`gym.spaces.Box(low=-1.0, high=1.0, shape=(2, ))`. However, we provides a config named :code:`extra_action_dim` (int) which allows user to add more dimensions in the action space. | ||
For example, if we set :code:`config["extra_action_dim"] = 1`, then the action space for each agent will become :code:`Box(-1.0, 1.0, shape=(3, ))`. This allow the user to write environment wrapper that introduce more input action dimensions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters