Skip to content

Commit

Permalink
Merge branch 'sdf14' into scpeters/inertial_density
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters authored Feb 2, 2024
2 parents c4bfe35 + 3e0d533 commit 5bd4dc2
Show file tree
Hide file tree
Showing 34 changed files with 798 additions and 318 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: Ubuntu

on: [push, pull_request]
on:
pull_request:
push:
branches:
- 'sdf[0-9]?'
- 'main'

jobs:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
# Workaround for https://github.com/actions/setup-python/issues/577
- name: Clean up python binaries
run: |
rm -f /usr/local/bin/2to3*;
rm -f /usr/local/bin/idle3*;
rm -f /usr/local/bin/pydoc3*;
rm -f /usr/local/bin/python3*;
rm -f /usr/local/bin/python3*-config;
rm -f $(brew --prefix)/bin/2to3*;
rm -f $(brew --prefix)/bin/idle3*;
rm -f $(brew --prefix)/bin/pydoc3*;
rm -f $(brew --prefix)/bin/python3*;
rm -f $(brew --prefix)/bin/python3*-config;
- name: Install base dependencies
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
Expand All @@ -50,8 +50,8 @@ jobs:
- name: cmake
working-directory: build
run: |
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/${PACKAGE}/HEAD
export PYTHONPATH=$PYTHONPATH:$(brew --prefix)/lib/python
cmake .. -DCMAKE_INSTALL_PREFIX=$(brew --prefix)/Cellar/${PACKAGE}/HEAD -DPython3_EXECUTABLE=$(brew --prefix python3)/bin/python3
- run: make
working-directory: build
- run: make test
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

200 changes: 200 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"add_lint_tests",
"gz_configure_file",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
"gz_py_binary",
)

package(
default_visibility = GZ_VISIBILITY,
features = GZ_FEATURES,
)

licenses(["notice"])

exports_files(["LICENSE"])

gz_configure_header(
name = "config",
src = "include/sdf/config.hh.in",
cmakelists = ["CMakeLists.txt"],
defines = {
"CMAKE_INSTALL_FULL_DATAROOTDIR": "unused",
},
package = "sdformat",
)

gz_py_binary(
name = "embed_sdf",
srcs = ["sdf/embedSdf.py"],
main = "sdf/embedSdf.py",
)

genrule(
name = "embed_sdf_genrule",
srcs = glob([
"sdf/**/*.sdf",
"sdf/**/*.convert",
]),
outs = ["EmbeddedSdf.cc"],
cmd = "$(execpath :embed_sdf) --output-file $@ --sdf-root sdformat/sdf/ --input-files $(SRCS)", # noqa
tools = [":embed_sdf"],
)

public_headers_no_gen = glob([
"include/sdf/*.h",
"include/sdf/*.hh",
])

private_headers = glob(["src/*.hh"])

sources = glob(
["src/*.cc"],
exclude = [
"src/*_TEST.cc",
"src/gz.cc",
],
)

gz_export_header(
name = "include/sdf/Export.hh",
export_base = "GZ_SDFORMAT",
lib_name = "sdf",
visibility = ["//visibility:private"],
)

gz_include_header(
name = "sdformat_hh_genrule",
out = "include/sdformat.hh",
hdrs = public_headers_no_gen + [
"include/sdf/config.hh",
"include/sdf/Export.hh",
],
)

public_headers = public_headers_no_gen + [
"include/sdf/Export.hh",
"include/sdf/config.hh",
"include/sdformat.hh",
]

cc_library(
name = "urdf",
srcs = [
"src/urdf/urdf_parser/joint.cpp",
"src/urdf/urdf_parser/link.cpp",
"src/urdf/urdf_parser/model.cpp",
"src/urdf/urdf_parser/pose.cpp",
"src/urdf/urdf_parser/twist.cpp",
"src/urdf/urdf_parser/urdf_model_state.cpp",
"src/urdf/urdf_parser/urdf_sensor.cpp",
"src/urdf/urdf_parser/world.cpp",
],
hdrs = glob(
["src/urdf/**/*.h"],
),
copts = ["-Wno-unknown-pragmas"],
includes = ["src/urdf"],
deps = [
"@tinyxml2",
],
)

cc_library(
name = "sdformat",
srcs = sources + private_headers + ["EmbeddedSdf.cc"],
hdrs = public_headers,
defines = [
'SDF_SHARE_PATH=\\".\\"',
'SDF_VERSION_PATH=\\"sdformat\\"',
],
includes = [
"include",
"src",
],
deps = [
":urdf",
GZ_ROOT + "math",
GZ_ROOT + "utils",
"@tinyxml2",
],
)

cc_library(
name = "sdformat_internal",
srcs = [
"src/gz.cc",
"src/gz.hh",
],
visibility = ["//visibility:private"],
deps = [":sdformat"],
)

test_sources = glob(
["src/*_TEST.cc"],
exclude = ["src/gz_TEST.cc"],
)

[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
data = [
"sdf",
GZ_ROOT + "sdformat/test:integration",
GZ_ROOT + "sdformat/test:sdf",
],
env = {
"GZ_BAZEL": "1",
"GZ_BAZEL_PATH": "sdformat",
},
deps = [
":sdformat",
GZ_ROOT + "sdformat/test:test_utils",
"@gtest",
"@gtest//:gtest_main",
],
) for src in test_sources]

gz_configure_file(
name = "sdformat.rb",
src = "src/cmd/cmdsdformat.rb.in",
out = "cmdsdformat.rb",
cmakelists = ["CMakeLists.txt"],
defines = [
"library_location=libgz-sdformat.so",
],
package = "sdformat",
visibility = [GZ_ROOT + "tools:__pkg__"],
)

gz_configure_file(
name = "sdformat_yaml",
src = "conf/sdformat.yaml.in",
out = "sdformat.yaml",
cmakelists = ["CMakeLists.txt"],
defines = [
"gz_library_path=gz/sdformat/cmdsdformat.rb",
],
package = "sdformat",
visibility = [GZ_ROOT + "tools:__pkg__"],
)

cc_binary(
name = "libgz-sdformat.so",
srcs = [":sdformat_internal"],
linkshared = True,
visibility = [GZ_ROOT + "tools:__pkg__"],
deps = [
":sdformat",
],
)

exports_files(["sdf"])

add_lint_tests()
49 changes: 25 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,33 @@ if (BUILD_SDF)
# available during build time
set(GZ_TOOLS_VER 2)

#################################################
# Find python
if (SKIP_PYBIND11)
message(STATUS "SKIP_PYBIND11 set - disabling python bindings")
find_package(Python3 REQUIRED COMPONENTS Interpreter)
else()
find_package(Python3 REQUIRED
COMPONENTS Interpreter
OPTIONAL_COMPONENTS Development
)
if (NOT Python3_Development_FOUND)
GZ_BUILD_WARNING("Python development libraries are missing: Python interfaces are disabled.")
else()
set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.4 CONFIG QUIET)

if (pybind11_FOUND)
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
else()
GZ_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
endif()
endif()
endif()

#################################################
# Copied from catkin/cmake/empy.cmake
include(GzPython)
function(find_python_module module)
# cribbed from http://www.cmake.org/pipermail/cmake/2011-January/041666.html
string(TOUPPER ${module} module_upper)
Expand Down Expand Up @@ -121,29 +145,6 @@ if (BUILD_SDF)
gz_find_package(gz-utils2 REQUIRED COMPONENTS cli)
set(GZ_UTILS_VER ${gz-utils2_VERSION_MAJOR})

########################################
# Python interfaces
if (NOT PYTHON3_FOUND)
GZ_BUILD_ERROR("Python is missing - Needed to build/embed xml schemas")
else()
message (STATUS "Searching for Python - found version ${Python3_VERSION}.")

if (SKIP_PYBIND11)
message(STATUS "SKIP_PYBIND11 set - disabling python bindings")
else()
set(PYBIND11_PYTHON_VERSION 3)
find_package(pybind11 2.4 QUIET)

if (${pybind11_FOUND})
find_package(Python3 ${GZ_PYTHON_VERSION} REQUIRED COMPONENTS Development)
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
else()
GZ_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
endif()
endif()
endif()

gz_configure_build(HIDE_SYMBOLS_BY_DEFAULT QUIT_IF_BUILD_ERRORS)

gz_create_packages()
Expand Down
45 changes: 45 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,30 @@

## libsdformat 12.X

### libsdformat 12.7.2 (2023-09-01)

1. Fixed 1.9/light.sdf
* [Pull request #1281](https://github.com/gazebosim/sdformat/pull/1281)

1. URDF->SDF handle links with no inertia or small mass
* [Pull request #1238](https://github.com/gazebosim/sdformat/pull/1238)

1. Fix Element::Set method return value
* [Pull request #1256](https://github.com/gazebosim/sdformat/pull/1256)

1. Add missing values in Surace ToElement method
* [Pull request #1263](https://github.com/gazebosim/sdformat/pull/1263)

1. Rename COPYING to LICENSE
* [Pull request #1252](https://github.com/gazebosim/sdformat/pull/1252)

1. Infrastructure
* [Pull request #1245](https://github.com/gazebosim/sdformat/pull/1245)
* [Pull request #1271](https://github.com/gazebosim/sdformat/pull/1271)

1. Allow relative paths in URDF
* [Pull request #1213](https://github.com/gazebosim/sdformat/pull/1213)

### libsdformat 12.7.1 (2023-02-28)

1. Fix camera info topic default value
Expand Down Expand Up @@ -1602,6 +1626,27 @@

## libsdformat 9.X

### libsdformat 9.10.1 (2024-01-05)

1. URDF->SDF handle links with no inertia or small mass
* [Pull request #1238](https://github.com/gazebosim/sdformat/pull/1238)

1. Fix Element::Set method return value
* [Pull request #1256](https://github.com/gazebosim/sdformat/pull/1256)

1. Allowing relative paths in URDF
* [Pull request #1213](https://github.com/gazebosim/sdformat/pull/1213)

1. Use `File.exist?` for Ruby 3.2 compatibility
* [Pull request #1216](https://github.com/gazebosim/sdformat/pull/1216)

1. Infrastructure
* [Pull request #1217](https://github.com/gazebosim/sdformat/pull/1217)
* [Pull request #1225](https://github.com/gazebosim/sdformat/pull/1225)
* [Pull request #1271](https://github.com/gazebosim/sdformat/pull/1271)
* [Pull request #1345](https://github.com/gazebosim/sdformat/pull/1345)
* [Pull request #1252](https://github.com/gazebosim/sdformat/pull/1252)

### libsdformat 9.10.0 (2022-11-30)

1. Ign to gz header migration.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Windows | [![Build Status](https://build.osrfoundation.org/buildStatus/ico
SDFormat is an XML file format that describes environments, objects, and robots
in a manner suitable for robotic applications. SDFormat is capable of representing
and describing different physic engines, lighting properties, terrain, static
or dynamic objects, and articulated robots with various sensors, and acutators.
or dynamic objects, and articulated robots with various sensors, and actuators.
The format of SDFormat is also described by XML, which facilitates updates and
allows conversion from previous versions.

Expand Down
Loading

0 comments on commit 5bd4dc2

Please sign in to comment.