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

Bump main to gz-math 9.0.0~pre1 #635

Merged
merged 1 commit into from
Oct 9, 2024
Merged
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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(gz-math8 VERSION 8.0.0)
project(gz-math9 VERSION 9.0.0)

#============================================================================
# Find gz-cmake
Expand All @@ -18,7 +18,7 @@ set(GZ_CMAKE_VER ${gz-cmake4_VERSION_MAJOR})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

gz_configure_project(VERSION_SUFFIX)
gz_configure_project(VERSION_SUFFIX pre1)

#============================================================================
# Set project-specific options
Expand Down
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Gazebo Math 9.x

### Gazebo Math 9.0.0 (20XX-XX-XX)

## Gazebo Math 8.x

### Gazebo Math 8.0.0 (2024-09-25)
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-math-examples)

# Find the Gazebo Math library
find_package(gz-math8 REQUIRED)
set(GZ_MATH_VER ${gz-math8_VERSION_MAJOR})
find_package(gz-math9 REQUIRED)
set(GZ_MATH_VER ${gz-math9_VERSION_MAJOR})

add_executable(additively_separable_scalar_field3_example additively_separable_scalar_field3_example.cc)
target_link_libraries(additively_separable_scalar_field3_example gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER})
Expand Down
10 changes: 5 additions & 5 deletions examples/angle_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
#

import gz.math8
import gz.math9

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

a1 = gz.math8.Angle(1.5707)
a2 = gz.math8.Angle(0.7854)
a1 = gz.math9.Angle(1.5707)
a2 = gz.math9.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 = gz.math8.Angle(15.707)
a3 = gz.math9.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
2 changes: 1 addition & 1 deletion examples/diff_drive_odometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import datetime
import math

from gz.math8 import Angle, DiffDriveOdometry
from gz.math9 import Angle, DiffDriveOdometry

odom = DiffDriveOdometry()

Expand Down
2 changes: 1 addition & 1 deletion examples/gauss_markov_process_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 gz.math8 import GaussMarkovProcess
from gz.math9 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 gz.math8 import Kmeans, Vector3d
from gz.math9 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 gz.math8 import Rand
from gz.math9 import Rand
import sys

if (len(sys.argv) < 2):
Expand Down
8 changes: 4 additions & 4 deletions examples/vector2_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
#
import gz.math8
import gz.math9

va = gz.math8.Vector2d(1, 2)
vb = gz.math8.Vector2d(3, 4)
vc = gz.math8.Vector2d(vb)
va = gz.math9.Vector2d(1, 2)
vb = gz.math9.Vector2d(3, 4)
vc = gz.math9.Vector2d(vb)

print("va = {} {}\n".format(va.x(), va.y()))
print("vb = {} {}\n".format(vb.x(), vb.y()))
Expand Down
6 changes: 3 additions & 3 deletions examples/vector3_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#
# $ export PYTHONPATH=/usr/lib/python:$PYTHONPATH
#
import gz.math8
import gz.math9

v1 = gz.math8.Vector3d(0, 0, 3)
v1 = gz.math9.Vector3d(0, 0, 3)
print("v1 = {} {} {}\n".format(v1.x(), v1.y(), v1.z()))

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

v3 = v1 + v2
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>gz-math8</name>
<version>8.0.0</version>
<name>gz-math9</name>
<version>9.0.0</version>
<description>Gazebo Math : Math classes and functions for robot applications</description>
<maintainer email="scpeters@openrobotics.org">Steve Peters</maintainer>
<maintainer email="aditya050995@gmail.com">Aditya Pande</maintainer>
Expand Down
2 changes: 1 addition & 1 deletion src/python_pybind11/test/Angle_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import unittest
import math
from gz.math8 import Angle
from gz.math9 import Angle


