public PathPlanningResult Run(Manipulator manipulator, Vector3 goal, InverseKinematicsSolver solver, CancellationToken cancellationToken = default) { var res = new PathPlanningResult(); try { // restart measuring execution time Timer.Restart(); // turn the controller on State = ControllerState.Running; // execute path planning using (var manipulatorCopy = manipulator.DeepCopy()) { res = RunAbstract(manipulatorCopy, goal, solver, cancellationToken); } // turn the controller off State = ControllerState.Idle; } catch (OperationCanceledException oce) { // TODO: provide some log info Reset(); // indicate that the process has been aborted State = ControllerState.Aborted; } finally { // stop measuring execution time Timer.Stop(); } return(res); }