-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
106 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Drawing; | ||
using static System.Math; | ||
|
||
namespace Robots.Grasshopper; | ||
|
||
public class CreateSpeedAccel : GH_Component | ||
{ | ||
public CreateSpeedAccel() : base("Create speed", "Speed", "Creates a target speed.", "Robots", "Components") { } | ||
public override GH_Exposure Exposure => GH_Exposure.tertiary; | ||
public override Guid ComponentGuid => new("2849cac0-4006-4531-a2a3-a37cd7e31031"); | ||
protected override Bitmap Icon => Util.GetIcon("iconSpeed"); | ||
|
||
protected override void RegisterInputParams(GH_InputParamManager pManager) | ||
{ | ||
pManager.AddNumberParameter("Translation", "T", "TCP translation speed (mm/s)", GH_ParamAccess.item, 100.0); | ||
pManager.AddNumberParameter("Rotation", "R", "TCP rotation and swivel speed (rad/s)", GH_ParamAccess.item, PI); | ||
pManager.AddNumberParameter("External translation", "Et", "External axes translation speed (mm/s)", GH_ParamAccess.item, 5000.0); | ||
pManager.AddNumberParameter("External rotation", "Er", "External axes rotation speed (rad/s)", GH_ParamAccess.item, PI * 6); | ||
pManager.AddNumberParameter("Accel translation", "At", "Used only in Doosan and UR (mm/s²)", GH_ParamAccess.item, 2500); | ||
pManager.AddNumberParameter("Accel axis", "Aa", "Used in UR, Doosan and Franka Emika (rads/s²). For Franka, assumes max accel and jerk is 4PI.", GH_ParamAccess.item, 4 * PI); | ||
} | ||
|
||
protected override void RegisterOutputParams(GH_OutputParamManager pManager) | ||
{ | ||
pManager.AddParameter(new SpeedParameter(), "Speed", "S", "Speed instance", GH_ParamAccess.item); | ||
} | ||
|
||
protected override void SolveInstance(IGH_DataAccess DA) | ||
{ | ||
double translationSpeed = 0, rotationSpeed = 0, | ||
translationExternal = 0, rotationExternal = 0, | ||
translationAccel = 0, axisAccel = 0; | ||
|
||
if (!DA.GetData(0, ref translationSpeed)) return; | ||
if (!DA.GetData(1, ref rotationSpeed)) return; | ||
if (!DA.GetData(2, ref translationExternal)) return; | ||
if (!DA.GetData(3, ref rotationExternal)) return; | ||
if (!DA.GetData(4, ref translationAccel)) return; | ||
if (!DA.GetData(5, ref axisAccel)) return; | ||
|
||
Speed speed = new(translationSpeed, rotationSpeed, translationExternal, rotationExternal) | ||
{ | ||
TranslationAccel = translationAccel, | ||
AxisAccel = axisAccel | ||
}; | ||
|
||
DA.SetData(0, speed); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<Project> | ||
|
||
<Target Name="RemoveRobotsReferences" AfterTargets="AfterResolveReferences"> | ||
<ItemGroup> | ||
<ReferenceCopyLocalPaths | ||
Remove="@(ReferenceCopyLocalPaths)" | ||
Condition=" | ||
%(ReferenceCopyLocalPaths.FileName) == 'Robots' | ||
or %(ReferenceCopyLocalPaths.FileName) == 'Robots.Grasshopper'" | ||
/> | ||
</ItemGroup> | ||
</Target> | ||
<Target Name="RemoveRobotsReferences" AfterTargets="AfterResolveReferences"> | ||
<ItemGroup> | ||
<ReferenceCopyLocalPaths | ||
Remove="@(ReferenceCopyLocalPaths)" | ||
Condition=" | ||
%(ReferenceCopyLocalPaths.FileName) == 'Robots' | ||
or %(ReferenceCopyLocalPaths.FileName) == 'Robots.Grasshopper'" | ||
/> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters