示例#1
0
 public void SetUp()
 {
     context = new Context();
     Rclcs.Init(context);
     node = new Node("test_node", context);
     Subscription <std_msgs.msg.Int64> subscription = node.CreateSubscription <std_msgs.msg.Int64>("/test_topic", (msg) => { });
 }
 public void SetUp()
 {
     context = new Context();
     Rclcs.Init(context);
     node      = new Node("subscription_test_node", context);
     publisher = node.CreatePublisher <std_msgs.msg.Int32>("subscription_test_topic");
 }
示例#3
0
        public void InitShutdown()
        {
            Context context = new Context();

            Rclcs.Init(context);
            Rclcs.Shutdown(context);
        }
示例#4
0
        public static void Main(string[] args)
        {
            Context ctx = new Context();

            Rclcs.Init(ctx);
            INode node = Rclcs.CreateNode("talker", ctx);
            IPublisher <std_msgs.msg.String> chatter_pub = node.CreatePublisher <std_msgs.msg.String>("chatter");

            std_msgs.msg.String msg = new std_msgs.msg.String();
            int i = 1;

            while (Rclcs.Ok(ctx))
            {
                // adamdbrw - if no at least small sleep is made before
                // the first published message, it doesn't reach subscribers
                // Needs investigation for how to put a valid check here
                // TODO (adam) replace with a proper check
                Thread.Sleep(500);
                msg.Data = "Hello World: " + i;
                i++;
                Console.WriteLine("Publishing: \"" + msg.Data + "\"");
                chatter_pub.Publish(msg);
                Thread.Sleep(500);
            }
            Rclcs.Shutdown(ctx);
        }
示例#5
0
        public void DoubleShutdown()
        {
            Context context = new Context();

            Rclcs.Init(context);
            Rclcs.Shutdown(context);
            Assert.That(() => { Rclcs.Shutdown(context); }, Throws.TypeOf <RuntimeError>());
        }
示例#6
0
        public void InitShutdownSequence()
        {
            // local
            Context context = new Context();

            Rclcs.Init(context);
            Rclcs.Shutdown(context);
            context = new Context();
            Rclcs.Init(context);
            Rclcs.Shutdown(context);
        }
示例#7
0
        public void SetUp()
        {
            pub_context = new Context();
            sub_context = new Context();

            Rclcs.Init(pub_context);
            Rclcs.Init(sub_context);

            pub_node = new Node("pub_node", pub_context);
            sub_node = new Node("sub_node", sub_context);
        }
示例#8
0
        public void SetUp()
        {
            publisherContext    = new Context();
            subscriptionContext = new Context();
            Rclcs.Init(publisherContext);
            Rclcs.Init(subscriptionContext);

            subscriptionNode = new Node("subscription_test_node", publisherContext);
            publisherNode    = new Node("publisher_test_node", publisherContext);

            publisher = publisherNode.CreatePublisher <std_msgs.msg.Float64MultiArray>("subscription_test_topic");
        }
示例#9
0
        public static void Main(string[] args)
        {
            Context ctx = new Context();

            Rclcs.Init(ctx);
            INode node = Rclcs.CreateNode("listener", ctx);

            ISubscription <std_msgs.msg.String> chatter_sub = node.CreateSubscription <std_msgs.msg.String>(
                "chatter", msg => Console.WriteLine("I heard: [" + msg.Data + "]"));

            Rclcs.Spin(node, ctx);
            Rclcs.Shutdown(ctx);
        }
示例#10
0
        public void Init()
        {
            Context context = new Context();

            Rclcs.Init(context);
            try
            {
                Rclcs.Shutdown(context);
            }
            catch (RuntimeError)
            {
            }
        }
示例#11
0
 public void SetUp()
 {
     context = new Context();
     Rclcs.Init(context);
     node = Rclcs.CreateNode(TEST_NODE, nodeNamespace: TEST_NAMESPACE, context: context);
 }
示例#12
0
 public void SetUp()
 {
     context = new Context();
     Rclcs.Init(context);
 }