Skip to content

Commit

Permalink
Fix typo (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
Me-in-U authored Jun 10, 2024
1 parent ede15d7 commit 14d9441
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions docs/custom/custom_task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To define your own task, you need to inherit from :py:class:`Task<panda_gym.envs
- ``reset()``: how the task is reset; you must define `self.goal` in this function
- ``get_obs()``: returns the observation
- ``get_achieved_goal()``: returns the achieved goal
- ``is_success(achieved_goal, desired_goal, info)``: returns whether the task is successfull
- ``is_success(achieved_goal, desired_goal, info)``: returns whether the task is successful
- ``compute_reward(achieved_goal, desired_goal, info)``: returns the reward

For the purpose of the example, let's consider here a very simple task, consisting in moving a cube toward a target position. The goal position is sampled within a volume of 10 m x 10 m x 10 m.
Expand Down Expand Up @@ -51,14 +51,14 @@ For the purpose of the example, let's consider here a very simple task, consisti
achieved_goal = self.sim.get_base_position("object")
return achieved_goal
def is_success(self, achieved_goal, desired_goal, info={}): # info is here for consistancy
def is_success(self, achieved_goal, desired_goal, info={}): # info is here for consistency
# compute the distance between the goal position and the current object position
d = distance(achieved_goal, desired_goal)
# return True if the distance is < 1.0, and False otherwise
return np.array(d < 1.0, dtype=bool)
def compute_reward(self, achieved_goal, desired_goal, info={}): # info is here for consistancy
# for this example, reward = 1.0 if the task is successfull, 0.0 otherwise
def compute_reward(self, achieved_goal, desired_goal, info={}): # info is here for consistency
# for this example, reward = 1.0 if the task is successful, 0.0 otherwise
return self.is_success(achieved_goal, desired_goal, info).astype(np.float32)
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/advanced_rendering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ You can render from a different point of view than the default. For this, the fo

- ``render_width`` (int, optional): Image width. Defaults to 720.
- ``render_height`` (int, optional): Image height. Defaults to 480.
- ``render_target_position`` (np.ndarray, optional): Camera targetting this postion, as (x, y, z). Defaults to [0., 0., 0.].
- ``render_target_position`` (np.ndarray, optional): Camera targeting this position, as (x, y, z). Defaults to [0., 0., 0.].
- ``render_distance`` (float, optional): Distance of the camera. Defaults to 1.4.
- ``render_yaw`` (float, optional): Yaw of the camera. Defaults to 45.
- ``render_pitch`` (float, optional): Pitch of the camera. Defaults to -30.
- ``render_roll`` (int, optional): Rool of the camera. Defaults to 0.
- ``render_roll`` (int, optional): Roll of the camera. Defaults to 0.

Example
~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Environments
By default, the reward is sparse and the control mode is the end-effector displacement.
The complete set of environments present in the package is presented in the following list.

Sparce reward, end-effector control (default setting)
Sparse reward, end-effector control (default setting)
-----------------------------------------------------

* ``PandaReach-v3``
Expand All @@ -44,7 +44,7 @@ Dense reward, end-effector control
* ``PandaStackDense-v3``
* ``PandaFlipDense-v3``

Sparce reward, joints control
Sparse reward, joints control
-----------------------------

* ``PandaReachJoints-v3``
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/train_with_sb3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Bonus: Train with RL Baselines3 Zoo
-----------------------------------

`RL Baselines3 Zoo <https://stable-baselines3.readthedocs.io/en/master/guide/rl_zoo.html>`_ is the training framework associated with SB3.
It provides scripts for training, evaluating agents, setting hyperparameters, plotting results and recording video. It also contains already optimized hypermeters, including for some ``panda-gym`` environments.
It provides scripts for training, evaluating agents, setting hyperparameters, plotting results and recording video. It also contains already optimized hyperparameters, including for some ``panda-gym`` environments.

.. warning::
The current version of RL Baselines3 Zoo provides hyperparameters for version 1 of ``panda-gym``, but not for version 2. Before training with RL Baselines3 Zoo, you will have to set your own hyperparameters by editing ``hyperparameters/<ALGO>.yml``. For more information, please read the `README of RL Baselines3 Zoo <https://github.com/DLR-RM/rl-baselines3-zoo#readme>`_.
Expand Down
8 changes: 4 additions & 4 deletions panda_gym/envs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ class RobotTaskEnv(gym.Env):
task (Task): The task.
render_width (int, optional): Image width. Defaults to 720.
render_height (int, optional): Image height. Defaults to 480.
render_target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
render_target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
render_distance (float, optional): Distance of the camera. Defaults to 1.4.
render_yaw (float, optional): Yaw of the camera. Defaults to 45.
render_pitch (float, optional): Pitch of the camera. Defaults to -30.
render_roll (int, optional): Rool of the camera. Defaults to 0.
render_roll (int, optional): Roll of the camera. Defaults to 0.
"""

metadata = {"render_modes": ["human", "rgb_array"]}
Expand Down Expand Up @@ -286,7 +286,7 @@ def reset(
return observation, info

def save_state(self) -> int:
"""Save the current state of the envrionment. Restore with `restore_state`.
"""Save the current state of the environment. Restore with `restore_state`.
Returns:
int: State unique identifier.
Expand All @@ -296,7 +296,7 @@ def save_state(self) -> int:
return state_id

def restore_state(self, state_id: int) -> None:
"""Resotre the state associated with the unique identifier.
"""Restore the state associated with the unique identifier.
Args:
state_id (int): State unique identifier.
Expand Down
24 changes: 12 additions & 12 deletions panda_gym/envs/panda_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class PandaFlipEnv(RobotTaskEnv):
and "OpenGL" if render mode is "rgb_array". Only "OpenGL" is available for human render mode.
render_width (int, optional): Image width. Defaults to 720.
render_height (int, optional): Image height. Defaults to 480.
render_target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
render_target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
render_distance (float, optional): Distance of the camera. Defaults to 1.4.
render_yaw (float, optional): Yaw of the camera. Defaults to 45.
render_pitch (float, optional): Pitch of the camera. Defaults to -30.
render_roll (int, optional): Rool of the camera. Defaults to 0.
render_roll (int, optional): Roll of the camera. Defaults to 0.
"""

Expand Down Expand Up @@ -76,12 +76,12 @@ class PandaPickAndPlaceEnv(RobotTaskEnv):
and "OpenGL" if render mode is "rgb_array". Only "OpenGL" is available for human render mode.
render_width (int, optional): Image width. Defaults to 720.
render_height (int, optional): Image height. Defaults to 480.
render_target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
render_target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
render_distance (float, optional): Distance of the camera. Defaults to 1.4.
render_yaw (float, optional): Yaw of the camera. Defaults to 45.
render_pitch (float, optional): Pitch of the camera. Defaults to -30.
render_roll (int, optional): Rool of the camera. Defaults to 0.
render_roll (int, optional): Roll of the camera. Defaults to 0.
"""

def __init__(
Expand Down Expand Up @@ -126,12 +126,12 @@ class PandaPushEnv(RobotTaskEnv):
and "OpenGL" if render mode is "rgb_array". Only "OpenGL" is available for human render mode.
render_width (int, optional): Image width. Defaults to 720.
render_height (int, optional): Image height. Defaults to 480.
render_target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
render_target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
render_distance (float, optional): Distance of the camera. Defaults to 1.4.
render_yaw (float, optional): Yaw of the camera. Defaults to 45.
render_pitch (float, optional): Pitch of the camera. Defaults to -30.
render_roll (int, optional): Rool of the camera. Defaults to 0.
render_roll (int, optional): Roll of the camera. Defaults to 0.
"""

def __init__(
Expand Down Expand Up @@ -176,12 +176,12 @@ class PandaReachEnv(RobotTaskEnv):
and "OpenGL" if render mode is "rgb_array". Only "OpenGL" is available for human render mode.
render_width (int, optional): Image width. Defaults to 720.
render_height (int, optional): Image height. Defaults to 480.
render_target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
render_target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
render_distance (float, optional): Distance of the camera. Defaults to 1.4.
render_yaw (float, optional): Yaw of the camera. Defaults to 45.
render_pitch (float, optional): Pitch of the camera. Defaults to -30.
render_roll (int, optional): Rool of the camera. Defaults to 0.
render_roll (int, optional): Roll of the camera. Defaults to 0.
"""

def __init__(
Expand Down Expand Up @@ -226,12 +226,12 @@ class PandaSlideEnv(RobotTaskEnv):
and "OpenGL" if render mode is "rgb_array". Only "OpenGL" is available for human render mode.
render_width (int, optional): Image width. Defaults to 720.
render_height (int, optional): Image height. Defaults to 480.
render_target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
render_target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
render_distance (float, optional): Distance of the camera. Defaults to 1.4.
render_yaw (float, optional): Yaw of the camera. Defaults to 45.
render_pitch (float, optional): Pitch of the camera. Defaults to -30.
render_roll (int, optional): Rool of the camera. Defaults to 0.
render_roll (int, optional): Roll of the camera. Defaults to 0.
"""

def __init__(
Expand Down Expand Up @@ -276,12 +276,12 @@ class PandaStackEnv(RobotTaskEnv):
and "OpenGL" if render mode is "rgb_array". Only "OpenGL" is available for human render mode.
render_width (int, optional): Image width. Defaults to 720.
render_height (int, optional): Image height. Defaults to 480.
render_target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
render_target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
render_distance (float, optional): Distance of the camera. Defaults to 1.4.
render_yaw (float, optional): Yaw of the camera. Defaults to 45.
render_pitch (float, optional): Pitch of the camera. Defaults to -30.
render_roll (int, optional): Rool of the camera. Defaults to 0.
render_roll (int, optional): Roll of the camera. Defaults to 0.
"""

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion panda_gym/envs/robots/panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Panda(PyBulletRobot):
Args:
sim (PyBullet): Simulation instance.
block_gripper (bool, optional): Whether the gripper is blocked. Defaults to False.
base_position (np.ndarray, optionnal): Position of the base base of the robot, as (x, y, z). Defaults to (0, 0, 0).
base_position (np.ndarray, optional): Position of the base base of the robot, as (x, y, z). Defaults to (0, 0, 0).
control_type (str, optional): "ee" to control end-effector displacement or "joints" to control joint angles.
Defaults to "ee".
"""
Expand Down
6 changes: 3 additions & 3 deletions panda_gym/pybullet.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ def render(
Args:
width (int, optional): Image width. Defaults to 720.
height (int, optional): Image height. Defaults to 480.
target_position (np.ndarray, optional): Camera targetting this postion, as (x, y, z).
target_position (np.ndarray, optional): Camera targeting this position, as (x, y, z).
Defaults to [0., 0., 0.].
distance (float, optional): Distance of the camera. Defaults to 1.4.
yaw (float, optional): Yaw of the camera. Defaults to 45.
pitch (float, optional): Pitch of the camera. Defaults to -30.
roll (int, optional): Rool of the camera. Defaults to 0.
roll (int, optional): Roll of the camera. Defaults to 0.
mode (str, optional): Deprecated: This argument is deprecated and will be removed in a future
version. Use the render_mode argument of the constructor instead.
Expand Down Expand Up @@ -623,7 +623,7 @@ def create_table(
length (float): The length of the table (x direction).
width (float): The width of the table (y direction)
height (float): The height of the table.
x_offset (float, optional): The offet in the x direction.
x_offset (float, optional): The offset in the x direction.
lateral_friction (float or None, optional): Lateral friction. If None, use the default pybullet
value. Defaults to None.
spinning_friction (float or None, optional): Spinning friction. If None, use the default pybullet
Expand Down
2 changes: 1 addition & 1 deletion test/pybullet_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def test_inverse_kinematics():
pybullet.close()


def test_place_visalizer():
def test_place_visualizer():
from panda_gym.pybullet import PyBullet

pybullet = PyBullet()
Expand Down

0 comments on commit 14d9441

Please sign in to comment.