public override void deserialize(MemoryStream stream, std_msgs.msg.Bool data) { using (BinaryReader reader = new BinaryReader(stream)) { Halodi.CDR.CDRDeserializer cdr = new Halodi.CDR.CDRDeserializer(reader); read(data, cdr); } }
public override void serialize(std_msgs.msg.Bool data, MemoryStream stream) { using (BinaryWriter writer = new BinaryWriter(stream)) { Halodi.CDR.CDRSerializer cdr = new Halodi.CDR.CDRSerializer(writer); write(data, cdr); } }
public void SetBoolData() { std_msgs.msg.Bool msg = new std_msgs.msg.Bool(); Assert.That(msg.Data, Is.False); msg.Data = true; Assert.That(msg.Data, Is.True); msg.Data = false; Assert.That(msg.Data, Is.False); }
public static int getCdrSerializedSize(std_msgs.msg.Bool data, int current_alignment) { int initial_alignment = current_alignment; current_alignment += 1 + Halodi.CDR.CDRCommon.alignment(current_alignment, 1); return(current_alignment - initial_alignment); }
public static void InitPublisher(ref rcl_publisher_t publisher, ref rcl_node_t node, IntPtr publisherOptions) { RCLReturnEnum ret; publisher = NativeMethods.rcl_get_zero_initialized_publisher(); publisherOptions = NativeMethods.rclcs_publisher_create_default_options(); IMessageInternals msg = new std_msgs.msg.Bool(); IntPtr typeSupportHandle = msg.TypeSupportHandle; ret = (RCLReturnEnum)NativeMethods.rcl_publisher_init(ref publisher, ref node, typeSupportHandle, "publisher_test_topic", publisherOptions); }
public static void InitSubscription(ref rcl_subscription_t subscription, IntPtr subscriptionOptions, ref rcl_node_t node) { RCLReturnEnum ret; subscription = NativeMethods.rcl_get_zero_initialized_subscription(); subscriptionOptions = NativeMethods.rclcs_subscription_create_default_options(); IMessageInternals msg = new std_msgs.msg.Bool(); IntPtr typeSupportHandle = msg.TypeSupportHandle; ret = (RCLReturnEnum)NativeMethods.rcl_subscription_init(ref subscription, ref node, typeSupportHandle, "/subscriber_test_topic", subscriptionOptions); Assert.That(ret, Is.EqualTo(RCLReturnEnum.RCL_RET_OK), Utils.PopRclErrorString()); }
public void PublisherPublish() { RCLReturnEnum ret; rcl_publisher_t publisher = new rcl_publisher_t(); IntPtr publisherOptions = new IntPtr(); PublisherInitialize.InitPublisher(ref publisher, ref node, publisherOptions); IMessageInternals msg = new std_msgs.msg.Bool(); ret = (RCLReturnEnum)NativeMethods.rcl_publish(ref publisher, msg.Handle); Assert.That(ret, Is.EqualTo(RCLReturnEnum.RCL_RET_OK), Utils.PopRclErrorString()); PublisherInitialize.ShutdownPublisher(ref publisher, ref node, publisherOptions); }
public void PublisherPublish() { RCLReturnEnum ret; rcl_publisher_t publisher = NativeMethods.rcl_get_zero_initialized_publisher(); rcl_publisher_options_t publisherOptions = NativeMethods.rcl_publisher_get_default_options(); std_msgs.msg.Bool msg = new std_msgs.msg.Bool(); IntPtr typeSupportHandle = msg.TypeSupportHandle; ret = (RCLReturnEnum)NativeMethods.rcl_publisher_init(ref publisher, ref node, typeSupportHandle, "/publisher_test_topic", ref publisherOptions); ret = (RCLReturnEnum)NativeMethods.rcl_publish(ref publisher, msg.Handle); Assert.That(ret, Is.EqualTo(RCLReturnEnum.RCL_RET_OK), Utils.PopRclErrorString()); ret = (RCLReturnEnum)NativeMethods.rcl_publisher_fini(ref publisher, ref node); Assert.That(ret, Is.EqualTo(RCLReturnEnum.RCL_RET_OK), Utils.PopRclErrorString()); }
public void SetSubscriptionQosProfile() { rcl_subscription_t subscription = NativeMethods.rcl_get_zero_initialized_subscription(); IntPtr subscriptionOptions = NativeMethods.rclcs_subscription_create_default_options(); NativeMethods.rclcs_subscription_set_qos_profile(subscriptionOptions, 0); IMessageInternals msg = new std_msgs.msg.Bool(); IntPtr typeSupportHandle = msg.TypeSupportHandle; NativeMethods.rcl_subscription_init(ref subscription, ref node, typeSupportHandle, "/subscriber_test_topic", subscriptionOptions); Assert.That(NativeMethods.rcl_subscription_is_valid(ref subscription), Is.True); NativeMethods.rcl_subscription_fini(ref subscription, ref node); NativeMethods.rclcs_subscription_dispose_options(subscriptionOptions); }
public void SetBoolData() { var msg = new std_msgs.msg.Bool(); var msgCopy = new std_msgs.msg.Bool(); msg.ReadNativeMessage(); Assert.That(msg.Data, Is.False); msg.Data = true; msg.WriteNativeMessage(); msgCopy.ReadNativeMessage(msg.Handle); Assert.That(msgCopy.Data, Is.True); msg.Data = false; msg.WriteNativeMessage(); msgCopy.ReadNativeMessage(msg.Handle); Assert.That(msgCopy.Data, Is.False); }
public void CreateMessage() { std_msgs.msg.Bool msg = new std_msgs.msg.Bool(); }
public static void Copy(std_msgs.msg.Bool src, std_msgs.msg.Bool target) { target.Set(src); }
public static void read(std_msgs.msg.Bool data, Halodi.CDR.CDRDeserializer cdr) { data.data = cdr.read_type_7(); }
public static void write(std_msgs.msg.Bool data, Halodi.CDR.CDRSerializer cdr) { cdr.write_type_7(data.data); }
public static int getCdrSerializedSize(std_msgs.msg.Bool data) { return(getCdrSerializedSize(data, 0)); }