Exemple #1
0
    // Update is called once per frame in Unity
    void Update()
    {
        ROSBridgeLib.std_msgs.StringMsg ms = new ROSBridgeLib.std_msgs.StringMsg(Person_movement.p_location);
        //Debug.Log(ms);
        ros.Publish(publisher.GetMessageTopic(), ms);
        //  Thread.Sleep(100);
        ROSBridgeLib.std_msgs.StringMsg ms2 = new ROSBridgeLib.std_msgs.StringMsg(Person_movement.playerpointaddition);
        ////Debug.Log(ms2);
        ROSBridgeLib.std_msgs.StringMsg ms3 = new ROSBridgeLib.std_msgs.StringMsg(Person_movement.playerpointdeductdz);

        if (Person_movement.playerpointadditionbool == true)
        {
            ros.Publish(publisher2.GetMessageTopic(), ms2);
            // Debug.Log(ms2);
            Person_movement.playerpointadditionbool = false;
        }
        if (Person_movement.playerpointdeductionbool == true)
        {
            ros.Publish(publisher3.GetMessageTopic(), ms2);
            // Debug.Log(ms3);
            Person_movement.playerpointdeductionbool = false;
        }

        ros.Render();
    }
Exemple #2
0
    public override string ToYAMLString()
    {
        ROSBridgeLib.std_msgs.TimeMsg            timeMsg            = new ROSBridgeLib.std_msgs.TimeMsg(0, 0);
        ROSBridgeLib.std_msgs.HeaderMsg          header             = new ROSBridgeLib.std_msgs.HeaderMsg(0, timeMsg, "'world'");
        ROSBridgeLib.std_msgs.StringMsg          nameSpace          = new ROSBridgeLib.std_msgs.StringMsg("''");
        ROSBridgeLib.std_msgs.Int32Msg           id                 = new ROSBridgeLib.std_msgs.Int32Msg(0);
        ROSBridgeLib.std_msgs.Int32Msg           type               = new ROSBridgeLib.std_msgs.Int32Msg(10);
        ROSBridgeLib.std_msgs.Int32Msg           action             = new ROSBridgeLib.std_msgs.Int32Msg(0);
        ROSBridgeLib.geometry_msgs.PointMsg      position           = new ROSBridgeLib.geometry_msgs.PointMsg(0d, 0d, 0d);
        ROSBridgeLib.geometry_msgs.QuaternionMsg orientation        = new ROSBridgeLib.geometry_msgs.QuaternionMsg(0d, 0d, 0d, 0d);
        ROSBridgeLib.geometry_msgs.PoseMsg       pose               = new ROSBridgeLib.geometry_msgs.PoseMsg(position, orientation);
        ROSBridgeLib.geometry_msgs.Vector3Msg    scale              = new ROSBridgeLib.geometry_msgs.Vector3Msg(1d, 1d, 1d);
        ROSBridgeLib.std_msgs.ColorRGBAMsg       color              = new ROSBridgeLib.std_msgs.ColorRGBAMsg(0f, 0f, 0f, 0f);
        ROSBridgeLib.std_msgs.TimeMsg            lifetime           = new ROSBridgeLib.std_msgs.TimeMsg(10, 0);
        ROSBridgeLib.std_msgs.BoolMsg            frame_locked       = new ROSBridgeLib.std_msgs.BoolMsg(false);
        ROSBridgeLib.geometry_msgs.PointMsg      point              = new ROSBridgeLib.geometry_msgs.PointMsg(0d, 0d, 0d);
        ROSBridgeLib.std_msgs.StringMsg          mesh_resource      = new ROSBridgeLib.std_msgs.StringMsg("'package://roboy_models/legs_with_upper_body/cad/torso.STL'");
        ROSBridgeLib.std_msgs.BoolMsg            mesh_use_materials = new ROSBridgeLib.std_msgs.BoolMsg(true);

        return("{" + header.ToYAMLString() + "}");

        //return "{" + header.ToYAMLString() + nameSpace.ToYAMLString() + id.ToYAMLString() + type.ToYAMLString()
        //    + action.ToYAMLString() + pose.ToYAMLString() + scale.ToYAMLString() + color.ToYAMLString()
        //    + lifetime.ToYAMLString() + frame_locked.ToYAMLString() + "{\"points\" : - " + point.ToYAMLString() + "}" + "{\"colors\" : - " + color.ToYAMLString() + "}"
        //    + nameSpace.ToYAMLString() + mesh_resource.ToYAMLString() + mesh_use_materials.ToYAMLString() + "}";
    }
 public static string ToYAMLString(ROSBridgeLib.std_msgs.StringMsg msg)
 {
     return(msg.ToYAMLString());
 }