4 Copyright (c) 2016, Aumann Florian, Borella Jocelyn, Hutmacher Robin, Karrenbauer Oliver, Meissner Pascal, Schleicher Ralf, Stoeckle Patrick, Trautmann Jeremias 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. 25 from geometry_msgs.msg
import (Pose, PoseWithCovariance, PoseWithCovarianceStamped, Point, Quaternion, Twist, Vector3)
26 from asr_msgs.msg
import AsrObject
27 from actionlib
import *
29 from asr_robot_model_services.msg
import RobotStateMessage
30 from asr_robot_model_services.srv
import CalculateCameraPose
31 from asr_next_best_view.srv
import TriggerFrustumVisualization
32 from sensor_msgs.msg
import JointState
33 from asr_world_model.srv
import PushFoundObject, PushFoundObjectList
42 rospy.wait_for_service(
'/asr_robot_model_services/GetCameraPose', timeout=5)
43 pose = rospy.ServiceProxy(
'/asr_robot_model_services/GetCameraPose',GetPose)
44 rospy.loginfo(pose().pose)
47 rospy.logwarn(
"Couldn't get Camera pose from service call.")
52 global detected_objects
54 rospy.loginfo(
"Found " + data.type)
56 if ( len(data.sampledPoses) == 0 ):
57 rospy.logerr(
"Got a AsrObject without poses.")
64 detected_objects.append(object)
67 if __name__ ==
'__main__':
68 global detected_objects
70 rospy.init_node(
'test_world_model')
72 sub = rospy.Subscriber(
'/stereo/objects',AsrObject,detection_callback)
76 rate = rospy.Rate(0.3)
77 while not rospy.is_shutdown():
79 rospy.wait_for_service(
'/env/asr_world_model/push_found_object_list',timeout=3)
80 push_found_objects = rospy.ServiceProxy(
'/env/asr_world_model/push_found_object_list', PushFoundObjectList)
83 except (rospy.exceptions.ROSException, rospy.ServiceException)
as e:
84 rospy.logwarn(
"Could not find world_model service")
def detection_callback(data)
def get_camera_pose_cpp()