예제 #1
0
 def test_expand_pose_for_plugin(self):
     self.model.add_module(quaternion_module.QuaternionModule())
     strings = self.model.expand_attribute('/pose')
     self.assertEqual(len(strings), 4)
     self.assertEqual(strings[0], '/pose/position/x')
     self.assertEqual(strings[1], '/pose/position/y')
     self.assertEqual(strings[2], '/pose/position/z')
     self.assertEqual(strings[3], '/pose/orientation')
예제 #2
0
 def test_make_topic_strings_quaterion(self):
     strings = ez_model.make_topic_strings(geo_msgs.Quaternion(),
                                           '/pose/orientation')
     self.assertEqual(len(strings), 4)
     strings = ez_model.make_topic_strings(geo_msgs.Quaternion(),
                                           '/pose/orientation',
                                           modules=[quaternion_module.QuaternionModule()])
     self.assertEqual(len(strings), 1)
     self.assertEqual(strings[0], '/pose/orientation')
예제 #3
0
 def test_get_value_type_quaternion(self):
     msg_type, is_array = ez_model.get_value_type('geometry_msgs/Pose',
                                                  ['orientation'])
     self.assertEqual(msg_type, None)
     self.assertEqual(is_array, False)
     msg_type, is_array = ez_model.get_value_type(
         'geometry_msgs/Pose', ['orientation'],
         modules=[quaternion_module.QuaternionModule()])
     self.assertEqual(msg_type, 'geometry_msgs/Quaternion')
     self.assertEqual(is_array, False)