ros-perception / camera_info_manager_py

Subset of the C++ camera_info_manager ROS package for Python camera drivers
http://wiki.ros.org/camera_info_manager_py
7 stars 25 forks source link

Support for 'with' #5

Open LucidOne opened 10 years ago

LucidOne commented 10 years ago
with camera_info_manager.CameraInfoManager(cname="camera", url=url) as cam_manager:
  cam_manager.loadCameraInfo()
  cam_info = cam_manager.getCameraInfo()
  print "cam_info"

AttributeError: CameraInfoManager instance has no attribute 'exit'

jack-oquin commented 10 years ago

Sounds like a good idea. It had not occurred to me.

It's probably not hard. I'll work on it when I get the chance. Pull requests are welcome.