Skip to content

Commit af3d1cc

Browse files
Merge upstream/main: MuJoCo 3.5.0 compat, URDF tooling refactor, tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 parents b728d76 + ede0a1c commit af3d1cc

14 files changed

Lines changed: 3334 additions & 1291 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Coverage Build - Jazzy
2+
on:
3+
workflow_dispatch:
4+
pull_request: &event
5+
branches:
6+
- main
7+
paths:
8+
- '**.hpp'
9+
- '**.h'
10+
- '**.cpp'
11+
- '**.py'
12+
- '**.yaml'
13+
- '.github/workflows/coverage.yml'
14+
- '**/package.xml'
15+
- '**/CMakeLists.txt'
16+
- 'codecov.yml'
17+
push: *event
18+
19+
jobs:
20+
coverage_jazzy:
21+
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-build-coverage.yml@master
22+
secrets: inherit
23+
with:
24+
ros_distro: jazzy

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MuJoCo ros2_control
22

3-
[![Rdev](https://build.ros2.org/job/Rdev__mujoco_ros2_control__ubuntu_noble_amd64/badge/icon)](https://build.ros2.org/job/Rdev__mujoco_ros2_control__ubuntu_noble_amd64/) [![Kdev](https://build.ros2.org/job/Kdev__mujoco_ros2_control__ubuntu_noble_amd64/badge/icon)](https://build.ros2.org/job/Kdev__mujoco_ros2_control__ubuntu_noble_amd64/) [![Jdev](https://build.ros2.org/job/Jdev__mujoco_ros2_control__ubuntu_noble_amd64/badge/icon)](https://build.ros2.org/job/Jdev__mujoco_ros2_control__ubuntu_noble_amd64/) [![CI](https://github.com/ros-controls/mujoco_ros2_control/actions/workflows/ci.yaml/badge.svg)](https://github.com/ros-controls/mujoco_ros2_control/actions/workflows/ci.yaml) ![License](https://img.shields.io/github/license/ros-controls/mujoco_ros2_control) [![Codecov](https://codecov.io/gh/ros-controls/mujoco_ros2_control/branch/main/graph/badge.svg)](https://codecov.io/gh/ros-controls/mujoco_ros2_control)
3+
[![Rdev](https://build.ros2.org/job/Rdev__mujoco_ros2_control__ubuntu_noble_amd64/badge/icon)](https://build.ros2.org/job/Rdev__mujoco_ros2_control__ubuntu_noble_amd64/) [![Kdev](https://build.ros2.org/job/Kdev__mujoco_ros2_control__ubuntu_noble_amd64/badge/icon)](https://build.ros2.org/job/Kdev__mujoco_ros2_control__ubuntu_noble_amd64/) [![Jdev](https://build.ros2.org/job/Jdev__mujoco_ros2_control__ubuntu_noble_amd64/badge/icon)](https://build.ros2.org/job/Jdev__mujoco_ros2_control__ubuntu_noble_amd64/) [![Hdev](https://build.ros2.org/job/Hdev__mujoco_ros2_control__ubuntu_jammy_amd64/badge/icon)](https://build.ros2.org/job/Hdev__mujoco_ros2_control__ubuntu_jammy_amd64/) [![CI](https://github.com/ros-controls/mujoco_ros2_control/actions/workflows/ci.yaml/badge.svg)](https://github.com/ros-controls/mujoco_ros2_control/actions/workflows/ci.yaml) ![License](https://img.shields.io/github/license/ros-controls/mujoco_ros2_control) [![Codecov](https://codecov.io/gh/ros-controls/mujoco_ros2_control/branch/main/graph/badge.svg)](https://codecov.io/gh/ros-controls/mujoco_ros2_control)
44

55
This repository provides a ros2_control system interface and supporting packages to run ROS 2 controllers against the MuJoCo physics simulator.
66

codecov.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
coverage:
2+
precision: 2
3+
round: down
4+
range: "35...100"
5+
status:
6+
project:
7+
default:
8+
informational: true
9+
flags:
10+
- unittests
11+
patch: off
12+
fixes:
13+
- "ros_ws/src/mujoco_ros2_control/::"
14+
comment:
15+
layout: "diff, flags, files"
16+
behavior: default
17+
flags:
18+
unittests:
19+
paths:
20+
- mujoco_ros2_control

mujoco_ros2_control/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ find_package(hardware_interface REQUIRED)
1414
find_package(nav_msgs REQUIRED)
1515
find_package(pluginlib REQUIRED)
1616
find_package(rclcpp REQUIRED)
17+
find_package(rclpy REQUIRED)
1718
find_package(rclcpp_lifecycle REQUIRED)
1819
find_package(mujoco_ros2_control_msgs REQUIRED)
1920
find_package(Threads REQUIRED)
@@ -111,9 +112,11 @@ add_library(mujoco_ros2_control SHARED
111112
src/mujoco_cameras.cpp
112113
src/mujoco_lidar.cpp
113114
)
114-
# Ensure MuJoCo library can be found at runtime regardless of how it was installed above
115+
# Ensure MuJoCo library can be found at runtime regardless of how it was installed above.
116+
# mujoco_vendor installs libmujoco.so under opt/mujoco_vendor/lib/ relative to the
117+
# install prefix, so that directory must be in the RPATH alongside the standard lib/.
115118
set_target_properties(mujoco_ros2_control PROPERTIES
116-
INSTALL_RPATH "\$ORIGIN/../lib;${CMAKE_INSTALL_PREFIX}/lib"
119+
INSTALL_RPATH "\$ORIGIN/../lib;\$ORIGIN/../opt/mujoco_vendor/lib;${CMAKE_INSTALL_PREFIX}/lib"
117120
)
118121
# MuJoCo has TinyXML2 statically linked, which conflicts with the system TinyXML2
119122
# used by FastDDS. We need to ensure the system TinyXML2 is loaded first.
@@ -198,8 +201,12 @@ install(
198201
pluginlib_export_plugin_description_file(hardware_interface mujoco_system_interface_plugin.xml)
199202

200203
if(BUILD_TESTING)
201-
add_subdirectory(test)
204+
add_subdirectory(tests)
202205
endif()
203206

207+
ament_python_install_package(mujoco_ros2_control
208+
SCRIPTS_DESTINATION lib/mujoco_ros2_control
209+
)
210+
204211
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
205212
ament_package()
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright (c) 2026 PAL Robotics S.L.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from .urdf_to_mujoco_utils import (
16+
add_mujoco_info,
17+
remove_tag,
18+
extract_mesh_info,
19+
replace_package_names,
20+
get_images_from_dae,
21+
rename_material_textures,
22+
set_up_axis_to_z_up,
23+
update_obj_assets,
24+
update_non_obj_assets,
25+
add_mujoco_inputs,
26+
get_processed_mujoco_inputs,
27+
parse_inputs_xml,
28+
parse_scene_xml,
29+
add_free_joint,
30+
multiply_quaternion,
31+
get_urdf_transforms,
32+
euler_to_quaternion,
33+
add_links_as_sites,
34+
add_cameras_from_sites,
35+
add_lidar_from_sites,
36+
add_modifiers,
37+
copy_pre_generated_meshes,
38+
get_urdf_from_rsp,
39+
get_xml_from_file,
40+
publish_model_on_topic,
41+
add_urdf_free_joint,
42+
write_mujoco_scene,
43+
DECOMPOSED_PATH_NAME,
44+
COMPOSED_PATH_NAME,
45+
)
46+
47+
__all__ = [
48+
"add_mujoco_info",
49+
"remove_tag",
50+
"extract_mesh_info",
51+
"replace_package_names",
52+
"get_images_from_dae",
53+
"rename_material_textures",
54+
"set_up_axis_to_z_up",
55+
"update_obj_assets",
56+
"update_non_obj_assets",
57+
"add_mujoco_inputs",
58+
"get_processed_mujoco_inputs",
59+
"parse_inputs_xml",
60+
"parse_scene_xml",
61+
"add_free_joint",
62+
"multiply_quaternion",
63+
"get_urdf_transforms",
64+
"euler_to_quaternion",
65+
"add_links_as_sites",
66+
"add_cameras_from_sites",
67+
"add_lidar_from_sites",
68+
"add_modifiers",
69+
"copy_pre_generated_meshes",
70+
"get_urdf_from_rsp",
71+
"get_xml_from_file",
72+
"publish_model_on_topic",
73+
"add_urdf_free_joint",
74+
"write_mujoco_scene",
75+
DECOMPOSED_PATH_NAME,
76+
COMPOSED_PATH_NAME,
77+
]

0 commit comments

Comments
 (0)