Esempio n. 1
0
        public void Start()
        {
            cancelPublicationID = socket.Advertise <GoalID>(actionName + "/cancel");
            goalPublicationID   = socket.Advertise <TActionGoal>(actionName + "/goal");

            socket.Subscribe <GoalStatusArray>(actionName + "/status", StatusCallback, (int)(timeStep * 1000));
            socket.Subscribe <TActionFeedback>(actionName + "/feedback", FeedbackCallback, (int)(timeStep * 1000));
            socket.Subscribe <TActionResult>(actionName + "/result", ResultCallback, (int)(timeStep * 1000));
        }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     rosSocket = GetComponent <RosConnector>().RosSocket;
     Debug.Log("PLANTOPIC: " + PlanTopic);
     planPublicationId    = rosSocket.Advertise(PlanTopic, "ros_reality_bridge_msgs/MoveitTarget");
     executePublicationId = rosSocket.Advertise(ExecuteTopic, "std_msgs/String");
     ResetBackend();
     //FadeManager.AssertIsInitialized();
 }
Esempio n. 3
0
        public abstract Tgoal GetGoal(); // to be implemented by user

        protected virtual void Start()
        {
            rosSocket = GetComponent <RosConnector>().RosSocket;

            CancelPublicationId = rosSocket.Advertise <Messages.Actionlib.GoalID>(ActionName + "/cancel");
            GoalPublicationId   = rosSocket.Advertise <Tgoal>(ActionName + "/goal");

            rosSocket.Subscribe <Messages.Actionlib.GoalStatusArray>(ActionName + "/status", StatusCallback, (int)(TimeStep * 1000));
            rosSocket.Subscribe <Tfeedback>(ActionName + "/feedback", FeedbackCallback, (int)(TimeStep * 1000));
            rosSocket.Subscribe <Tresult>(ActionName + "/result", ResultCallback, (int)(TimeStep * 1000));
        }
Esempio n. 4
0
        public void Start()
        {
            statusPublicationId   = socket.Advertise <GoalStatusArray>(actionName + "/status");
            feedbackPublicationId = socket.Advertise <TActionFeedback>(actionName + "/feedback");
            resultPublicationId   = socket.Advertise <TActionResult>(actionName + "/result");

            socket.Subscribe <GoalID>(actionName + "/cancel", CancelCallback, (int)(timeStep * 1000));
            socket.Subscribe <TActionGoal>(actionName + "/goal", GoalCallback, (int)(timeStep * 1000));

            UpdateAndPublishStatus(ActionStatus.PENDING);
        }
Esempio n. 5
0
        protected abstract void GoalHandle(Tgoal goal); // to be implemented by user

        protected void Start()
        {
            rosSocket   = GetComponent <RosConnector>().RosSocket;
            ActionState = ActionStates.Pending;

            rosSocket.Subscribe <Messages.Actionlib.GoalID>(ActionName + "/cancel", CancelCallback, (int)(TimeStep * 1000));
            rosSocket.Subscribe <Tgoal>(ActionName + "/goal", GoalCallback, (int)(TimeStep * 1000));

            StatusPublicationId   = rosSocket.Advertise <Messages.Actionlib.GoalStatusArray>(ActionName + "/status");
            FeedbackPublicationId = rosSocket.Advertise <Tfeedback>(ActionName + "/feedback");
            ResultPublicationId   = rosSocket.Advertise <Tresult>(ActionName + "/result");
        }
Esempio n. 6
0
        protected virtual void Start()
        {
            rosSocket = GetComponent <RosConnector>().RosSocket;

            publicationId     = rosSocket.Advertise(Topic, MessageTypes.RosMessageType(MessageProvider.MessageType));
            PublicationEvent += ReadMessage;
        }
 // Use this for initialization
 void Start()
 {
     displayMessages = new Dictionary <string, float>();
     red             = new Color(1f, 0f, 0f, 0.5f);
     blue            = new Color(0f, 0f, 1f, 0.5f);
     offRed          = new Color(1f, 0f, 0.3f, 0.5f);
     offBlue         = new Color(0.3f, 0f, 1f, 0.5f);
     print("Starting ROSBRIDGE and ROSSHARP!");
     rosSocket = GetComponent <RosConnector>().RosSocket;
     rosSocket.Subscribe(agent_topic, "gameworld_simulation/Agent", agentSubscriber, UpdateTime);
     rosSocket.Subscribe(construction_task_topic, "gameworld_simulation/ConstructionTask", constuctionTaskSubscriber, UpdateTime);
     rosSocket.Subscribe(transport_task_topic, "gameworld_simulation/TransportTask", transportationTaskSubscriber, UpdateTime);
     rosSocket.Subscribe(ros_update_message_topic, "std_msgs/String", updateMessageSubscriber, UpdateTime);
     updateID     = rosSocket.Advertise(game_update_topic, "std_msgs/String");
     inputID      = rosSocket.Advertise(user_input_topic, "std_msgs/String");
     message.data = "start";
     rosSocket.Publish(updateID, message);
     lineMaterial = Resources.Load("Material/tile_ceilingPanel_fx", typeof(Material)) as Material;
 }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     rosSocket = GetComponent <RosConnector>().RosSocket;
     //planPublicationId = rosSocket.Advertise(PlanTopic, "ros_reality_bridge_msgs/MoveitTarget");
     executePublicationId = rosSocket.Advertise(ExecuteTopic, "std_msgs/String");
 }