Example #1
0
 public ServiceReceiver(RosSocket rosSocket, string service, Tin parameter, object handlerParameter)
 {
     Service          = service;
     ServiceParameter = parameter;
     HandlerParameter = handlerParameter;
     rosSocket.CallService <Tin, Tout>(Service, Receive, ServiceParameter);
 }
Example #2
0
 public ServiceReceiver(RosSocket rosSocket, string service, object parameter, object handlerParameter, Type responseType)
 {
     ServiceName = service;
     ServiceParameter = parameter;
     HandlerParameter = handlerParameter;
     rosSocket.CallService(ServiceName, responseType, receive, ServiceParameter);
 }
        public void sendPTPCommand(MessageTypes.Dobot.SetPTPCmdRequest request)
        {
            RosSocket rosSocket = this.rosConnector.RosSocket;

            markerHandler.clearMarkers();
            Debug.Log($"SendPTPCommand({request.ptpMode},{request.x},{request.y},{request.z},{request.r},{request.isQueued})");
            rosSocket.CallService <MessageTypes.Dobot.SetPTPCmdRequest, MessageTypes.Dobot.SetPTPCmdResponse>(serviceName, responseHandler, request);
        }
Example #4
0
        public bool Import(int maxTimeOut = int.MaxValue)
        {
            rosSocket.CallService("/rosapi/get_param", typeof(ParamValueString), receiveRobotName, new ParamName("/robot/name"));
            ServiceReceiver robotDescriptionReceiver = new ServiceReceiver(rosSocket, "/rosapi/get_param", new ParamName("/robot_description"), "\\robot_description.urdf", typeof(ParamValueString));

            robotDescriptionReceiver.ReceiveEventHandler += receiveRobotDescription;

            return(WaitHandle.WaitAll(Status.Values.ToArray(), maxTimeOut));
        }
Example #5
0
        public void moveRail(int x)
        {
            //MessageTypes.Dobot.SetPTPLParamsRequest request=new MessageTypes.Dobot.SetPTPLParamsRequest(0.5f,0.5f,false);



            MessageTypes.Dobot.SetPTPWithLCmdRequest request = new MessageTypes.Dobot.SetPTPWithLCmdRequest(1, 217, 25, 175, 22, x, false);
            RosSocket.CallService <MessageTypes.Dobot.SetPTPWithLCmdRequest, MessageTypes.Dobot.SetPTPWithLCmdResponse>
                (ServiceEndpoint, handlerSetPTPWithLCmd, request);
        }
Example #6
0
 public void GetCurrentParams()
 {
     RosSocket.CallService <MessageTypes.Gazebo.
                            GetPhysicsPropertiesRequest, MessageTypes.Gazebo.
                            GetPhysicsPropertiesResponse>("/gazebo/get_physics_properties", physiscsCallback,
                                                          new MessageTypes.Gazebo.GetPhysicsPropertiesRequest());
     // end here as the response and the actual update will be ahandled by the callback
 }
Example #7
0
        public bool Import(int maxTimeOut = int.MaxValue)
        {
            rosSocket.CallService <rosapi.GetParamRequest, rosapi.GetParamResponse>("/rosapi/get_param",
                                                                                    ReceiveRobotName,
                                                                                    new rosapi.GetParamRequest("/robot/name", "default"));

            var robotDescriptionReceiver = new ServiceReceiver <rosapi.GetParamRequest, rosapi.GetParamResponse>(rosSocket, "/rosapi/get_param",
                                                                                                                 new rosapi.GetParamRequest("/robot_description", "default"),
                                                                                                                 Path.DirectorySeparatorChar + "robot_description.urdf");

            robotDescriptionReceiver.ReceiveEventHandler += ReceiveRobotDescription;

            return(WaitHandle.WaitAll(Status.Values.ToArray(), maxTimeOut));
        }
Example #8
0
 public void CallServiceCloseHand(bool hand)
 {
     RosSocket.CallService <HandsControlRequest, HandsControlResponse>("nao_hands_control/close_hand", ServiceCallHandler, new HandsControlRequest(hand));
 }