Skip to content

Commit c904bca

Browse files
saikishormathias-luedtkeeholum-nasa
authored
Use requirements.txt to install python dependencies (#151)
Co-authored-by: Mathias Lüdtke <mathias.luedtke@pal-robotics.com> Co-authored-by: Erik Holum <erik.holum@nasa.gov>
1 parent 4527c5d commit c904bca

6 files changed

Lines changed: 714 additions & 716 deletions

File tree

mujoco_ros2_control/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ install(
239239
USE_SOURCE_PERMISSIONS
240240
)
241241

242+
install(
243+
FILES scripts/requirements.txt
244+
DESTINATION share/${PROJECT_NAME}
245+
)
246+
242247
pluginlib_export_plugin_description_file(hardware_interface mujoco_system_interface_plugin.xml)
243248

244249
if(BUILD_TESTING)

mujoco_ros2_control/package.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<depend>libglfw3-dev</depend>
2929
<depend>mujoco_vendor</depend>
3030
<depend>pluginlib</depend>
31-
<depend>python3-pykdl</depend>
3231
<depend>rclcpp_lifecycle</depend>
3332
<depend>rclcpp</depend>
3433
<depend>sensor_msgs</depend>
@@ -39,6 +38,11 @@
3938
<test_depend>ament_cmake_gtest</test_depend>
4039
<test_depend>ament_cmake_pytest</test_depend>
4140

41+
<exec_depend>ament_index_python</exec_depend>
42+
<exec_depend>python3-importlib-resources</exec_depend>
43+
<exec_depend>python3-pykdl</exec_depend>
44+
<exec_depend>python3-numpy</exec_depend>
45+
<exec_depend>urdfdom_py</exec_depend>
4246
<exec_depend>python3-venv</exec_depend>
4347
<exec_depend>python3-pip</exec_depend>
4448

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
absl-py==2.4.0
2+
coacd==1.0.7
3+
docstring_parser==0.17.0
4+
etils==1.13.0
5+
fsspec==2026.2.0
6+
glfw==2.10.0
7+
lxml==6.0.2
8+
mujoco==3.6.0
9+
obj2mjcf==0.0.25
10+
pillow==12.1.1
11+
PyOpenGL==3.1.10
12+
termcolor==3.3.0
13+
trimesh==4.11.4
14+
typeguard==4.5.1
15+
typing_extensions==4.15.0
16+
tyro==1.0.10

mujoco_ros2_control/scripts/robot_description_to_mjcf.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ function check_dependencies() {
4545
fi
4646
# check if the dependencies trimesh, mujoco, obj2mjcf and scipy are installed, if not install them
4747
if ! python3 -c "import trimesh; import mujoco; import obj2mjcf" &> /dev/null; then
48-
echo "Dependencies not found. Installing trimesh, mujoco, obj2mjcf, scipy...."
48+
echo "Dependencies not found. Installing from requirements.txt...."
4949
start_time=$(date +%s)
50-
pip3 install --no-input --no-cache-dir --disable-pip-version-check trimesh mujoco obj2mjcf
50+
pip3 install --no-input --no-cache-dir --disable-pip-version-check -r "$(dirname "${BASH_SOURCE[0]}")/requirements.txt"
5151
end_time=$(date +%s)
5252
echo "Successfully installed dependencies in $((end_time - start_time)) seconds."
5353
fi
@@ -64,4 +64,4 @@ if [[ "$*" == *"--install-only"* ]]; then
6464
fi
6565

6666
# Get all the arguments of the bash script and then forward it to the make_mjcf_from_robot_description.py script
67-
exec python3 "$(dirname "$0")/make_mjcf_from_robot_description.py" "$@"
67+
exec python3 "$(dirname "${BASH_SOURCE[0]}")/make_mjcf_from_robot_description.py" "$@"

0 commit comments

Comments
 (0)