class TestAngle(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion src/python_pybind11/test/AxisAlignedBox_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import math
import unittest

from gz.math8 import AxisAlignedBox, Helpers, Line3d, Vector3d
from gz.math9 import AxisAlignedBox, Helpers, Line3d, Vector3d


class TestAxisAlignedBox(unittest.TestCase):
Expand Down
18 changes: 9 additions & 9 deletions src/python_pybind11/test/Box_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import unittest

import gz
from gz.math8 import Boxd, MassMatrix3d, Material, Planed, Vector3d
from gz.math9 import Boxd, MassMatrix3d, Material, Planed, Vector3d


class TestBox(unittest.TestCase):
Expand Down Expand Up @@ -46,30 +46,30 @@ def test_constructor(self):
self.assertEqual(box, box2)

# Dimension and mat constructor
box = Boxd(1.0, 2.0, 5.0, Material(gz.math8.MaterialType.WOOD))
box = Boxd(1.0, 2.0, 5.0, Material(gz.math9.MaterialType.WOOD))
self.assertEqual(Vector3d(1.0, 2.0, 5.0), box.size())
self.assertEqual(Material(gz.math8.MaterialType.WOOD), box.material())
self.assertEqual(Material(gz.math9.MaterialType.WOOD), box.material())

box2 = Boxd(1.0, 2.0, 5.0, Material(gz.math8.MaterialType.WOOD))
box2 = Boxd(1.0, 2.0, 5.0, Material(gz.math9.MaterialType.WOOD))
self.assertEqual(box, box2)

# Vector Dimension and mat constructor
box = Boxd(Vector3d(2.2, 2.0, 10.0), Material(gz.math8.MaterialType.WOOD))
box = Boxd(Vector3d(2.2, 2.0, 10.0), Material(gz.math9.MaterialType.WOOD))
self.assertEqual(Vector3d(2.2, 2.0, 10.0), box.size())
self.assertEqual(Material(gz.math8.MaterialType.WOOD), box.material())
self.assertEqual(Material(gz.math9.MaterialType.WOOD), box.material())

box2 = Boxd(Vector3d(2.2, 2.0, 10.0), Material(gz.math8.MaterialType.WOOD))
box2 = Boxd(Vector3d(2.2, 2.0, 10.0), Material(gz.math9.MaterialType.WOOD))
self.assertEqual(box, box2)

def test_mutators(self):
box = Boxd()
box.set_size(100.1, 2.3, 5.6)
box.set_material(Material(gz.math8.MaterialType.PINE))
box.set_material(Material(gz.math9.MaterialType.PINE))

self.assertEqual(100.1, box.size().x())
self.assertEqual(2.3, box.size().y())
self.assertEqual(5.6, box.size().z())
self.assertEqual(Material(gz.math8.MaterialType.PINE), box.material())
self.assertEqual(Material(gz.math9.MaterialType.PINE), box.material())

box.set_size(Vector3d(3.4, 1.2, 0.5))
self.assertEqual(3.4, box.size().x())
Expand Down
12 changes: 6 additions & 6 deletions src/python_pybind11/test/Capsule_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import unittest

import gz
from gz.math8 import Capsuled, Material, MassMatrix3d
from gz.math9 import Capsuled, Material, MassMatrix3d

import math

Expand All @@ -41,14 +41,14 @@ def test_constructor(self):

# Length, radius, mat
capsule = Capsuled(1.0, 2.0,
Material(gz.math8.MaterialType.WOOD));
Material(gz.math9.MaterialType.WOOD));
self.assertEqual(1.0, capsule.length());
self.assertEqual(2.0, capsule.radius());
self.assertEqual(Material(gz.math8.MaterialType.WOOD),
self.assertEqual(Material(gz.math9.MaterialType.WOOD),
capsule.material());

capsule2 = Capsuled(1.0, 2.0,
Material(gz.math8.MaterialType.WOOD));
Material(gz.math9.MaterialType.WOOD));
self.assertEqual(capsule, capsule2);


Expand All @@ -60,11 +60,11 @@ def test_mutators(self):

capsule.set_length(100.1);
capsule.set_radius(.123);
capsule.set_material(Material(gz.math8.MaterialType.PINE));
capsule.set_material(Material(gz.math9.MaterialType.PINE));

