world_model_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 import roslib
19 import rospy
20 from asr_msgs.msg import AsrObject
21 from asr_world_model.srv import PushFoundObject, PushFoundObjectRequest
22 from geometry_msgs.msg import PoseWithCovariance
23 
24 
25 
26 def main():
27  req = PushFoundObjectRequest()
28  obj = AsrObject()
29  obj.header.frame_id = '/camera_left_frame'
30  obj.type = 'Smacks'
31  obj.providedBy = 'textured'
32  obj.colorName = 'textured'
33  obj.meshResourcePath = 'package://asr_object_database/rsc/databases/textured_objects/Smacks/Smacks.dae'
34  pose = PoseWithCovariance()
35  pose.pose.position.x = -1.20467103562224
36  pose.pose.position.y = 0.589709102059754
37  pose.pose.position.z = 1.02933642432456
38  pose.pose.orientation.w = 0.573287415807964
39  pose.pose.orientation.x = -0.58793291283527
40  pose.pose.orientation.y = -0.394117786539212
41  pose.pose.orientation.z = 0.412731873272096
42  obj.sampledPoses.append(pose)
43 
44  try:
45  rospy.wait_for_service('/env/asr_world_model/push_found_object', timeout=5)
46  except rospy.exceptions.ROSException, e:
47  rospy.loginfo('Could not reach service')
48 
49  try:
50  push_found_object = rospy.ServiceProxy('/env/asr_world_model/push_found_object',
51  PushFoundObject)
52 
53  push_found_object(obj)
54  except rospy.ServiceException, e:
55  rospy.loginfo('Could not push object')
56 
57 
58 
59 if __name__ == '__main__':
60  try:
61  main()
62  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