Skip to content

Commit

Permalink
small fixes to tutorial formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
balisujohn committed Jun 23, 2023
1 parent 2cb01e8 commit be2c958
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/tutorials/dataset_creation/point_maze_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# {(5, 1): (4, 1), (4, 1): (4, 2), (4, 2): (3, 2), (3, 2): (2, 2), (2, 2): (2, 1), (2, 1): (1, 1)}
#
# The keys of this dictionary are the current state of the agent and the values the next state of the wapoint path.
#
#

UP = 0
DOWN = 1
Expand Down Expand Up @@ -160,15 +160,17 @@ def _check_valid_cell(self, cell):
else:
return True


# %%
# Waypoint Controller
# ~~~~~~~~~~~~~~~~~~~
# Next step will be to create a controller to allow the agent to follow the waypoint trajectory.
# D4RL uses a PD controller to output continuous force actions from position and velocity.
# A PD controller is a variation of the PID controller often used in classical Control Theory.
# PID combines three components Proportial Term(P), Integral Term(I) and Derivative Term (D)
#
# 1. Proportial Term(P)
# ~~~~~~~~~~~~~~~~~~~
# -------------------
# The proportional term in a PID controller adjusts the control action based on the current error,
# which is the difference between the desired value (setpoint) and the current value of the process variable.
# The control action is directly proportional to the error. A higher error results in a stronger control action.
Expand All @@ -179,8 +181,8 @@ def _check_valid_cell(self, cell):
# \tau = k_{p}(Error)
#
# 2. Derivative Term (D)
# ~~~~~~~~~~~~~~~~~~~
#The derivative term in a PD controller considers the rate of change of the error over time.
# -------------------
# The derivative term in a PD controller considers the rate of change of the error over time.
# It helps to predict the future behavior of the error. By dampening the control action based
# on the rate of change of the error, the derivative term contributes to system stability and reduces overshooting.
# It also helps the system respond quickly to changes in the error.
Expand All @@ -196,20 +198,20 @@ def _check_valid_cell(self, cell):
# \tau = k_{p}(Error) + k_{d}(d(Error) / dt)
#
# 3. Integral Term (I)
# ~~~~~~~~~~~~~~~~~~~
#The integral term in a PID controller integrates the cumulative error over time.
# -------------------
# The integral term in a PID controller integrates the cumulative error over time.
# It helps to address steady-state errors or biases that may exist in the system.
# The integral term continuously adjusts the control action based on the accumulated error,
# aiming to eliminate any long-term deviations between the desired setpoint and the actual process variable.
# references.
#
# .. math ::
# \tau = k_{I}\(\int\)(Error) dt
# \tau = k_{I}(\int)(Error) dt
#
# Finally for a PID controller we have the equation below
#
# .. math ::
# \tau = k_{p}(Error) + k_{d}(d(Error) / dt) + k_{I}\(\int\) Error dt
# \tau = k_{p}(Error) + k_{d}(d(Error) / dt) + k_{I}(\int) Error dt
#
# In the PID controller formula, Kp, Ki, and Kd are the respective gains for the proportional, integral, and derivative terms.
# These gains determine the influence of each term on the control action.
Expand Down

0 comments on commit be2c958

Please sign in to comment.