Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ign -> gz CMake, Python, Partial Source, and File Migrations : gz-math #460

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ci/packages.apt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
libeigen3-dev
libignition-cmake3-dev
libignition-utils2-dev
libgz-cmake3-dev
libgz-utils2-dev
libpython3-dev
python3-distutils
python3-pybind11
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@focal
uses: gazebo-tooling/action-gz-ci@focal
with:
codecov-enabled: true
cppcheck-enabled: true
Expand All @@ -25,4 +25,4 @@ jobs:
uses: actions/checkout@v2
- name: Compile and test
id: ci
uses: ignition-tooling/action-ignition-ci@jammy
uses: gazebo-tooling/action-gz-ci@jammy
2 changes: 1 addition & 1 deletion .github/workflows/pr-collection-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
steps:
- name: Add collection labels
if: github.event.action == 'opened'
uses: ignition-tooling/pr-collection-labeler@v1
uses: gazebo-tooling/pr-collection-labeler@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
38 changes: 19 additions & 19 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
load(
"//gz_bazel:build_defs.bzl",
"IGNITION_FEATURES",
"IGNITION_VISIBILITY",
"GZ_FEATURES",
"GZ_VISIBILITY",
"cmake_configure_file",
"generate_include_header",
"gz_config_header",
"gz_export_header",
)

package(
default_visibility = IGNITION_VISIBILITY,
features = IGNITION_FEATURES,
default_visibility = GZ_VISIBILITY,
features = GZ_FEATURES,
)

licenses(["notice"])
Expand All @@ -28,23 +28,23 @@ PROJECT_PATCH = 0
# Generates config.hh based on the version numbers in CMake code.
gz_config_header(
name = "config",
src = "include/ignition/math/config.hh.in",
src = "include/gz/math/config.hh.in",
cmakelists = ["CMakeLists.txt"],
project_name = PROJECT_NAME,
project_version = (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH),
)

gz_export_header(
name = "include/ignition/math/Export.hh",
export_base = "IGNITION_MATH",
lib_name = "ignition-math",
name = "include/gz/math/Export.hh",
export_base = "GZ_MATH",
lib_name = "gz-math",
visibility = ["//visibility:private"],
)

public_headers_no_gen = glob([
"include/ignition/math/*.hh",
"include/ignition/math/detail/*.hh",
"include/ignition/math/graph/*.hh",
"include/gz/math/*.hh",
"include/gz/math/detail/*.hh",
"include/gz/math/graph/*.hh",
])