self.assertEqual(100.1, capsule.length());
self.assertEqual(.123, capsule.radius());
self.assertEqual(Material(gz.math8.MaterialType.PINE),
self.assertEqual(Material(gz.math9.MaterialType.PINE),
capsule.material());


Expand Down
4 changes: 2 additions & 2 deletions src/python_pybind11/test/Color_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import math
import unittest
from gz.math8 import Color
from gz.math8 import Vector3f
from gz.math9 import Color
from gz.math9 import Vector3f


class TestColor(unittest.TestCase):
Expand Down
12 changes: 6 additions & 6 deletions src/python_pybind11/test/Cone_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import unittest

import gz
from gz.math8 import Coned, MassMatrix3d, Material, Quaterniond
from gz.math9 import Coned, MassMatrix3d, Material, Quaterniond


class TestCone(unittest.TestCase):
Expand Down Expand Up @@ -56,14 +56,14 @@ def test_constructor(self):
self.assertEqual(cone, cone2)

# Length, radius, mat and rot constructor
cone = Coned(1.0, 2.0, Material(gz.math8.MaterialType.WOOD),
cone = Coned(1.0, 2.0, Material(gz.math9.MaterialType.WOOD),
Quaterniond(0.1, 0.2, 0.3))
self.assertEqual(1.0, cone.length())
self.assertEqual(2.0, cone.radius())
self.assertEqual(Quaterniond(0.1, 0.2, 0.3), cone.rotational_offset())
self.assertEqual(Material(gz.math8.MaterialType.WOOD), cone.mat())
self.assertEqual(Material(gz.math9.MaterialType.WOOD), cone.mat())

cone2 = Coned(1.0, 2.0, Material(gz.math8.MaterialType.WOOD),
cone2 = Coned(1.0, 2.0, Material(gz.math9.MaterialType.WOOD),
Quaterniond(0.1, 0.2, 0.3))
self.assertEqual(cone, cone2)

Expand All @@ -77,12 +77,12 @@ def test_mutators(self):
cone.set_length(100.1)
cone.set_radius(.123)
cone.set_rotational_offset(Quaterniond(1.2, 2.3, 3.4))
cone.set_mat(Material(gz.math8.MaterialType.PINE))
cone.set_mat(Material(gz.math9.MaterialType.PINE))

self.assertEqual(100.1, cone.length())
self.assertEqual(.123, cone.radius())
self.assertEqual(Quaterniond(1.2, 2.3, 3.4), cone.rotational_offset())
self.assertEqual(Material(gz.math8.MaterialType.PINE), cone.mat())
self.assertEqual(Material(gz.math9.MaterialType.PINE), cone.mat())

def test_volume_and_density(self):
mass = 1.0
Expand Down
2 changes: 1 addition & 1 deletion src/python_pybind11/test/CoordinateVector3_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import math
import unittest

from gz.math8 import Angle, CoordinateVector3, Vector3d
from gz.math9 import Angle, CoordinateVector3, Vector3d


class TestCoordinateVector3(unittest.TestCase):
Expand Down
12 changes: 6 additions & 6 deletions src/python_pybind11/test/Cylinder_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import unittest

import gz
from gz.math8 import Cylinderd, MassMatrix3d, Material, Quaterniond
from gz.math9 import Cylinderd, MassMatrix3d, Material, Quaterniond


class TestCylinder(unittest.TestCase):
Expand Down Expand Up @@ -54,14 +54,14 @@ def test_constructor(self):
self.assertEqual(cylinder, cylinder2)

# Length, radius, mat and rot constructor
cylinder = Cylinderd(1.0, 2.0, Material(gz.math8.MaterialType.WOOD),
cylinder = Cylinderd(1.0, 2.0, Material(gz.math9.MaterialType.WOOD),
Quaterniond(0.1, 0.2, 0.3))
self.assertEqual(1.0, cylinder.length())
self.assertEqual(2.0, cylinder.radius())
self.assertEqual(Quaterniond(0.1, 0.2, 0.3), cylinder.rotational_offset())
self.assertEqual(Material(gz.math8.MaterialType.WOOD), cylinder.mat())
self.assertEqual(Material(gz.math9.MaterialType.WOOD), cylinder.mat())

cylinder2 = Cylinderd(1.0, 2.0, Material(gz.math8.MaterialType.WOOD),
cylinder2 = Cylinderd(1.0, 2.0, Material(gz.math9.MaterialType.WOOD),
Quaterniond(0.1, 0.2, 0.3))
self.assertEqual(cylinder, cylinder2)

Expand All @@ -75,12 +75,12 @@ def test_mutators(self):
cylinder.set_length(100.1)
cylinder.set_radius(.123)
cylinder.set_rotational_offset(Quaterniond(1.2, 2.3, 3.4))
cylinder.set_mat(Material(gz.math8.MaterialType.PINE))
cylinder.set_mat(Material(gz.math9.MaterialType.PINE))

self.assertEqual(100.1, cylinder.length())
self.assertEqual(.123, cylinder.radius())
self.assertEqual(Quaterniond(1.2, 2.3, 3.4), cylinder.rotational_offset())
self.assertEqual(Material(gz.math8.MaterialType.PINE), cylinder.mat())
self.assertEqual(Material(gz.math9.MaterialType.PINE), cylinder.mat())

def test_volume_and_density(self):
mass = 1.0
Expand Down
2 changes: 1 addition & 1 deletion src/python_pybind11/test/DiffDriveOdometry_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import time
import unittest

from gz.math8 import Angle, DiffDriveOdometry
from gz.math9 import Angle, DiffDriveOdometry


class TestDiffDriveOdometry(unittest.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions src/python_pybind11/test/Ellipsoid_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import unittest

import gz
from gz.math8 import Ellipsoidd, Material, MassMatrix3d, Vector3d
from gz.math9 import Ellipsoidd, Material, MassMatrix3d, Vector3d

import math

Expand All @@ -40,7 +40,7 @@ def test_constructor(self):

# Vector3 of radii and material
expectedRadii = Vector3d(1.0, 2.0, 3.0)
expectedMaterial = Material(gz.math8.MaterialType.WOOD)
expectedMaterial = Material(gz.math9.MaterialType.WOOD)
ellipsoid = Ellipsoidd(expectedRadii, expectedMaterial)
self.assertEqual(expectedRadii, ellipsoid.radii())
self.assertEqual(expectedMaterial, ellipsoid.material())
Expand All @@ -57,7 +57,7 @@ def test_mutators(self):
expectedRadii = Vector3d(1.0, 2.0, 3.0)
ellipsoid.set_radii(expectedRadii)

expectedMaterial = Material(gz.math8.MaterialType.PINE)
expectedMaterial = Material(gz.math9.MaterialType.PINE)
ellipsoid.set_material(expectedMaterial)

self.assertEqual(expectedRadii, ellipsoid.radii())
Expand Down
Loading
Loading