Example #1
0
    // Update is called once per frame in Unity
    void Update()
    {
        Int32Msg msg = new Int32Msg(3);

        ros.Publish(pup_test.GetMessageTopic(), msg);
        ros.Render();
    }
Example #2
0
        public void SerializeDeserialize_MinInt32RoundTrip_ReturnsMinInt()
        {
            const int v      = int.MinValue;
            Int32Msg  inMsg  = new Int32Msg(v);
            Int32Msg  outMsg = MessageRoundTrip(inMsg, Int32Msg.Deserialize);

            Assert.AreEqual(inMsg.data, v);
            Assert.AreEqual(inMsg.data, outMsg.data);
        }
Example #3
0
        public void SerializeDeserialize_Int32RoundTrip_ReturnsSameValue()
        {
            const int v      = 1234;
            Int32Msg  inMsg  = new Int32Msg(v);
            Int32Msg  outMsg = MessageRoundTrip(inMsg, Int32Msg.Deserialize);

            Assert.AreEqual(inMsg.data, v);
            Assert.AreEqual(inMsg.data, outMsg.data);
        }
            public CommandMsg(JSONNode msg)
            {
                //Debug.Log("CommandMsg with " + msg.ToString());

                _header  = new HeaderMsg(msg["header"]);
                _command = new Int32Msg(msg["command"]);
                _params  = new Float64Msg[msg["params"].Count];
                for (int i = 0; i < _params.Length; i++)
                {
                    _params[i] = new Float64Msg(msg["params"][i]);
                }
                //Debug.Log("CommandMsg done and it looks like " + this.ToString());
            }
 public CommandMsg(HeaderMsg header, Int32Msg command, Float64Msg[] param)
 {
     _header  = header;
     _command = command;
     _params  = param;
 }
Example #6
0
 public static string ToYAMLString(Int32Msg msg)
 {
     //return msg.GetData().ToString();
     return(msg.ToYAMLString());
 }
Example #7
0
 public static string GetMessageType()
 {
     return(Int32Msg.GetMessageType());
 }