So when digging around I found this handy looking dll...
SmartHMI\CalcMeasurement.dll
which when imported into VS has all kinds of interesting methods in it. Basically I wanted a method to calculate the best fit tool XYZ given flange positions. And there it was, public with quite clear arguments.
public double Calc3DToolBy4FlangeFrames(FrameWrapper[] flangeFrame, PointWrapper Tool3D);
My code compiles and runs but I get an "argument out of range" inside the calculating method, which of course I can't debug further. The inputs seem correct, as I can call methods on them and get data out. I haven't tried any of the other functions.
My guess is I am missing a dependency(I am no expert but I would expect a different exception in that case). Note I am not running this on the controller, just in a standalone context.
Here is the code, nothing special...
using CalcMeasurement;
public static Frame PlanesToTCP6(Plane[] planes)
{
IEnumerable<Frame> frames = planes.Select(o => PlaneToFrame(o));
//Frame is just a struct XYZABC, similar to kuka
IEnumerable<CFrameWrapper> cFrames = frames.Select(o => new CFrameWrapper(o.ToDoubles()));
//the rest of these are types provided in the dll
FrameWrapper[] frameWrappers = cFrames.Select(o => o.GetFrameWrapper()).ToArray();
PointWrapper tcpXYZ = new PointWrapper();
GlobalFuncs myFuncs = new GlobalFuncs();
double error = myFuncs.Calc3DToolBy4FlangeFrames(frameWrappers, tcpXYZ);<--ARGUMENT OUT OF RANGE IN THIS METHOD.
return new Frame(tcpXYZ.GetX(), tcpXYZ.GetY(), tcpXYZ.GetZ());
}