Skip to content

Commit

Permalink
Merge branch 'sdf15' into gz_sdf_executable
Browse files Browse the repository at this point in the history
  • Loading branch information
azeey committed Dec 3, 2024
2 parents 7592414 + 9661794 commit cad2158
Show file tree
Hide file tree
Showing 87 changed files with 162 additions and 145 deletions.
20 changes: 6 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,6 @@ if (BUILD_SDF)
)
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()

Expand Down Expand Up @@ -136,9 +126,11 @@ if (BUILD_SDF)

################################################
# Find psutil python package for memory tests
find_python_module(psutil)
if (NOT PY_PSUTIL)
gz_build_warning("Python psutil package not found. Memory leak tests will be skipped")
if (BUILD_TESTING)
find_python_module(psutil)
if (NOT PY_PSUTIL)
gz_build_warning("Python psutil package not found. Memory leak tests will be skipped")
endif()
endif()

########################################
Expand All @@ -159,7 +151,7 @@ if (BUILD_SDF)
add_subdirectory(sdf)
add_subdirectory(conf)
add_subdirectory(doc)
if (pybind11_FOUND AND NOT SKIP_PYBIND11)
if (Python3_Development_FOUND AND NOT SKIP_PYBIND11)
add_subdirectory(python)
endif()
endif(BUILD_SDF)
Expand Down
92 changes: 47 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ which version you need, or leave it empty for version 1.

### macOS

On macOS, add OSRF packages:
On macOS, after installing the [Homebrew package manager](https://brew.sh),
add OSRF packages:
```sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap osrf/simulation
```

Expand Down Expand Up @@ -129,6 +129,25 @@ git clone https://github.com/gazebosim/sdformat -b sdf<#>
Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need.

### Install dependencies

#### Ubuntu

```sh
cd sdformat
sudo apt -y install \
$(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | tr '\n' ' '))
```

#### macOS

```sh
brew install --only-dependencies sdformat<#>
```

Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need.

### Build from Source

Standard installation can be performed in UNIX systems using the following
Expand All @@ -144,60 +163,43 @@ make install

sdformat supported cmake parameters at configuring time:

* `USE_INTERNAL_URDF` (`bool`) [default `False`] <br/>
Use an internal copy of urdfdom 1.0.0 instead of look for one
installed in the system
* `USE_UPSTREAM_CFLAGS` (`bool`) [default `True`] <br/>
Use the sdformat team compilation flags instead of the common set defined
by cmake.
| Name | Type | Default | Description |
|-----------------------|------|----------|--------------------------------------|
| `SKIP_PYBIND11` | BOOL | False | Skip generating Python bindings via pybind11 |
| `USE_INTERNAL_URDF` | BOOL | False | Use an internal copy of urdfdom 1.0.0 instead of looking for one installed in the system |
| `USE_UPSTREAM_CFLAGS` | BOOL | True | Use the sdformat team compilation flags instead of the common set defined by cmake. |

## Uninstallation
### Build python bindings separately from main library

To uninstall the software installed with the previous steps:
If you want to build Python bindings separately from the main libsdformat library
(for example if you want to build Python bindings for multiple versions of Python),
you can invoke cmake on the `python` folder instead of the root folder.
Specify the path to the python executable with which you wish to build bindings
in the `Python3_EXECUTABLE` cmake variable.
Specify the install path for the bindings in the `CMAKE_INSTALL_PREFIX`
variable, and be sure to set your `PYTHONPATH` accordingly after install.

```sh
cd build
make uninstall
```bash
cd sdformat
mkdir build_python3
cd build_python3
cmake ../python \
-DPython3_EXECUTABLE=/usr/local/bin/python3.12 \
-DCMAKE_INSTALL_PREFIX=<prefix>
```

## macOS
See the homebrew [sdformat15 formula](https://github.com/osrf/homebrew-simulation/blob/027d06f5be49da1e40d01180aedae7f76dc7ff47/Formula/sdformat15.rb#L12-L56)
for an example of building bindings for multiple versions of Python.

### Prerequisites
## Uninstallation

Clone the repository
```sh
git clone https://github.com/gazebosim/sdformat -b sdf<#>
```
Be sure to replace `<#>` with a number value, such as 14 or 15, depending on
which version you need.
To uninstall the software installed with the previous steps:

Install dependencies
```sh
brew install --only-dependencies sdformat<#>
cd build
make uninstall
```

### Build from Source

1. Configure and build
```sh
cd sdformat
mkdir build
cd build
cmake .. # Consider specifying -DCMAKE_INSTALL_PREFIX=...
make
```

2. Optionally, install and uninstall
```sh
sudo make install
```

To uninstall the software installed with the previous steps:
```sh
cd build/
sudo make uninstall
```

## Windows

### Prerequisites
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Actor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "sdf/Link.hh"
#include "sdf/Joint.hh"
#include "sdf/Plugin.hh"
#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"

namespace sdf
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/AirPressure.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/Noise.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/AirSpeed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/Noise.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Altimeter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/Noise.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Atmosphere.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "sdf/Element.hh"
#include "sdf/Types.hh"
#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"


Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Box.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <gz/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Camera.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/Noise.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Capsule.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Collision.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "sdf/Element.hh"
#include "sdf/SemanticPose.hh"
#include "sdf/Types.hh"
#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"
#include "sdf/ParserConfig.hh"

Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Cone.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <gz/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Console.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <memory>
#include <string>

#include <sdf/sdf_config.h>
#include <sdf/config.hh>
#include "sdf/system_util.hh"

#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Cylinder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Element.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "sdf/Error.hh"
#include "sdf/Param.hh"
#include "sdf/PrintConfig.hh"
#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"
#include "sdf/Types.hh"

Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Ellipsoid.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/utils/ImplPtr.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Error.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <string>
#include <optional>
#include <gz/utils/ImplPtr.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>
#include "sdf/Console.hh"
#include "sdf/system_util.hh"

Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Exception.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <string>

#include <gz/utils/ImplPtr.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>
#include "sdf/system_util.hh"

namespace sdf
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Filesystem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <string>

#include <gz/utils/ImplPtr.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>
#include "sdf/system_util.hh"

namespace sdf
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/ForceTorque.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/Noise.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Frame.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "sdf/Element.hh"
#include "sdf/SemanticPose.hh"
#include "sdf/Types.hh"
#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"

namespace sdf
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Geometry.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/math/Inertial.hh>
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>
#include <sdf/ParserConfig.hh>
#include <sdf/Types.hh>

Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Gui.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "sdf/Element.hh"
#include "sdf/Plugin.hh"
#include "sdf/Types.hh"
#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"

namespace sdf
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Heightmap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <gz/utils/ImplPtr.hh>
#include <sdf/Element.hh>
#include <sdf/Error.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/Imu.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <sdf/Error.hh>
#include <sdf/Element.hh>
#include <sdf/Noise.hh>
#include <sdf/sdf_config.h>
#include <sdf/config.hh>

namespace sdf
{
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/InstallationDirectories.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <string>

#include <sdf/sdf_config.h>
#include <sdf/config.hh>
#include <sdf/system_util.hh>

namespace sdf
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/InterfaceElements.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "sdf/InterfaceModel.hh"
#include "sdf/Types.hh"

#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"

namespace sdf
Expand Down
2 changes: 1 addition & 1 deletion include/sdf/InterfaceFrame.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <gz/math/Pose3.hh>
#include <gz/utils/ImplPtr.hh>

#include "sdf/sdf_config.h"
#include "sdf/config.hh"
#include "sdf/system_util.hh"

namespace sdf
Expand Down
Loading

0 comments on commit cad2158

Please sign in to comment.