Skip to content

Commit

Permalink
Merge pull request #509 from k-okada/test_508
Browse files Browse the repository at this point in the history
[WIP] add test code for [unexpected behavior if message has property `name`] #508
  • Loading branch information
k-okada authored Jun 27, 2018
2 parents 67292d1 + 2eb4e3d commit 907695b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion roseus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,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(
Expand Down
1 change: 1 addition & 0 deletions roseus/msg/TestName.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
roseus/StringStamped name
16 changes: 16 additions & 0 deletions roseus/test/test-name-pub.l
Original file line number Diff line number Diff line change
@@ -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))

8 changes: 8 additions & 0 deletions roseus/test/test-name-sub.l
Original file line number Diff line number Diff line change
@@ -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)

6 changes: 6 additions & 0 deletions roseus/test/test-name.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<node name="test_name_pub" pkg="roseus" type="test-name-pub.l"
output="screen" />
<node name="test_name_sub" pkg="roseus" type="test-name-sub.l"
output="screen" />
</launch>

0 comments on commit 907695b

Please sign in to comment.