panorama.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013, Yujin Robot.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of Yujin Robot nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
40 /*****************************************************************************
41  ** Ifdefs
42  *****************************************************************************/
43 #ifndef PANORAMA_H_
44 #define PANORAMA_H_
45 
46 #include <ros/ros.h>
47 #include <std_msgs/Empty.h>
48 #include <std_msgs/String.h>
49 #include <std_srvs/Empty.h>
50 #include <sensor_msgs/Image.h>
51 #include <geometry_msgs/Twist.h>
52 #include <nav_msgs/Odometry.h>
54 #include <turtlebot3_applications_msgs/TakePanorama.h>
55 
56 #include "geometry.h"
57 
58 #include <opencv2/core.hpp>
59 #include <opencv2/highgui.hpp>
60 #include <opencv2/stitching.hpp>
61 
62 namespace turtlebot_panorama
63 {
64 
68 class PanoApp
69 {
70 public:
71  PanoApp();
72  ~PanoApp();
73 
74  void init();
75  void spin();
76 
81  void log(std::string msg);
82 
83 private:
86  std::map<std::string, std::string> params;
87 
88  geometry_msgs::Twist cmd_vel, zero_cmd_vel;
89  double snap_interval;
91 
92  bool continuous;
93 
96 
98 
99  // for turning the robot
101  // for retrieving the odometry of robot
103 
104  std::vector<cv::Mat> images_;
105 
109  bool is_active;
115  bool go_active;
132 
140  bool takePanoServiceCb(turtlebot3_applications_msgs::TakePanorama::Request& request,
141  turtlebot3_applications_msgs::TakePanorama::Response& response);
142 
143  void snap();
144 
145  void rotate();
146 
147  bool hasReachedAngle();
148 
149  void odomCb(const nav_msgs::OdometryConstPtr& msg);
150 
151  void startPanoAction();
152 
153  void cameraImageCb(const sensor_msgs::ImageConstPtr& msg);
154 };
155 
156 } //namespace turtlebot_panorama
157 
158 #endif /* PANORAMA_H_ */
geometry_msgs::Twist zero_cmd_vel
Definition: panorama.h:88
ros::NodeHandle priv_nh
Definition: panorama.h:85
ros::ServiceServer srv_start_pano
Definition: panorama.h:97
void cameraImageCb(const sensor_msgs::ImageConstPtr &msg)
Definition: panorama.cpp:295
image_transport::Publisher pub_stitched
Definition: panorama.h:94
bool takePanoServiceCb(turtlebot3_applications_msgs::TakePanorama::Request &request, turtlebot3_applications_msgs::TakePanorama::Response &response)
Definition: panorama.cpp:235
ros::Publisher pub_cmd_vel
Definition: panorama.h:100
std::vector< cv::Mat > images_
Definition: panorama.h:104
image_transport::Subscriber sub_camera
Definition: panorama.h:95
ros::NodeHandle nh
Definition: panorama.h:84
void odomCb(const nav_msgs::OdometryConstPtr &msg)
Definition: panorama.cpp:207
geometry_msgs::Twist cmd_vel
Definition: panorama.h:88
void log(std::string msg)
Definition: panorama.cpp:326
std::map< std::string, std::string > params
Definition: panorama.h:86
ros::Subscriber sub_odom
Definition: panorama.h:102


turtlebot3_panorama
Author(s): Younghun Ju, Jihoon Lee, Marcus Liebhardt, Christopher Tatsch
autogenerated on Wed May 6 2020 03:15:44