4 Copyright (c) 2016, Aumann Florian, Heller Florian, Hutmacher Robin, Meissner Pascal, Stoeckle Patrick, Stroh Daniel 7 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 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. 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. 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. 20 from asr_msgs.msg
import AsrObject
21 from asr_world_model.srv
import PushFoundObject, PushFoundObjectRequest
22 from geometry_msgs.msg
import PoseWithCovariance
27 req = PushFoundObjectRequest()
29 obj.header.frame_id =
'/camera_left_frame' 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)
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')
50 push_found_object = rospy.ServiceProxy(
'/env/asr_world_model/push_found_object',
53 push_found_object(obj)
54 except rospy.ServiceException, e:
55 rospy.loginfo(
'Could not push object')
59 if __name__ ==
'__main__':
62 except rospy.ROSInterruptException:
pass