Skip to content
This repository was archived by the owner on Dec 19, 2022. It is now read-only.

Commit 156dc78

Browse files
author
Sylvain Bertrand
committed
Merge branch 'release/0.7.0'
2 parents 33ac725 + 8bc88d3 commit 156dc78

File tree

64 files changed

+6148
-1479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+6148
-1479
lines changed

Diff for: build.gradle

+23-24
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ repositories {
88
}
99
}
1010

11-
apply plugin: 'java'
12-
apply plugin: 'maven-publish'
13-
apply plugin: 'com.jfrog.bintray'
11+
apply plugin: "java"
12+
apply plugin: "maven-publish"
13+
apply plugin: "com.jfrog.bintray"
1414

1515
sourceCompatibility = 1.8
16-
version = '0.6.1'
16+
version = "0.7.0"
1717
group = "us.ihmc"
1818

1919
project.ext.fullVersion = version
@@ -39,34 +39,34 @@ jar {
3939
}
4040

4141
task sourceJar(type: Jar, dependsOn: classes) {
42-
classifier = 'sources'
42+
classifier = "sources"
4343
from sourceSets.main.allJava
4444
}
4545

4646
task testJar(type: Jar, dependsOn: [classes, testClasses]) {
47-
classifier = 'test'
47+
classifier = "test"
4848
from sourceSets.test.output
4949
}
5050

5151
// Task to generate javadocs into relevant website directory
5252
task genJavadocs(type: Javadoc, dependsOn: sourceJar) {
5353
source = sourceSets.main.allJava
5454
classpath = configurations.compile
55-
destinationDir = file('websitedocs/website/static/javadocs')
55+
destinationDir = file("websitedocs/website/static/javadocs")
5656
setFailOnError(false)
5757
}
5858

5959
//Ensure the replacestyles.sh script is run before the following task:
6060

6161
// Task to rename the javadocs directory with the version number
6262
task javadocsVersion (dependsOn: genJavadocs) {
63-
file('websitedocs/website/static/javadocs').renameTo(file('websitedocs/website/static/javadocs' + '-' + version))
63+
file("websitedocs/website/static/javadocs").renameTo(file("websitedocs/website/static/javadocs" + "-" + version))
6464
}
6565

6666
//Task to create a new version in docusaurus
6767
task docsVersion (type: Exec, dependsOn: javadocsVersion) {
68-
workingDir 'websitedocs/website'
69-
commandLine 'yarn', 'run', 'version', version
68+
workingDir "websitedocs/website"
69+
commandLine "yarn", "run", "version", version
7070
}
7171

