Ejemplo n.º 1
0
    public RosLogger(ROSBridgeWebSocketConnection ros)
    {
        _ros         = ros;
        _propertypub = _ros.Advertise <PropertyChanged>("/sgv/onto/property_changed");
        _objpub      = _ros.Advertise <ObjUpdate>("/sgv/onto/object_moved");
        _simstatepub = _ros.Advertise <SimulationStateChange>("/sgv/simulation_state_changed");

        ScenarioLogManager.Instance.Subscribe(this);

        _simstatepub.Publish(
            new SimulationStateChange(
                SimulationStateChange.SIMULATION_LOADED,
                new ROSBridgeLib.msg_helpers.Time(0.0f)
                )
            );
    }
Ejemplo n.º 2
0
    void initROSComms(ROSBridgeWebSocketConnection ros)
    {
        if (!ros.connected)
        {
            return;
        }

        onto_list_srv           = ros.Advertise <GetAllClassInstances, GetAllClassInstancesRequest, GetAllClassInstancesResponse>("/sgv/onto/GetAllClassInstances", onGetAllClassInstances);
        onto_list_with_pose_srv = ros.Advertise <GetAllClassInstancesWithPoses, GetAllClassInstancesWithPosesRequest, GetAllClassInstancesWithPosesResponse>("/sgv/onto/GetAllClassInstancesWithPoses", onGetAllClassInstancesWithPoses);
        relabelObject_srv       = ros.Advertise <RelabelObject, RelabelObjectRequest, RelabelObjectResponse>("/sgv/sim/RelabelObject", onRelabelObject);
        l_hand_pub = ros.Advertise <ROSBridgeLib.ontology_msgs.HandUpdate>("/sgv/human/hands/left");
        r_hand_pub = ros.Advertise <ROSBridgeLib.ontology_msgs.HandUpdate>("/sgv/human/hands/right");

        _rosLogger = new RosLogger(ros);

        _ready = true;
    }
Ejemplo n.º 3
0
        void Start()
        {
            if (this.rosBridgeIP.Equals(string.Empty))
            {
                this.rosBridgeIP = ConfigManager.Instance.configInfo.rosbridgeIP;
            }
            if (this.rosBridgePort == 0)
            {
                this.rosBridgePort = ConfigManager.Instance.configInfo.rosbridgePort;
            }

            this.webSocketConnection = new SIGVerse.ROSBridge.ROSBridgeWebSocketConnection(rosBridgeIP, rosBridgePort);

            this.publisher = this.webSocketConnection.Advertise <Tmsg>(sendingTopicName);

            // Connect to ROSbridge server
            this.webSocketConnection.Connect();
        }
Ejemplo n.º 4
0
        void Start()
        {
            if (this.rosBridgeIP.Equals(string.Empty))
            {
                this.rosBridgeIP = ConfigManager.Instance.configInfo.rosbridgeIP;
            }
            if (this.rosBridgePort == 0)
            {
                this.rosBridgePort = ConfigManager.Instance.configInfo.rosbridgePort;
            }

            this.webSocketConnection = new SIGVerse.ROSBridge.ROSBridgeWebSocketConnection(rosBridgeIP, rosBridgePort);

            this.jointStatePublisher = this.webSocketConnection.Advertise <JointState>(topicName);

            // Connect to ROSbridge server
            this.webSocketConnection.Connect();

            this.jointState        = new JointState();
            this.jointState.header = new Header(0, new SIGVerse.ROSBridge.msg_helpers.Time(0, 0), "hsrb_joint_states");

            this.jointState.name = new List <string>();
            this.jointState.name.Add(HSRCommon.ArmLiftJointName);               //1
            this.jointState.name.Add(HSRCommon.ArmFlexJointName);               //2
            this.jointState.name.Add(HSRCommon.ArmRollJointName);               //3
            this.jointState.name.Add(HSRCommon.WristFlexJointName);             //4
            this.jointState.name.Add(HSRCommon.WristRollJointName);             //5
            this.jointState.name.Add(HSRCommon.HeadPanJointName);               //6
            this.jointState.name.Add(HSRCommon.HeadTiltJointName);              //7

            this.jointState.position = null;
            this.jointState.velocity = new List <double> {
                0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
            };
            this.jointState.effort = new List <double> {
                0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
            };
        }