send_camera_info.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import roslib
00004 roslib.load_manifest('nao_driver')
00005 import rospy
00006 from sensor_msgs.msg import Image, CameraInfo
00007 from sensor_msgs.srv import SetCameraInfo
00008 
00009 
00010 def fill_set_camera_info():
00011     cam_info = CameraInfo()
00012     cam_info.header.frame_id = '/CameraTop_frame'
00013     cam_info.header.stamp = rospy.Time.now()
00014     cam_info.P[0] = 640.0
00015     cam_info.P[1] = 0.0
00016     cam_info.P[2] = 320.0
00017     cam_info.P[3] = 0
00018     cam_info.P[4] = 0.0
00019     cam_info.P[5] = 373.31
00020     cam_info.P[6] = 120.0
00021     cam_info.P[7] = 0.0
00022     cam_info.P[8] = 0.0
00023     cam_info.P[9] = 0.0
00024     cam_info.P[10] = 1.0
00025     cam_info.P[11] = 0.0
00026     setCameraInfo = SetCameraInfo()
00027     setCameraInfo.camera_info = cam_info
00028     return setCameraInfo
00029 
00030 
00031 def call_service():
00032     setCameraInfo = fill_set_camera_info()
00033     rospy.wait_for_service('set_camera_info')
00034     try:
00035         set_camera_info = rospy.ServiceProxy('set_camera_info', SetCameraInfo)
00036         print "proxy ready"
00037         response = set_camera_info(setCameraInfo.camera_info)
00038         print response.status_message
00039         return response.success
00040     except rospy.ServiceException, e:
00041         print "Service call failed: %s"%e
00042 
00043 if __name__ == '__main__':
00044     rospy.init_node('set_camera_info')
00045     ret = call_service()
00046     print "Return status is: ", ret
00047     exit(ret)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


nao_driver
Author(s): Armin Hornung, Stefan Osswald, Daniel Maier
autogenerated on Tue Oct 15 2013 10:06:23