示例#1
0
 /// <summary>
 /// Creates an <c>EndEffector</c> instance
 /// </summary>
 /// <param name="moveGroup">Instance of move group where the endeffector belongs to</param>
 /// <param name="endEffectorName">Name of the end effector</param>
 /// <param name="endEffectorLinkName">Name of the end effector link</param>
 public EndEffector(IMoveGroup moveGroup, string endEffectorName, string endEffectorLinkName)
 {
     this.moveGroup     = moveGroup;
     this.name          = endEffectorName;
     this.linkName      = endEffectorLinkName;
     this.motionService = moveGroup.MotionService;
 }
示例#2
0
        private async static Task HandleStepwiseMotions(ISteppedMotionClient client, IMoveGroup group)
        {
            string channelName = "MotionDialog";
            string topic       = "SteppedMotions";
            string disposition = "SteppedMotion";

            using (var RosRoboChatClient = new RosRoboChatActionClient(rosClient.GlobalNodeHandle))
            {
                RosRoboChatClient.CreateChat(channelName, topic);
                var messageBody = new SteppedMotionMessage {
                    GoalId = client.GoalId, Progress = 0, MoveGroupName = group.Name
                }.ToString();
                string messageId = RosRoboChatClient.CallMessageCommand(channelName, "add", messageBody, null, new string[] { disposition });
                try
                {
                    var cancelReport = new CancellationTokenSource();
                    xamlamoveit.StepwiseMoveJResult result;
                    var updateProgressTask = UpdateProgress(client, RosRoboChatClient, channelName, messageId, disposition, group.Name, cancelReport.Token);
                    try
                    {
                        result = await client.GoalTask;
                    }
                    finally
                    {
                        cancelReport.Cancel();
                        await updateProgressTask.WhenCompleted();
                    }

                    if (result.result < 0)
                    {
                        throw new Exception($"SteppedMotion was not finished: { result.result }");
                    }
                }
                finally
                {
                    RosRoboChatClient.CallMessageCommand(channelName, "remove", null, messageId, new string[] { disposition });
                }
            }
        }
示例#3
0
 public Plan(IMoveGroup moveGroup, IJointTrajectory trajectory, PlanParameters parameters)
 {
     this.MoveGroup  = moveGroup;
     this.Trajectory = trajectory;
     this.Parameters = parameters;
 }