コード例 #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 static void RosClient_OnRosMasterConnected(object sender, EventArgs e)
 {
     lock (gate)
     {
         motionService = new MotionService(rosClient.GlobalNodeHandle);
     }
 }
コード例 #3
0
 /// <summary>
 /// Creates a <c>MoveGroup</c> for manually specified joint set. Since the mapping between ROS move-groups
 /// and the specified joint set is not know nor analysed it is not possible to execute end-effector
 /// related functions (e.g. inverse kinematics).
 /// </summary>
 /// <param name="motionService">An object implementing <c>IMotionService</c> which is used to communicate with the motion server.</param>
 /// <param name="jointSet">A joint set</param>
 /// <exception cref="ArgumentNullException">Thrown when <paramref name="motionService"/> is null.</exception>
 public MoveGroup(IMotionService motionService, JointSet jointSet)
 {
     this.motionService         = motionService ?? throw new ArgumentNullException(nameof(motionService));
     this.jointSet              = jointSet;
     this.defaultPlanParameters = motionService.CreatePlanParameters(null, this.jointSet, null, null, 0.05, false, 1);
     this.velocityScaling       = 1;
     this.name = this.defaultPlanParameters.MoveGroupName;
 }
コード例 #4
0
 private static void RosClient_OnRosMasterDisconnected(object sender, EventArgs e)
 {
     lock (gate)
     {
         motionService?.Dispose();
         motionService = null;
     }
 }
コード例 #5
0
 private void Shutdown()
 {
     lock (gate)
     {
         this.motionService?.Dispose();
         this.motionService = null;
         this.wsgStatusClient?.Dispose();
         this.wsgStatusClient = null;
         this.wsgSetAccelerationClient?.Dispose();
         this.wsgSetAccelerationClient = null;
     }
 }
コード例 #6
0
        /// <summary>
        /// Create a instance of <c>MoveGroup</c>
        /// </summary>
        /// <param name="motionService">An object implementing <c>IMotionService</c> which is used to communicate with the motion server.</param>
        /// <param name="moveGroupName">The name of the move group represented by this instance</param>
        /// <param name="defaultEndEffectorName">Name of the default end effector</param>
        /// <exception cref="Exception">Thrown when current name does not exist.  </exception>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="motionService"/> is null.</exception>
        public MoveGroup(IMotionService motionService, string moveGroupName = null, string defaultEndEffectorName = null)
        {
            this.motionService = motionService ?? throw new ArgumentNullException(nameof(motionService));

            var groups       = motionService.QueryAvailableMoveGroups();
            var groupDetails = groups.ToDictionary(x => x.Name, x => x);

            this.name = moveGroupName ?? groups.First().Name;

            if (!groupDetails.TryGetValue(this.name, out this.details))
            {
                throw new Exception($"Move group with name '{this.name}' not found.");
            }

            this.jointSet = this.details.JointSet;
            this.defaultPlanParameters = motionService.CreatePlanParameters(this.name, this.jointSet, null, null, 0.05, false, 1);
            this.velocityScaling       = 1;
            this.SetDefaultEndEffector(defaultEndEffectorName, groups);
        }
コード例 #7
0
        private void Initialize()
        {
            lock (gate)
            {
                Shutdown();

                try
                {
                    var nodeHandle = rosClient.GlobalNodeHandle;
                    this.motionService            = new MotionService(nodeHandle);
                    this.wsgStatusClient          = nodeHandle.ServiceClient <wsg_50.GetGripperStatus>(properties.StatusService, true);
                    this.wsgSetAccelerationClient = nodeHandle.ServiceClient <wsg_50.SetValue>(properties.SetAccelerationService, true);
                }
                catch
                {
                    Shutdown();
                    throw;
                }
            }
        }
コード例 #8
0
 public MotionsController(IMotionService motionService)
     : base(motionService)
 {
 }
コード例 #9
0
 public MotionController(IMotionService motionService)
 {
     _motionService = motionService;
 }
コード例 #10
0
 public MotionApiController(IMotionService moveService)
 {
     _moveService = moveService;
 }
コード例 #11
0
 public MotionController(IMotionService service)
 {
     _service = service;
 }