scene_recognizer_2_objects_test.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 '''
4 Copyright (c) 2016, Aumann Florian, Heller Florian, Hutmacher Robin, Meissner Pascal, Stoeckle Patrick, Stroh Daniel
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8 
9 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10 
11 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12 
13 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
14 
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 '''
17 
18 from asr_msgs.msg import AsrObject
19 from asr_recognizer_prediction_ism.srv import FindScenes, FindScenesRequest
20 import roslib
21 import rospy
22 
23 
24 def main():
25  req = FindScenesRequest()
26  objects = []
27  obj = AsrObject()
28  obj.type = 'CupPdV'
29 
30 
31  obj.poseEstimation.pose.position.x = -0.895672837120925
32  obj.poseEstimation.pose.position.y = 0.876364548041306
33  obj.poseEstimation.pose.position.z = 0.675630282005366
34  obj.poseEstimation.pose.orientation.w = 0.0438159930101303
35  obj.poseEstimation.pose.orientation.x = -0.00274503713451766
36  obj.poseEstimation.pose.orientation.y = -0.673982743489664
37  obj.poseEstimation.pose.orientation.z = 0.737441445137044
38 
39  obj1 = AsrObject()
40  obj1.type = 'PlateDeep'
41  obj1.poseEstimation.pose.position.x = -0.884891287861248
42  obj1.poseEstimation.pose.position.y = 0.639571172744163
43  obj1.poseEstimation.pose.position.z = 0.660505174542679
44  obj1.poseEstimation.pose.orientation.w = 0.650782548685679
45  obj1.poseEstimation.pose.orientation.x = -0.64554621902581
46  obj1.poseEstimation.pose.orientation.y = -0.27131992194386
47  obj1.poseEstimation.pose.orientation.z = 0.293492169203933
48 
49  objects.append(obj)
50  objects.append(obj1)
51 
52  try:
53  rospy.wait_for_service('/rp_ism_node/find_scenes', timeout=5)
54  except rospy.exceptions.ROSException, e:
55  rospy.loginfo('Could not reach service')
56 
57  try:
58  find_scenes = rospy.ServiceProxy('/rp_ism_node/find_scenes',
59  FindScenes)
60  print find_scenes(objects)
61  except rospy.ServiceException, e:
62  rospy.loginfo('Could not find scene')
63 
64 if __name__ == '__main__':
65  try:
66  main()
67  except rospy.ROSInterruptException: pass


asr_recognizer_prediction_ism
Author(s): Aumann Florian, Heller Florian, Hutmacher Robin, Meißner Pascal, Stöckle Patrick, Stroh Daniel
autogenerated on Wed Jan 8 2020 03:18:32