getFrustum.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 '''
4 Copyright (c) 2016, Allgeyer Tobias, Aumann Florian, Borella Jocelyn, Karrenbauer Oliver, Marek Felix, Meissner Pascal, Stroh Daniel, Trautmann Jeremias
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 #Manually draw frustum at current robot pose in RViz.
19 import roslib
20 import rospy
21 from asr_robot_model_services.msg import RobotStateMessage
22 from asr_robot_model_services.srv import CalculateCameraPose, GetPose
23 from asr_next_best_view.srv import TriggerFrustumVisualization
24 
26  """
27  Returns camera pose
28  """
29  rospy.wait_for_service('/asr_robot_model_services/GetCameraPose', timeout=5)
30  pose = rospy.ServiceProxy('/asr_robot_model_services/GetCameraPose',GetPose)
31  return pose().pose
32 
33 
34 def get_camera_frustum(camera_pose):
35  try:
36  rospy.wait_for_service('/nbv/trigger_frustum_visualization', timeout=5)
37  get_frustum = rospy.ServiceProxy(
38  '/nbv/trigger_frustum_visualization', TriggerFrustumVisualization)
39  get_frustum(camera_pose)
40  except (rospy.ServiceException, rospy.exceptions.ROSException), e:
41  rospy.logwarn(str(e))
42 
43 
44 def main():
45  camera_pose = get_camera_pose_cpp()
46  get_camera_frustum(camera_pose)
47 
48 if __name__ == "__main__":
49  main()
def main()
Definition: getFrustum.py:44
def get_camera_frustum(camera_pose)
Definition: getFrustum.py:34
def get_camera_pose_cpp()
Definition: getFrustum.py:25


asr_resources_for_active_scene_recognition
Author(s): Allgeyer Tobias, Aumann Florian, Borella Jocelyn, Karrenbauer Oliver, Marek Felix, Meißner Pascal, Stroh Daniel, Trautmann Jeremias
autogenerated on Tue Feb 18 2020 03:14:15