/// <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; }
private static void RosClient_OnRosMasterConnected(object sender, EventArgs e) { lock (gate) { motionService = new MotionService(rosClient.GlobalNodeHandle); } }
/// <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; }
private static void RosClient_OnRosMasterDisconnected(object sender, EventArgs e) { lock (gate) { motionService?.Dispose(); motionService = null; } }
private void Shutdown() { lock (gate) { this.motionService?.Dispose(); this.motionService = null; this.wsgStatusClient?.Dispose(); this.wsgStatusClient = null; this.wsgSetAccelerationClient?.Dispose(); this.wsgSetAccelerationClient = null; } }
/// <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); }
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; } } }
public MotionsController(IMotionService motionService) : base(motionService) { }
public MotionController(IMotionService motionService) { _motionService = motionService; }
public MotionApiController(IMotionService moveService) { _moveService = moveService; }
public MotionController(IMotionService service) { _service = service; }