diff --git a/roseus/euslisp/roseus.l b/roseus/euslisp/roseus.l index 11e4a6f2f..e8df237f0 100644 --- a/roseus/euslisp/roseus.l +++ b/roseus/euslisp/roseus.l @@ -221,7 +221,7 @@ (exit 1)) (ros::ros-debug "Loading ~A" dir) (unless (find-package (string-upcase pkg)) - (make-package (string-upcase pkg))) + (make-package (string-upcase pkg) :use nil)) (dolist (file (directory dir)) (when (and (string= (pathname-type file) "l") (not (= #\. (elt (pathname-name file) 0)))) @@ -430,7 +430,7 @@ always the rank of list is 2" (defun ros::load-ros-package (pkg) "load required roseus files for given package" (unless (find-package (string-upcase pkg)) - (make-package (string-upcase pkg))) + (make-package (string-upcase pkg) :use nil)) (when (probe-file (format nil "~A/msg" (ros::find-load-msg-path pkg))) (ros::roseus-add-msgs pkg)) (when (probe-file (format nil "~A/srv" (ros::find-load-msg-path pkg))) diff --git a/roseus/msg/TestName.msg b/roseus/msg/TestName.msg index dce4ea5d0..5f66d96d4 100644 --- a/roseus/msg/TestName.msg +++ b/roseus/msg/TestName.msg @@ -1 +1,2 @@ roseus/StringStamped name +roseus/String string diff --git a/roseus/test/test-name-pub.l b/roseus/test/test-name-pub.l index c0367dbb4..4ef4a6925 100755 --- a/roseus/test/test-name-pub.l +++ b/roseus/test/test-name-pub.l @@ -6,11 +6,18 @@ (ros::advertise "test_name" roseus::TestName) (ros::rate 1) (setq i 0) + +;; Test for name clashing in ROS messages +;; `name' tests for name clashing in slot names +;; `string' tests for name clashing in message names + (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)) + (let* ((str (format nil "test ~A" (incf i))) + (s (instance roseus::String :init :data str)) + (ss (instance roseus::StringStamped :init :data str)) + (msg (instance roseus::TestName :init :name ss :string s))) + (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 index b7d300a22..c512bb13d 100755 --- a/roseus/test/test-name-sub.l +++ b/roseus/test/test-name-sub.l @@ -1,6 +1,9 @@ #!/usr/bin/env roseus -(ros::load-ros-manifest "roseus") +;; It is important to load `TestName.l' before `String.l' to test for name clashing +;; between roseus::String and lisp::string +(flet ((directory (dir) (list "TestName.l" "StringStamped.l" "String.l"))) + (ros::roseus-add-files "roseus" "msg")) (ros::roseus "test_name_sub") (ros::subscribe "test_name" roseus::TestName #'(lambda (msg) (ros::ros-info "sub ~A" msg)))