Skip to content

Commit

Permalink
Switching nuget mathnet (#61)
Browse files Browse the repository at this point in the history
* Removing downloaded MathNet library.

* Removing downloaded MathNet library and replacing with Nuget package

* Updating installer ini file

* Adding installer
  • Loading branch information
brawner committed Mar 7, 2019
1 parent 2c42e95 commit fb87c18
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 30 deletions.
3 changes: 3 additions & 0 deletions INSTALL/Install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
AppId={{E43E85A9-071D-430A-91B2-84B7AB923170}
AppName={#MyAppName}
AppVersion={#CommitVersion}
VersionInfoVersion={#BuildVersion}
VersionInfoCopyright=2019
VersionInfoProductName={#MyAppName}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
Expand Down
Binary file modified INSTALL/Output/sw2urdfSetup.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion SW2URDF/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ THE SOFTWARE.
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.4.*")]
[assembly: AssemblyVersion("1.5.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
Expand Down
5 changes: 2 additions & 3 deletions SW2URDF/SW2URDF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,8 @@
<Reference Include="log4net">
<HintPath>lib\log4net.dll</HintPath>
</Reference>
<Reference Include="MathNet.Numerics, Version=2011.4.17.0, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>MathNet.Numerics\lib\Net40\MathNet.Numerics.dll</HintPath>
<Reference Include="MathNet.Numerics, Version=4.7.0.0, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
<HintPath>..\packages\MathNet.Numerics.Signed.4.7.0\lib\net40\MathNet.Numerics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
Expand Down
1 change: 0 additions & 1 deletion SW2URDF/Test/SW2URDFTest.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using System.IO;
using System.Reflection;
using Xunit;

namespace SW2URDF.Test
Expand Down
1 change: 0 additions & 1 deletion SW2URDF/Test/TestCommon.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using SolidWorks.Interop.sldworks;
using SW2URDF.URDF;
using SW2URDF.URDFExport;
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
Expand Down
14 changes: 7 additions & 7 deletions SW2URDF/Test/TestMathOps.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Numerics.LinearAlgebra.Generic;
using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double;
using SolidWorks.Interop.sldworks;
using SW2URDF.Utilities;
using System;
Expand Down Expand Up @@ -270,7 +270,7 @@ public void TestGetRPYMathTransform(double[] matrixData, double[] expected)
new double[] { 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 })]
public void TestGetRotation(double[] rpy, double[] expected)
{
double[] result = MathOps.GetRotation(rpy).ToColumnWiseArray();
double[] result = MathOps.GetRotation(rpy).AsColumnMajorArray();
for (int i = 0; i < expected.Length; i++)
{
Assert.Equal(expected[i], result[i], 10);
Expand All @@ -284,7 +284,7 @@ public void TestGetRotation(double[] rpy, double[] expected)
new double[] { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1 })]
public void TestGetTranslation(double[] xyz, double[] expected)
{
double[] result = MathOps.GetTranslation(xyz).ToColumnWiseArray();
double[] result = MathOps.GetTranslation(xyz).AsColumnMajorArray();
for (int i = 0; i < expected.Length; i++)
{
Assert.Equal(expected[i], result[i], 10);
Expand Down Expand Up @@ -314,7 +314,7 @@ public void TestGetTranslation(double[] xyz, double[] expected)
new double[] { 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 })]
public void TestGetTransformationFromXYZRPY(double[] xyz, double[] rpy, double[] expected)
{
double[] result = MathOps.GetTransformation(xyz, rpy).ToColumnWiseArray();
double[] result = MathOps.GetTransformation(xyz, rpy).AsColumnMajorArray();
for (int i = 0; i < expected.Length; i++)
{
Assert.Equal(expected[i], result[i], 10);
Expand Down Expand Up @@ -347,7 +347,7 @@ public void TestGetRotationMatrixFromMathTransform(double[] mathTransformData, d
MathUtility util = SwApp.GetMathUtility();
MathTransform transform = util.CreateTransform((object)mathTransformData);

double[] result = MathOps.GetRotationMatrix(transform).ToColumnWiseArray();
double[] result = MathOps.GetRotationMatrix(transform).AsColumnMajorArray();
for (int i = 0; i < expected.Length; i++)
{
Assert.Equal(expected[i], result[i]);
Expand All @@ -374,7 +374,7 @@ public void TestGetTransformationFromMathTransform(double[] matrixData, double[]
{
MathUtility util = SwApp.GetMathUtility();
MathTransform transform = util.CreateTransform((object)matrixData);
double[] result = MathOps.GetTransformation(transform).ToColumnWiseArray();
double[] result = MathOps.GetTransformation(transform).AsColumnMajorArray();
for (int i = 0; i < expected.Length; i++)
{
Assert.Equal(expected[i], result[i]);
Expand Down
8 changes: 1 addition & 7 deletions SW2URDF/Test/TestURDFMerge.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SW2URDF.Test
namespace SW2URDF.Test
{
/// <summary>
/// TODO(SIMINT-164) Implement tests covering public methods below
Expand Down
2 changes: 1 addition & 1 deletion SW2URDF/URDFExport/ExportHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

using MathNet.Numerics.LinearAlgebra.Generic;
using MathNet.Numerics.LinearAlgebra;
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using SW2URDF.ROS;
Expand Down
6 changes: 3 additions & 3 deletions SW2URDF/URDFExport/ExportHelperExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Numerics.LinearAlgebra.Generic;
using SolidWorks.Interop.sldworks;
using SolidWorks.Interop.swconst;
using SW2URDF.URDF;
Expand Down Expand Up @@ -144,7 +144,7 @@ private void LocalizeLink(Link Link, Matrix<double> GlobalTransform)

// Wait are you saying that even though the matrix was trasposed from column major
// order, you are writing it in row-major order here. Yes, yes I am.
double[] moment = linkLocalMomentInertia.ToRowWiseArray();
double[] moment = linkLocalMomentInertia.AsRowMajorArray();
Link.Inertial.Inertia.SetMomentMatrix(moment);

Link.Collision.Origin.SetXYZ(MathOps.GetXYZ(localCollisionTransform));
Expand Down Expand Up @@ -702,7 +702,7 @@ private object[] AddSketchGeometry(Origin Origin)

//Calculate the lines that need to be drawn
Matrix<double> transform = MathOps.GetRotation(Origin.GetRPY());
Matrix<double> Axes = 0.01 * DenseMatrix.Identity(4);
Matrix<double> Axes = 0.01 * DenseMatrix.CreateIdentity(4);
Matrix<double> tA = transform * Axes;

// origin at X, Y, Z
Expand Down
12 changes: 6 additions & 6 deletions SW2URDF/Utilities/MathOPS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

using MathNet.Numerics.LinearAlgebra;
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Numerics.LinearAlgebra.Generic;
using SolidWorks.Interop.sldworks;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -184,9 +184,9 @@ public static double[] GetRPY(MathTransform transform)

public static Matrix<double> GetRotation(double[] RPY)
{
Matrix<double> RX = DenseMatrix.Identity(4);
Matrix<double> RY = DenseMatrix.Identity(4);
Matrix<double> RZ = DenseMatrix.Identity(4);
Matrix<double> RX = DenseMatrix.CreateIdentity(4);
Matrix<double> RY = DenseMatrix.CreateIdentity(4);
Matrix<double> RZ = DenseMatrix.CreateIdentity(4);

RX[1, 1] = Math.Cos(RPY[0]);
RX[1, 2] = -Math.Sin(RPY[0]);
Expand All @@ -208,7 +208,7 @@ public static Matrix<double> GetRotation(double[] RPY)

public static Matrix<double> GetTranslation(double[] XYZ)
{
Matrix<double> m = DenseMatrix.Identity(4);
Matrix<double> m = DenseMatrix.CreateIdentity(4);
m[0, 3] = XYZ[0]; m[1, 3] = XYZ[1]; m[2, 3] = XYZ[2];
return m;
}
Expand All @@ -222,7 +222,7 @@ public static Matrix<double> GetTransformation(double[] XYZ, double[] RPY)

public static Matrix GetRotationMatrix(MathTransform transform)
{
var rot = new DenseMatrix(3);
Matrix rot = new DenseMatrix(3);
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
Expand Down
2 changes: 2 additions & 0 deletions SW2URDF/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<packages>
<package id="Castle.Core" version="4.3.1" targetFramework="net452" />
<package id="CsvHelper" version="7.1.1" targetFramework="net45" />
<package id="MathNet.Numerics" version="4.7.0" targetFramework="net452" />
<package id="MathNet.Numerics.Signed" version="4.7.0" targetFramework="net452" />
<package id="Microsoft.VisualStudio.TestPlatform" version="14.0.0.0" targetFramework="net452" />
<package id="Moq" version="4.10.1" targetFramework="net452" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.0" targetFramework="net452" />
Expand Down

0 comments on commit fb87c18

Please sign in to comment.