Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: test #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rosdep/19-ros-gazebo-gym.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Adds custom rosdep rules to the rosdep database.
# NOTE: Done because gymnasium and gymnasium-robotics require numpy>=1.20.1 while
# python==1.17.4 is installed on Ubuntu 20.04 by default.
yaml https://github.com/rickstaa/ros-gazebo-gym/rosdep/rosdep.yaml
22 changes: 22 additions & 0 deletions rosdep/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Custom ros-gazebo-gym rosdep rules

This folder contains custom [rosdep](https://wiki.ros.org/rosdep) rules for the `ros-gazebo-gym` package. These rules were created to resolve conflicting requirements between the `python3-gymnasium-pip` and `python3-gymnasium-robotics` rules and the `python3-numpy` rule on [Ubuntu 20.04](https://releases.ubuntu.com/focal/). Specifically, `gymnasium` requires `numpy>=1.20.1`, but the `python3-numpy` rule installs `numpy==1.17.4` (see https://github.com/ros/rosdistro/issues/38332).

> \[!IMPORTANT]\
> While the steps provided here will work, it is recommended that you use a virtual environment to keep your ROS system packages separate from your project-specific packages. This can help avoid conflicts and ensure reproducibility. To create a virtual environment, you can use the venv package and install the correct Numpy, gymnasium and gymnasium-robotics versions directly using pip. When creating the virtual environment, make sure to include the `--system-site-packages` flag so that the ROS system packages are available in the virtual environment.

## Usage

To use these rules, follow these steps:

1. Copy or download the `19-ros-gazebo-gym.list` file to the `/etc/ros/rosdep/sources.list.d/` folder.
2. Run `rosdep update` to update the Rosdep database.
3. Run `rosdep install --reinstall ros-gazebo-gym` to install the dependencies of the `ros-gazebo-gym` package. Note that the `--reinstall` flag is necessary because `python3-numpy` is already installed when ROS is installed.

## Restoring Default Rules

If you want to restore the default rules, follow these steps:

1. Remove the `19-ros-gazebo-gym.list` file from the `/etc/ros/rosdep/sources.list.d/` folder.
2. Run `rosdep update` to update the Rosdep database.
3. Run `rosdep install --reinstall ros-gazebo-gym` to install the dependencies of the `ros-gazebo-gym` package. Note that the `--reinstall` flag is necessary because `python3-numpy` is already installed when ROS is installed.
15 changes: 15 additions & 0 deletions rosdep/rosdep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Custom dependency overwrites for rosdep.
python3-gymnasium-pip:
ubuntu:
focal:
pip:
packages: [gymnasium]
python3-gymnasium-robotics-pip:
ubuntu:
focal:
pip:
packages: [gymnasium-robotics]
python3-numpy:
ubuntu:
pip:
packages: [numpy]
Loading