-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add rosdep rules folder and documentation
This commit adds a custom [rosdep](https://wiki.ros.org/rosdep) rules folder and documentation. This was done 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 ros/rosdistro#38332).
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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. |
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 |
---|---|---|
@@ -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] |