nodelets.cpp
Go to the documentation of this file.
00001 #include <ros/ros.h>
00002 #include <ros/time.h>
00003 
00004 #include <pluginlib/class_list_macros.h>
00005 #include <nodelet/nodelet.h>
00006 
00007 #include "uvc_camera/camera.h"
00008 #include "uvc_camera/stereocamera.h"
00009 
00010 namespace uvc_camera {
00011 
00012 class CameraNodelet : public nodelet::Nodelet {
00013   public:
00014     CameraNodelet() {}
00015 
00016     void onInit() {
00017       ros::NodeHandle node = getNodeHandle();
00018       ros::NodeHandle pnode = getPrivateNodeHandle();
00019 
00020       camera = new Camera(node, pnode);
00021     }
00022 
00023     ~CameraNodelet() {
00024       if (camera) delete camera;
00025     }
00026 
00027   private:
00028     Camera *camera;
00029 };
00030 
00031 class StereoNodelet : public nodelet::Nodelet {
00032   public:
00033     StereoNodelet() {}
00034 
00035     void onInit() {
00036       ros::NodeHandle node = getNodeHandle();
00037       ros::NodeHandle pnode = getPrivateNodeHandle();
00038 
00039       stereo = new StereoCamera(node, pnode);
00040     }
00041 
00042     ~StereoNodelet() {
00043       if (stereo) delete stereo;
00044     }
00045 
00046   private:
00047     StereoCamera *stereo;
00048 };
00049 
00050 };
00051 
00052 PLUGINLIB_DECLARE_CLASS(uvc_camera, CameraNodelet, uvc_camera::CameraNodelet, nodelet::Nodelet);
00053 PLUGINLIB_DECLARE_CLASS(uvc_camera, StereoNodelet, uvc_camera::StereoNodelet, nodelet::Nodelet);
00054 


uvc_camera
Author(s): Ken Tossell
autogenerated on Thu Jun 15 2017 02:29:40