Skip to content

Commit

Permalink
Add test for jsk-ros-pkg#609
Browse files Browse the repository at this point in the history
  • Loading branch information
Affonso-Gui committed Mar 27, 2019
1 parent 63aeadf commit 95dbe2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion roseus/test/test-geneus.l
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
(require :unittest "lib/llib/unittest.l")

(ros::load-ros-manifest "roseus")
(ros::load-ros-manifest "jsk_recognition_msgs")
;; check if package without msgs is ok
;; ros::eus-error is error
(unless (fboundp 'ros::ros-error-org)
Expand Down Expand Up @@ -188,7 +189,10 @@
;; roseus treats uint8[] data as a string, which is the Euslisp reresentation for byte data.
;; see http://wiki.ros.org/msg#Fields
(subscribe-and-check-msg "uint8multiarray" std_msgs::UInt8MultiArray :data "eus")

;; Test name clashing with eus symbols
;; e.g. jsk_recognition_msgs/ObjectArray, with Object slot
(subscribe-and-check-msg "objectarray" jsk_recognition_msgs::ObjectArray :objects
(list (instance jsk_recognition_msgs::Object :init)))
(format *error-output* "fixedarray~%")
(ros::subscribe "fixedarray" roseus::FixedArray #'subscribe-and-check-array-msg)
(format *error-output* "variablearray~%")
Expand Down
2 changes: 2 additions & 0 deletions roseus/test/test_geneus_send_msgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import rospy
import std_msgs
import jsk_recognition_msgs.msg
import roseus
import roseus.msg

Expand Down Expand Up @@ -39,6 +40,7 @@ def send_msgs():
rospy.Publisher('uint64multiarray', std_msgs.msg.UInt64MultiArray, queue_size=10) : std_msgs.msg.UInt64MultiArray(data=[7,8,9]),
rospy.Publisher('uint8multiarray', std_msgs.msg.UInt8MultiArray, queue_size=10) : std_msgs.msg.UInt8MultiArray(data=[ord('e'),ord('u'),ord('s')]), # ascii codes of 'eus'
rospy.Publisher('fixedarray', roseus.msg.FixedArray, queue_size=10) : roseus.msg.FixedArray(float32_data=[1,-2,3], float64_data=[4,-5,6], int16_data=[7,-8,9], int32_data=[10,-11,12], int64_data=[13,-14,15], int8_data=[16,-17,18], uint16_data=[1,2,3], uint32_data=[4,5,6], uint64_data=[7,8,9], uint8_data=[ord('j'),ord('o'),ord('h'),ord('o'),ord('s'),ord('y'),ord('s'),ord('t'),ord('e'),ord('m'),ord('k'),ord('o'),ord('u'),ord('g'),ord('a'),ord('k'),ord('u')], bool_data=[True, False], time_data=[rospy.Time(0), rospy.Time(1)], duration_data=[rospy.Time(0), rospy.Time(1)], string_data=[std_msgs.msg.String("ros"), std_msgs.msg.String("eus")]),
rospy.Publisher('objectarray', jsk_recognition_msgs.msg.ObjectArray, queue_size=10) : jsk_recognition_msgs.msg.ObjectArray(objects=[jsk_recognition_msgs.msg.Object()]),
rospy.Publisher('variablearray', roseus.msg.VariableArray, queue_size=10) : roseus.msg.VariableArray(float32_data=[1,-2,3], float64_data=[4,-5,6], int16_data=[7,-8,9], int32_data=[10,-11,12], int64_data=[13,-14,15], int8_data=[16,-17,18], uint16_data=[1,2,3], uint32_data=[4,5,6], uint64_data=[7,8,9], uint8_data=[ord('j'),ord('o'),ord('h'),ord('o'),ord('s'),ord('y'),ord('s'),ord('t'),ord('e'),ord('m'),ord('k'),ord('o'),ord('u'),ord('g'),ord('a'),ord('k'),ord('u')], bool_data=[True, False], time_data=[rospy.Time(0), rospy.Time(1)], duration_data=[rospy.Time(0), rospy.Time(1)], string_data=[std_msgs.msg.String("ros"), std_msgs.msg.String("eus")]),
}
rospy.init_node('test_geneus_send_msgs', anonymous=True)
Expand Down

0 comments on commit 95dbe2d

Please sign in to comment.