From 97e14e1747e9b77fd65605f7890695309ad08527 Mon Sep 17 00:00:00 2001 From: visose Date: Mon, 6 Jan 2025 14:20:41 +0000 Subject: [PATCH] Fix Doosan exception at initialization --- Directory.Build.props | 2 +- RELEASE | 7 +++++++ src/Robots.Grasshopper/Robots.Grasshopper.csproj | 2 +- src/Robots/Mechanisms/Mechanism.cs | 9 +++++---- src/Robots/RobotArms/RobotDoosan.cs | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e792fd6..711b07d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ Robots - 1.8.0 + 1.9.0 Robots Authors Create and simulate ABB, KUKA, UR, and Staubli robot programs. Robots;ABB;KUKA;UR;Staubli;Robotics diff --git a/RELEASE b/RELEASE index 336a17a..35a5fab 100644 --- a/RELEASE +++ b/RELEASE @@ -1,3 +1,10 @@ +- version: 1.9.0 + changes: + - Added support for Igus robot. + - Changed to use .modx extension on Omnicore controllers. + - Fixed digital output declarations in Staubli. + - Fixed Doosan exception at initialization. + - version: 1.8.0 changes: - Improved Franka Emika inverse kinematics. diff --git a/src/Robots.Grasshopper/Robots.Grasshopper.csproj b/src/Robots.Grasshopper/Robots.Grasshopper.csproj index e5bd05f..6892ed4 100644 --- a/src/Robots.Grasshopper/Robots.Grasshopper.csproj +++ b/src/Robots.Grasshopper/Robots.Grasshopper.csproj @@ -8,7 +8,7 @@ iconRhino128.png $(Description) This package is for development of Rhino and Grasshopper plug-ins. $(PackageTags);Rhino;Grasshopper - 7 + 8 diff --git a/src/Robots/Mechanisms/Mechanism.cs b/src/Robots/Mechanisms/Mechanism.cs index eb372fd..e03e6fa 100644 --- a/src/Robots/Mechanisms/Mechanism.cs +++ b/src/Robots/Mechanisms/Mechanism.cs @@ -28,14 +28,17 @@ internal Mechanism(string model, Manufacturers manufacturer, double payload, Pla BasePlane = basePlane; BaseMesh = baseMesh; MovesRobot = movesRobot; - Joints = InitJoints(joints); + Joints = joints; + InitJoints(); DisplayMesh = CreateDisplayMesh(); SetStartPlanes(); } - Joint[] InitJoints(Joint[] joints) + void InitJoints() { + var joints = Joints; + var alphas = DefaultAlpha ?? new double[joints.Length]; var thetas = DefaultTheta ?? new double[joints.Length]; var signs = DefaultSign ?? Enumerable.Repeat(1, joints.Length).ToArray(); @@ -62,8 +65,6 @@ Joint[] InitJoints(Joint[] joints) range.MakeIncreasing(); joint.Range = range; } - - return joints; } Mesh CreateDisplayMesh() diff --git a/src/Robots/RobotArms/RobotDoosan.cs b/src/Robots/RobotArms/RobotDoosan.cs index f5d9577..bf0f86e 100644 --- a/src/Robots/RobotArms/RobotDoosan.cs +++ b/src/Robots/RobotArms/RobotDoosan.cs @@ -7,7 +7,7 @@ namespace Robots; public class RobotDoosan : RobotArm { internal RobotDoosan(string model, double payload, Plane basePlane, Mesh baseMesh, Joint[] joints) - : base(model, Manufacturers.UR, payload, basePlane, baseMesh, joints) { } + : base(model, Manufacturers.Doosan, payload, basePlane, baseMesh, joints) { } private protected override MechanismKinematics CreateSolver() => new SphericalWristKinematics(this);