void Start()
 {
     rosConnector         = GetComponent <RosConnector>();
     bodyPoseActionClient = new BodyPoseActionClient(actionName, rosConnector.RosSocket);
     bodyPoseActionClient.Initialize();
 }
Пример #2
0
 private RosConnectorHandlerSingleton()
 {
     this.connector = new RosConnector();
 }
Пример #3
0
 protected virtual void Start(string topic, ref RosConnector connector)
 {
     Topic         = topic;
     rosConnector  = connector;
     publicationId = rosConnector.RosSocket.Advertise <T>(Topic);
 }
Пример #4
0
    //private UnityFibonacciActionClient UnityFibonacciActionClient;


    public void Awake()
    {
        UrdfRobot = GetComponents <UrdfRobot>()[0];
        // gameObject.AddComponent<Status2Text>();
        switch (TypeOfKSMP)
        {
        case KSMPs.ROS:
            //gameObject.AddComponent<RosConnector>();
            //gameObject.AddComponent<PoseArrayPublisher>();
            // If it does not exist
            if (GameObject.Find("RosConnector") == null)
            {
                RosConnectorObj = new GameObject("RosConnector");
            }
            else
            {
                RosConnectorObj = GameObject.Find("RosConnector");
            }


            if (!planRobot)
            {
                RosConnector = RosConnectorObj.AddComponent <RosConnector>();
                gameObject.AddComponent <PoseArrayPublisher>();
            }
            RosConnector = RosConnectorObj.GetComponent <RosConnector>();
            RosConnector.RosBridgeServerUrl = NetworkMasterIP;
            switch (TypeOfEntity)
            {
            case EntityType.manipulator:
                gameObject.AddComponent <JointStatePatcher>();
                JointPatcher           = gameObject.GetComponent <JointStatePatcher>();
                JointPatcher.UrdfRobot = UrdfRobot;
                JointPatcher.SetSubscribeJointStates(true);
                if (!planRobot)
                {
                    JointStateSubscriber       = gameObject.GetComponent <JointStateSubscriber>();
                    JointStateSubscriber.Topic = Topic;

                    gameObject.AddComponent <ExecuteTrajFeedbackSub>();
                    gameObject.AddComponent <TrajectorySub>();
                }
                else
                {
                    gameObject.AddComponent <DisplayTrajectorySub>();
                }

                /*****************************
                * Testing: uncomment JointState Subscri and delete DisplatT
                * ***************************/
                //gameObject.AddComponent<DisplayTrajectorySub>();

                break;

            case EntityType.AGV:
                // To be implemented
                break;

            case EntityType.drone:
                // To be implemented
                break;

            case EntityType.sensor:
                // To be implemented
                break;

            default:
                // To be implemented
                break;
            }
            break;

        case KSMPs.None:
            // To be implemented
            break;

        default:
            // To be implemented
            break;
        }
    }
 private void Start()
 {
     rosConnector          = GetComponent <RosConnector>();
     fibonacciActionClient = new FibonacciActionClient(actionName, rosConnector.RosSocket);
     fibonacciActionClient.Initialize();
 }