camera_info_splitter.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # This script splits an incoming StereoCameraInfo message into two
4 # CameraInfo messages, making it easier to integrate the nerian_stereo
5 # node with existing nodes that process 2d camera data.
6 
7 import rospy
8 from nerian_stereo.msg import StereoCameraInfo
9 from sensor_msgs.msg import CameraInfo
10 
11 leftPub = 0
12 rightPub = 0
13 
14 def callback(data):
15  global leftPub;
16  global rightPub;
17 
18  rospy.loginfo(rospy.get_caller_id() + ": Camera info received")
19  leftPub.publish(data.left_info)
20  rightPub.publish(data.right_info)
21 
22 def listener():
23  global leftPub;
24  global rightPub;
25 
26  rospy.init_node('camera_info_splitter')
27  rospy.Subscriber("/nerian_stereo/stereo_camera_info", StereoCameraInfo, callback)
28 
29  leftPub = rospy.Publisher('/nerian_stereo/left_camera_info', CameraInfo, queue_size=10)
30  rightPub = rospy.Publisher('/nerian_stereo/right_camera_info', CameraInfo, queue_size=10)
31 
32  rospy.spin()
33 
34 if __name__ == '__main__':
35  listener()


nerian_stereo
Author(s): Nerian Vision Technologies
autogenerated on Fri Apr 16 2021 02:11:19