7272
publishing {
@@ -81,25 +81,25 @@ publishing {
8181
asNode().children().last() + {
8282
resolveStrategy = Closure.DELEGATE_FIRST
8383
name project.name
84-
description 'Euclid Core is library providing the common tools useful for geometric applications and vectorial math.'
84+
description "Euclid Core is library providing the common tools useful for geometric applications and vectorial math."
8585
url project.ext.vcsUrl
8686
licenses {
8787
license {
8888
name project.ext.licenseName
8989
url project.ext.licenseURL
90-
distribution 'repo'
90+
distribution "repo"
9191
}
9292
}
9393
developers {
9494
developer {
95-
id 'sbertrand'
96-
name 'Sylvain Bertrand'
97-
95+
id "sbertrand"
96+
name "Sylvain Bertrand"
97+
9898
}
9999
developer {
100-
id 'dcalvert'
101-
name 'Duncan Calvert'
102-
100+
id "dcalvert"
101+
name "Duncan Calvert"
102+
103103
}
104104
}
105105
}
@@ -131,15 +131,15 @@ bintray {
131131
pkg {
132132
repo = "maven-release"
133133
name = project.ext.publicationName
134-
userOrg = 'ihmcrobotics'
134+
userOrg = "ihmcrobotics"
135135
desc = "IHMC Open Robotics Software Project ${project.name}"
136136

137137
websiteUrl = project.ext.vcsUrl
138138
issueTrackerUrl = "${project.ext.vcsUrl}/issues"
139139
vcsUrl = "${project.ext.vcsUrl}.git"
140140

141141
licenses = [project.ext.bintrayLicenseName]
142-
labels = ['ihmc', 'java', 'geometry', 'vector', 'math']
142+
labels = ["ihmc", "java", "geometry", "vector", "math"]
143143
publicDownloadNumbers = true
144144

145145
version {
@@ -159,9 +159,8 @@ repositories {
159159

160160
dependencies {
161161
testCompile group: "junit", name: "junit", version: "4.12"
162-
testCompile group: 'org.pitest', name: 'pitest', version: '1.2.0'
163-
testCompile group: 'org.pitest', name: 'pitest-command-line', version: '1.2.0'
164-
testCompile group: 'us.ihmc', name: 'ihmc-continuous-integration-framework', version: '0.9.4'
162+
testCompile group: "org.pitest", name: "pitest", version: "1.2.0"
163+
testCompile group: "org.pitest", name: "pitest-command-line", version: "1.2.0"
165164

166-
compile group: 'org.ejml', name: 'dense64', version: '0.30'
165+
compile group: "org.ejml", name: "dense64", version: "0.30"
167166
}

Diff for: src/us/ihmc/euclid/axisAngle/AxisAngle.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,10 @@ public final double getAngle()
199199
@Override
200200
public boolean equals(Object object)
201201
{
202-
try
203-
{
204-
return equals((AxisAngle) object);
205-
}
206-
catch (ClassCastException e)
207-
{
202+
if (object instanceof AxisAngleReadOnly)
203+
return equals((AxisAngleReadOnly) object);
204+
else
208205
return false;
209-
}
210206
}
211207

212208
/**

Diff for: src/us/ihmc/euclid/axisAngle/AxisAngle32.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,10 @@ public final float getZ32()
238238
@Override
239239
public boolean equals(Object object)
240240
{
241-
try
242-
{
241+
if (object instanceof AxisAngleReadOnly)
243242
return equals((AxisAngleReadOnly) object);
244-
}
245-
catch (ClassCastException e)
246-
{
243+
else
247244
return false;
248-
}
249245
}
250246

251247
/**

Diff for: src/us/ihmc/euclid/axisAngle/interfaces/AxisAngleReadOnly.java

+12-7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import us.ihmc.euclid.tuple4D.interfaces.QuaternionBasics;
1717
import us.ihmc.euclid.tuple4D.interfaces.Vector4DBasics;
1818
import us.ihmc.euclid.tuple4D.interfaces.Vector4DReadOnly;
19+
import us.ihmc.euclid.yawPitchRoll.interfaces.YawPitchRollBasics;
1920

2021
/**
2122
* Read-only interface for an axis-angle object.
@@ -181,6 +182,13 @@ default void get(QuaternionBasics quaternionToPack)
181182
quaternionToPack.setAxisAngle(getX(), getY(), getZ(), getAngle());
182183
}
183184

185+
/** {@inheritDoc} */
186+
@Override
187+
default void get(YawPitchRollBasics yawPitchRollToPack)
188+
{
189+
yawPitchRollToPack.setAxisAngle(getX(), getY(), getZ(), getAngle());
190+
}
191+
184192
/** {@inheritDoc} */
185193
@Override
186194
default void getRotationVector(Vector3DBasics rotationVectorToPack)
@@ -189,6 +197,7 @@ default void getRotationVector(Vector3DBasics rotationVectorToPack)
189197
}
190198

191199
/** {@inheritDoc} */
200+
@Deprecated
192201
@Override
193202
default void getYawPitchRoll(double[] yawPitchRollToPack)
194203
{
@@ -405,14 +414,10 @@ default void inverseTransform(Matrix3DReadOnly matrixOriginal, Matrix3DBasics ma
405414
*/
406415
default boolean equals(AxisAngleReadOnly other)
407416
{
408-
try
409-
{
410-
return getX() == other.getX() && getY() == other.getY() && getZ() == other.getZ() && getAngle() == other.getAngle();
411-
}
412-
catch (NullPointerException e)
413-
{
417+
if (other == null)
414418
return false;
415-
}
419+
else
420+
return getX() == other.getX() && getY() == other.getY() && getZ() == other.getZ() && getAngle() == other.getAngle();
416421
}
417422

418423
/**

Diff for: src/us/ihmc/euclid/matrix/Matrix3D.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,10 @@ public double getM22()
231231
@Override
232232
public boolean equals(Object object)
233233
{
234-
try
235-
{
234+
if (object instanceof Matrix3DReadOnly)
236235
return equals((Matrix3DReadOnly) object);
237-
}
238-
catch (ClassCastException e)
239-
{
236+
else
240237
return false;
241-
}
242238
}
243239

244240
/**

Diff for: src/us/ihmc/euclid/matrix/RotationMatrix.java

+39-33
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,12 @@ public RotationMatrix(Orientation3DReadOnly orientation)
151151
* Creates a new rotation matrix representing the same orientation as the given rotation vector
152152
* {@code rotationVector}.
153153
* <p>
154-
* WARNING: a rotation vector is different from a yaw-pitch-roll or Euler angles representation.
155-
* A rotation vector is equivalent to the axis of an axis-angle that is multiplied by the angle
156-
* of the same axis-angle.
154+
* WARNING: a rotation vector is different from a yaw-pitch-roll or Euler angles representation. A
155+
* rotation vector is equivalent to the axis of an axis-angle that is multiplied by the angle of the
156+
* same axis-angle.
157157
* </p>
158158
*
159-
* @param rotationVector the rotation vector used to initialize this rotation matrix. Not
160-
* modified.
159+
* @param rotationVector the rotation vector used to initialize this rotation matrix. Not modified.
161160
*/
162161
public RotationMatrix(Vector3DReadOnly rotationVector)
163162
{
@@ -173,6 +172,18 @@ public void setToZero()
173172
setIdentity();
174173
}
175174

175+
/**
176+
* {@inheritDoc}
177+
* <p>
178+
* Note that this rotation matrix becomes invalid and has to be updated before being usable again.
179+
* </p>
180+
*/
181+
@Override
182+
public void setToNaN()
183+
{
184+
setUnsafe(Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN);
185+
}
186+
176187
/**
177188
* Orthonormalization of the rotation matrix using the
178189
* <a href="https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process"> Gram-Schmidt method</a>.
@@ -369,8 +380,7 @@ public void set(Orientation3DReadOnly orientation3DReadOnly)
369380
}
370381

371382
/**
372-
* Sets this rotation matrix to equal the 3D matrix {@code matrix} and then normalizes
373-
* {@code this}.
383+
* Sets this rotation matrix to equal the 3D matrix {@code matrix} and then normalizes {@code this}.
374384
*
375385
* @param matrix the matrix to copy the values from. Not modified.
376386
* @throws NotARotationMatrixException if the normalization failed.
@@ -485,8 +495,8 @@ public void setRotationMatrix(double m00, double m01, double m02, double m10, do
485495
}
486496

487497
/**
488-
* Sets this rotation matrix to represent a counter clockwise rotation around the z-axis of an
489-
* angle {@code yaw}.
498+
* Sets this rotation matrix to represent a counter clockwise rotation around the z-axis of an angle
499+
* {@code yaw}.
490500
*
491501
* <pre>
492502
* / cos(yaw) -sin(yaw) 0 \
@@ -502,8 +512,8 @@ public void setToYawMatrix(double yaw)
502512
}
503513

504514
/**
505-
* Sets this rotation matrix to represent a counter clockwise rotation around the y-axis of an
506-
* angle {@code pitch}.
515+
* Sets this rotation matrix to represent a counter clockwise rotation around the y-axis of an angle
516+
* {@code pitch}.
507517
*
508518
* <pre>
509519
* / cos(pitch) 0 sin(pitch) \
@@ -519,8 +529,8 @@ public void setToPitchMatrix(double pitch)
519529
}
520530

521531
/**
522-
* Sets this rotation matrix to represent a counter clockwise rotation around the x-axis of an
523-
* angle {@code roll}.
532+
* Sets this rotation matrix to represent a counter clockwise rotation around the x-axis of an angle
533+
* {@code roll}.
524534
*
525535
* <pre>
526536
* / 1 0 0 \
@@ -791,9 +801,9 @@ public void prependRollRotation(double roll)
791801
* </p>
792802
*
793803
* @param rf the other rotation matrix used for the interpolation. Not modified.
794-
* @param alpha the percentage used for the interpolation. A value of 0 will result in not
795-
* modifying this rotation matrix, while a value of 1 is equivalent to setting this
796-
* rotation matrix to {@code rf}.
804+
* @param alpha the percentage used for the interpolation. A value of 0 will result in not modifying
805+
* this rotation matrix, while a value of 1 is equivalent to setting this rotation matrix
806+
* to {@code rf}.
797807
*/
798808
public void interpolate(RotationMatrixReadOnly rf, double alpha)
799809
{
@@ -826,8 +836,8 @@ public void interpolate(RotationMatrixReadOnly r0, RotationMatrixReadOnly rf, do
826836
* {@code transform}.
827837
* </p>
828838
* <p>
829-
* Note: the transformation of a {@code RotationMatrix} strongly differs from the transformation
830-
* of a {@link Matrix3DBasics}.
839+
* Note: the transformation of a {@code RotationMatrix} strongly differs from the transformation of
840+
* a {@link Matrix3DBasics}.
831841
* </p>
832842
*/
833843
@Override
@@ -839,12 +849,12 @@ public void applyTransform(Transform transform)
839849
/**
840850
* {@inheritDoc}
841851
* <p>
842-
* this = R<sup>T</sup> * this where 'R' is the 3-by-3 matrix representing the rotation part of
843-
* the {@code transform}.
852+
* this = R<sup>T</sup> * this where 'R' is the 3-by-3 matrix representing the rotation part of the
853+
* {@code transform}.
844854
* </p>
845855
* <p>
846-
* Note: the transformation of a {@code RotationMatrix} strongly differs from the transformation
847-
* of a {@link Matrix3DBasics}.
856+
* Note: the transformation of a {@code RotationMatrix} strongly differs from the transformation of
857+
* a {@link Matrix3DBasics}.
848858
* </p>
849859
*/
850860
@Override
@@ -917,24 +927,20 @@ public double getM22()
917927
}
918928

919929
/**
920-
* Tests if the given {@code object}'s class is the same as this, in which case the method
921-
* returns {@link #equals(Matrix3DReadOnly)}, it returns {@code false} otherwise or if the
922-
* {@code object} is {@code null}.
930+
* Tests if the given {@code object}'s class is the same as this, in which case the method returns
931+
* {@link #equals(Matrix3DReadOnly)}, it returns {@code false} otherwise or if the {@code object} is
932+
* {@code null}.
923933
*
924934
* @param object the object to compare against this. Not modified.
925935
* @return {@code true} if {@code object} and this are exactly equal, {@code false} otherwise.
926936
*/
927937
@Override
928938
public boolean equals(Object object)
929939
{
930-
try
931-
{
940+
if (object instanceof Matrix3DReadOnly)
932941
return equals((Matrix3DReadOnly) object);
933-
}
934-
catch (ClassCastException e)
935-
{
942+
else
936943
return false;
937-
}
938944
}
939945

940946
/**
@@ -954,8 +960,8 @@ public boolean epsilonEquals(RotationMatrix other, double epsilon)
954960
/**
955961
* Tests if {@code this} and {@code other} represent the same orientation to an {@code epsilon}.
956962
* <p>
957-
* Two rotation matrices are considered geometrically equal if the magnitude of their difference
958-
* is less than or equal to {@code epsilon}.
963+
* Two rotation matrices are considered geometrically equal if the magnitude of their difference is
964+
* less than or equal to {@code epsilon}.
959965
* </p>
960966
* <p>
961967
* Note that {@code this.geometricallyEquals(other, epsilon) == true} does not necessarily imply

0 commit comments

Comments
 (0)