From 2eb4e3dea4dec750cb1143df9a04ee8ba10febb4 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Wed, 1 Mar 2017 13:33:51 +0900 Subject: [PATCH] [WIP] add test code for #508 --- roseus/CMakeLists.txt | 2 +- roseus/msg/TestName.msg | 1 + roseus/test/test-name-pub.l | 16 ++++++++++++++++ roseus/test/test-name-sub.l | 8 ++++++++ roseus/test/test-name.test | 6 ++++++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 roseus/msg/TestName.msg create mode 100755 roseus/test/test-name-pub.l create mode 100755 roseus/test/test-name-sub.l create mode 100644 roseus/test/test-name.test diff --git a/roseus/CMakeLists.txt b/roseus/CMakeLists.txt index 64d2c3fcb..7840afc06 100644 --- a/roseus/CMakeLists.txt +++ b/roseus/CMakeLists.txt @@ -95,7 +95,7 @@ add_service_files( FILES AddTwoInts.srv StringString.srv ) add_message_files( - FILES String.msg StringStamped.msg FixedArray.msg VariableArray.msg + FILES String.msg StringStamped.msg FixedArray.msg VariableArray.msg TestName.msg ) generate_messages( diff --git a/roseus/msg/TestName.msg b/roseus/msg/TestName.msg new file mode 100644 index 000000000..dce4ea5d0 --- /dev/null +++ b/roseus/msg/TestName.msg @@ -0,0 +1 @@ +roseus/StringStamped name diff --git a/roseus/test/test-name-pub.l b/roseus/test/test-name-pub.l new file mode 100755 index 000000000..c0367dbb4 --- /dev/null +++ b/roseus/test/test-name-pub.l @@ -0,0 +1,16 @@ +#!/usr/bin/env roseus + +(ros::load-ros-manifest "roseus") + +(ros::roseus "test_name_pub") +(ros::advertise "test_name" roseus::TestName) +(ros::rate 1) +(setq i 0) +(while (ros::ok) + (setq ss (instance roseus::StringStamped :init :data (format nil "test ~A" (incf i)))) + (setq msg (instance roseus::TestName :init :name ss)) + (ros::ros-info "pub ~A" msg) + (ros::publish "test_name" msg) + (ros::sleep) + (ros::spin-once)) + diff --git a/roseus/test/test-name-sub.l b/roseus/test/test-name-sub.l new file mode 100755 index 000000000..b7d300a22 --- /dev/null +++ b/roseus/test/test-name-sub.l @@ -0,0 +1,8 @@ +#!/usr/bin/env roseus + +(ros::load-ros-manifest "roseus") + +(ros::roseus "test_name_sub") +(ros::subscribe "test_name" roseus::TestName #'(lambda (msg) (ros::ros-info "sub ~A" msg))) +(ros::spin) + diff --git a/roseus/test/test-name.test b/roseus/test/test-name.test new file mode 100644 index 000000000..e427428fa --- /dev/null +++ b/roseus/test/test-name.test @@ -0,0 +1,6 @@ + + + +