예제 #1
0
        public void TestTransformStampedMessage()
        {
            Assert.True(BuiltIns.GetMessageType <MyTransformStamped>() == MyTransformStamped.RosMessageType);
            Assert.True(BuiltIns.GetMd5Sum <MyTransformStamped>() == BuiltIns.GetMd5Sum <TransformStamped>());

            time             now  = time.Now();
            TransformStamped real = new TransformStamped()
            {
                Header       = new Header(1, now, "Frame"),
                ChildFrameId = "Abcd",
                Transform    = Transform.Identity
            };

            MyTransformStamped wrapped = new MyTransformStamped()
            {
                Header       = new Header(1, now, "Frame"),
                ChildFrameId = "Abcd",
                Transform    = Transform.Identity
            };

            byte[] messageBytes      = real.SerializeToArray();
            byte[] otherMessageBytes = wrapped.SerializeToArray();

            Assert.True(messageBytes.SequenceEqual(otherMessageBytes));

            var otherWrapped = wrapped.DeserializeFromArray(messageBytes);

            Assert.True(wrapped.Header == real.Header);
            Assert.True(wrapped.ChildFrameId == real.ChildFrameId);
            Assert.True(wrapped.Transform == real.Transform);
        }
예제 #2
0
 public ServiceInfo(string callerId, string service, T?generator = default)
     : this(
         callerId, service,
         BuiltIns.GetMd5Sum <T>(),
         BuiltIns.GetServiceType <T>(),
         generator
         )
 {
 }
예제 #3
0
 public TopicInfo(string callerId, string topic, IDeserializable <T> generator)
     : this(
         BuiltIns.DecompressDependencies(generator.GetType()),
         callerId, topic,
         BuiltIns.GetMd5Sum(generator.GetType()),
         BuiltIns.GetMessageType(generator.GetType()),
         generator
         )
 {
 }
예제 #4
0
 public TopicInfo(string callerId, string topic)
     : this(
         BuiltIns.DecompressDependencies <T>(),
         callerId, topic,
         BuiltIns.GetMd5Sum <T>(),
         BuiltIns.GetMessageType <T>(),
         null
         )
 {
 }
예제 #5
0
        public void TestInteractiveMarkerMessage()
        {
            Assert.True(BuiltIns.GetMessageType(typeof(MyInteractiveMarker)) == MyInteractiveMarker.RosMessageType);
            Console.WriteLine(MyInteractiveMarker.RosDefinition);
            Assert.True(
                BuiltIns.GetMd5Sum(typeof(MyInteractiveMarker)) == BuiltIns.GetMd5Sum(typeof(InteractiveMarker)));

            time now  = time.Now();
            var  real = new InteractiveMarker()
            {
                Pose        = Pose.Identity,
                Name        = "Abcd",
                Description = "Efgh",
                MenuEntries = new MenuEntry[] { new(), new() },