示例#1
0
  calc_flow_node () : nh_(), it_(nh_), flow(0, 0, CV_8UC1), prevImg(0, 0, CV_8UC1) {
    //flow = new cv::Mat(0, 0, CV_8UC1);

    namespace_ = nh_.resolveName("camera");
    camera_sub = it_.subscribeCamera(namespace_ + "/image", 10, &calc_flow_node::cameraCB, this);
    result_pub_ = nh_.advertise<sensor_msgs::Image> ("flow_image", 1);
    //result_pub_ = nh_.advertise<sensor_msgs::PointCloud2> ("flow_vector", 1);
  }
示例#2
0
   RECONSTRUCTION()
      : it_(nh_)
   {
      left_subscribe = it_.subscribeCamera("/stereo/left/image_raw", 2, &RECONSTRUCTION::imageCb, this);
      right_subscribe = it_.subscribeCamera("/stereo/right/image_raw", 2, &RECONSTRUCTION::imageCb2, this);

      pub_drone[0] = nh_.advertise<geometry_msgs::Point>("/KALMAN", 1);
      pub_drone[1] = nh_.advertise<geometry_msgs::Point>("/SECOND/CURRENT_POS", 1);
      pub_drone[2] = nh_.advertise<geometry_msgs::Point>("/THIRD/CURRENT_POS", 1);
      pub_drone[3] = nh_.advertise<geometry_msgs::Point>("/FOURTH/CURRENT_POS", 1);

      Nasang[0] = nh_.advertise<geometry_msgs::Point>("/FIRST/NASANG", 1);
      Nasang[1] = nh_.advertise<geometry_msgs::Point>("/SECOND/NASANG", 1);
      Nasang[2] = nh_.advertise<geometry_msgs::Point>("/THIRD/NASANG", 1);
      Nasang[3] = nh_.advertise<geometry_msgs::Point>("/FOURTH/NASANG", 1);

#ifdef DEBUG
      cv::namedWindow(OPENCV_WINDOW, 0);
      cv::namedWindow(OPENCV_WINDOW2, 0);
#endif
   }
示例#3
0
void SwissRangerDevice::createSubscribers(ros::NodeHandle & nh,
                                          image_transport::ImageTransport & image_transport_nh,
                                          const std::string & main_topic)
{
  std::stringstream ss;
  ss << main_topic << "/cloud";
  cloud_sub_ = nh.subscribe(ss.str(), 1, &SwissRangerDevice::cloudCallback, this);

  ss.str("");
  ss << main_topic << "/intensity";
  camera_sub_ = image_transport_nh.subscribeCamera(ss.str(), 1, &SwissRangerDevice::imageCallback, this);
}
示例#4
0
void KinectDevice::createSubscribers(ros::NodeHandle & nh,
                                     image_transport::ImageTransport & image_transport_nh,
                                     const std::string & main_topic)
{
  std::stringstream ss;
  ss << main_topic << "/image";
  camera_sub_ = image_transport_nh.subscribeCamera(ss.str(), 1, &KinectDevice::imageCallback, this);

//  ss.str("");
//  ss << main_topic << "/depth_image";
//  depth_sub_ = image_transport_nh.subscribeCamera(ss.str(), 1, &KinectDevice::depthCallback, this);

  ss.str("");
  ss << main_topic << "/cloud";
  cloud_sub_ = nh.subscribe(ss.str(), 1, &KinectDevice::cloudCallback, this);
}