private_headers = glob(["src/*.hh"])
Expand All @@ -56,17 +56,17 @@ sources = glob(

generate_include_header(
name = "mathhh_genrule",
out = "include/ignition/math.hh",
out = "include/gz/math.hh",
hdrs = public_headers_no_gen + [
"include/ignition/math/config.hh",
"include/ignition/math/Export.hh",
"include/gz/math/config.hh",
"include/gz/math/Export.hh",
],
)

public_headers = public_headers_no_gen + [
"include/ignition/math/config.hh",
"include/ignition/math/Export.hh",
"include/ignition/math.hh",
"include/gz/math/config.hh",
"include/gz/math/Export.hh",
"include/gz/math.hh",
]

cc_library(
Expand All @@ -78,9 +78,9 @@ cc_library(

# use shared library only when absolutely needd
cc_binary(
name = "libignition-math7.so",
name = "libgz-math7.so",
includes = ["include"],
linkopts = ["-Wl,-soname,libignition-math7.so"],
linkopts = ["-Wl,-soname,libgz-math7.so"],
linkshared = True,
deps = [
":gz_math",
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/math
REPLACE_INCLUDE_PATH gz/math
VERSION_SUFFIX pre1)

#============================================================================
Expand Down Expand Up @@ -58,7 +58,7 @@ gz_find_package(
# Include swig
find_package(SWIG QUIET)
if (NOT SWIG_FOUND)
IGN_BUILD_WARNING("Swig is missing: Language interfaces are disabled.")
GZ_BUILD_WARNING("Swig is missing: Language interfaces are disabled.")
message (STATUS "Searching for swig - not found.")
else()
message (STATUS "Searching for swig - found version ${SWIG_VERSION}.")
Expand All @@ -70,7 +70,7 @@ if (SWIG_FOUND)
# Include ruby
find_package(Ruby 1.9 QUIET)
if (NOT RUBY_FOUND)
IGN_BUILD_WARNING("Ruby is missing: Install ruby-dev to enable ruby interfaces.")
GZ_BUILD_WARNING("Ruby is missing: Install ruby-dev to enable ruby interfaces.")
message (STATUS "Searching for Ruby - not found.")
else()
message (STATUS "Searching for Ruby - found version ${RUBY_VERSION}.")
Expand All @@ -79,10 +79,10 @@ endif()

########################################
# Python bindings
include(IgnPython)
include(GzPython)
find_package(PythonLibs QUIET)
if (NOT PYTHONLIBS_FOUND)
IGN_BUILD_WARNING("Python is missing: Python interfaces are disabled.")
GZ_BUILD_WARNING("Python is missing: Python interfaces are disabled.")
message (STATUS "Searching for Python - not found.")
else()
message (STATUS "Searching for Python - found version ${PYTHONLIBS_VERSION_STRING}.")
Expand All @@ -94,7 +94,7 @@ else()
if (${pybind11_FOUND})
message (STATUS "Searching for pybind11 - found version ${pybind11_VERSION}.")
else()
IGN_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
GZ_BUILD_WARNING("pybind11 is missing: Python interfaces are disabled.")
message (STATUS "Searching for pybind11 - not found.")
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ instead.
1. Added functions to convert between time_point and secNsec
* [Pull request 150](https://github.com/gazebosim/gz-math/pull/150)

1. Fix IGNITION_MATH_XXX_VERSION
1. Fix GZ_MATH_XXX_VERSION
* [Pull request 151](https://github.com/gazebosim/gz-math/pull/151)

1. Add Max and Min function to Vector2.hh
Expand Down
2 changes: 2 additions & 0 deletions Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ release will remove the deprecated code.
1. Removed the Quaternion integer template `Quaternioni`.

1. The project name has been changed to use the `gz-` prefix, you **must** use the `gz` prefix!

* This also means that any generated code that use the project name (e.g. CMake variables, in-source macros) would have to be migrated.
* Some non-exhaustive examples of this include:
* `GZ_<PROJECT>_<VISIBLE/HIDDEN>`
Expand Down Expand Up @@ -91,6 +92,7 @@ release will remove the deprecated code.
1. `IGN_MASSMATRIX3_DEFAULT_TOLERANCE`
1. All `IGN_*_SIZE_T` variables are deprecated and will be removed in future versions.
Please use `GZ_*_SIZE_T` instead.
1. Python library `ignition` namespaces should be replaced with `gz`.


### Modifications
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Please refer to the [examples directory](https://github.com/gazebosim/gz-math/ra
Refer to the following table for information about important directories and files in this repository.

```
ign-math
gz-math
├── examples Example programs.
├── include/ignition/math Header files.
├── src Source files and unit tests.
Expand Down
4 changes: 2 additions & 2 deletions api.md.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Gazebo @IGN_DESIGNATION_CAP@
## Gazebo @GZ_DESIGNATION_CAP@

Gazebo @IGN_DESIGNATION_CAP@ is a component in Gazebo, a set of
Gazebo @GZ_DESIGNATION_CAP@ is a component in Gazebo, a set of
libraries designed to rapidly develop robot and simulation applications.
This library defines a general set of math classes and functions with an eye
toward simulation and robotics.
Expand Down
27 changes: 0 additions & 27 deletions configure.bat

This file was deleted.

8 changes: 4 additions & 4 deletions eigen3/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load(
"//gz_bazel:build_defs.bzl",
"IGNITION_ROOT",
"IGNITION_VISIBILITY",
"GZ_ROOT",
"GZ_VISIBILITY",
)

package(
default_visibility = IGNITION_VISIBILITY,
default_visibility = GZ_VISIBILITY,
)

licenses(["notice"])
Expand All @@ -21,7 +21,7 @@ cc_library(
includes = ["include"],
deps = [
"@eigen3",
IGNITION_ROOT + "gz_math",
GZ_ROOT + "gz_math",
],
)

Expand Down
2 changes: 1 addition & 1 deletion eigen3/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_subdirectory(gz)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
install(DIRECTORY ignition DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL})
12 changes: 6 additions & 6 deletions examples/angle_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
# This example will only work if the Python interface library was compiled and
# installed.
#
# Modify the PYTHONPATH environment variable to include the ignition math
# Modify the PYTHONPATH environment variable to include the gz math
# library install path. For example, if you install to /usr:
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
#

import ignition.math
import gz.math

print("PI in degrees = {}\n".format(ignition.math.Angle.PI.degree()))
print("PI in degrees = {}\n".format(gz.math.Angle.PI.degree()))

a1 = ignition.math.Angle(1.5707)
a2 = ignition.math.Angle(0.7854)
a1 = gz.math.Angle(1.5707)
a2 = gz.math.Angle(0.7854)
print("a1 = {} radians, {} degrees\n".format(a1.radian(), a1.degree()))
print("a2 = {} radians, {} degrees\n".format(a2.radian(), a2.degree()))
print("a1 * a2 = {} radians, {} degrees\n".format((a1 * a2).radian(),
Expand All @@ -36,7 +36,7 @@
print("a1 - a2 = {} radians, {} degrees\n".format((a1 - a2).radian(),
(a1 - a2).degree()))

a3 = ignition.math.Angle(15.707)
a3 = gz.math.Angle(15.707)
print("a3 = {} radians, {} degrees\n".format(a3.radian(), a3.degree()))
a3.normalize()
print("a3.Normalize = {} radians, {} degrees\n".format(a3.radian(),
Expand Down
4 changes: 2 additions & 2 deletions examples/diff_drive_odometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
# This example will only work if the Python interface library was compiled and
# installed.
#
# Modify the PYTHONPATH environment variable to include the ignition math
# Modify the PYTHONPATH environment variable to include the gz math
# library install path. For example, if you install to /usr:
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH

import datetime
import math

from ignition.math import Angle, DiffDriveOdometry
from gz.math import Angle, DiffDriveOdometry

odom = DiffDriveOdometry()

Expand Down
4 changes: 2 additions & 2 deletions examples/gauss_markov_process_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Modify the PYTHONPATH environment variable to include the ignition math
# Modify the PYTHONPATH environment variable to include the gz math
# library install path. For example, if you install to /usr:
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
Expand All @@ -26,7 +26,7 @@
# 2. Use gnuplot to create a plot:
# gnuplot -e 'set terminal jpeg; plot "plot.data" with lines' > out.jpg
import datetime
from ignition.math import GaussMarkovProcess
from gz.math import GaussMarkovProcess

# Create the process with:
# * Start value of 20.2
Expand Down
2 changes: 1 addition & 1 deletion examples/kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


from ignition.math import Kmeans, Vector3d
from gz.math import Kmeans, Vector3d

# Create some observations.
obs = list([])
Expand Down
2 changes: 1 addition & 1 deletion examples/rand_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# 2. Use gnuplot to create a plot:
# gnuplot -c rand_view_normal.gp > normal.jpg
# gnuplot -c rand_view_uniform.gp > uniform.jpg
from ignition.math import Rand
from gz.math import Rand
import sys

if (len(sys.argv) < 2):
Expand Down
10 changes: 5 additions & 5 deletions examples/vector2_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
# This example will only work if the Python interface library was compiled and
# installed.
#
# Modify the PYTHONPATH environment variable to include the ignition math
# Modify the PYTHONPATH environment variable to include the gz math
# library install path. For example, if you install to /user:
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
#
import ignition.math
import gz.math

va = ignition.math.Vector2d(1, 2)
vb = ignition.math.Vector2d(3, 4)
vc = ignition.math.Vector2d(vb)
va = gz.math.Vector2d(1, 2)
vb = gz.math.Vector2d(3, 4)
vc = gz.math.Vector2d(vb)

print("va = {} {}\n".format(va.x(), va.y()))
print("vb = {} {}\n".format(vb.x(), vb.y()))
Expand Down
8 changes: 4 additions & 4 deletions examples/vector3_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
# This example will only work if the Python interface library was compiled and
# installed.
#
# Modify the PYTHONPATH environment variable to include the ignition math
# Modify the PYTHONPATH environment variable to include the gz math
# library install path. For example, if you install to /user:
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
#
import ignition.math
import gz.math

v1 = ignition.math.Vector3d(0, 0, 3)
v1 = gz.math.Vector3d(0, 0, 3)
print("v =: {} {} {}\n".format(v1.x(), v1.y(), v1.z()))

v2 = ignition.math.Vector3d(4, 0, 0)
v2 = gz.math.Vector3d(4, 0, 0)
print("v2 = {} {} {}\n".format(v2.x(), v2.y(), v2.z()))

v3 = v1 + v2
Expand Down
Loading