zr300_nodelet.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (c) 2016, Intel Corporation
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  1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 
11  2. Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  3. Neither the name of the copyright holder nor the names of its contributors
16  may be used to endorse or promote products derived from this software without
17  specific prior written permission.
18 
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *******************************************************************************/
30 
31 #pragma once
32 #ifndef REALSENSE_CAMERA_ZR300_NODELET_H
33 #define REALSENSE_CAMERA_ZR300_NODELET_H
34 
35 #include <string>
36 #include <vector>
37 
38 #include <dynamic_reconfigure/server.h>
39 #include <sensor_msgs/Imu.h>
40 
41 #include <realsense_camera/zr300_paramsConfig.h>
42 #include <realsense_camera/IMUInfo.h>
43 #include <realsense_camera/GetIMUInfo.h>
45 
46 namespace realsense_camera
47 {
49 {
50 public:
51  ~ZR300Nodelet();
52  void onInit();
53 
54 protected:
55  // Member Variables.
59  std::string imu_frame_id_;
60  std::string imu_optical_frame_id_;
61  geometry_msgs::Vector3 imu_angular_vel_;
62  geometry_msgs::Vector3 imu_linear_accel_;
63  double imu_ts_;
64  double prev_imu_ts_;
67  std::function<void(rs::motion_data)> motion_handler_;
68  std::function<void(rs::timestamp_data)> timestamp_handler_;
69  std::mutex imu_mutex_;
70 
71  rs_extrinsics color2ir2_extrinsic_; // color frame is base frame
72  rs_extrinsics color2fisheye_extrinsic_; // color frame is base frame
73  rs_extrinsics color2imu_extrinsic_; // color frame is base frame
74 
75  // Member Functions.
76  void getParameters();
77  void advertiseTopics();
78  void advertiseServices();
79  bool getIMUInfo(realsense_camera::GetIMUInfo::Request & req, realsense_camera::GetIMUInfo::Response & res);
80  std::vector<std::string> setDynamicReconfServer();
84  void configCallback(realsense_camera::zr300_paramsConfig &config, uint32_t level);
85  void getCameraExtrinsics();
88  void publishIMU();
89  void setStreams();
90  void setIMUCallbacks();
91  void setFrameCallbacks();
92  std::function<void(rs::frame f)> fisheye_frame_handler_, ir2_frame_handler_;
93  void stopIMU();
94 };
95 } // namespace realsense_camera
96 #endif // REALSENSE_CAMERA_ZR300_NODELET_H
std::function< void(rs::frame f)> ir2_frame_handler_
Definition: zr300_nodelet.h:92
std::vector< std::string > setDynamicReconfServer()
void setDynamicReconfigDepthControlPreset(int preset)
bool getIMUInfo(realsense_camera::GetIMUInfo::Request &req, realsense_camera::GetIMUInfo::Response &res)
std::function< void(rs::frame f)> fisheye_frame_handler_
Definition: zr300_nodelet.h:92
GLint level
geometry_msgs::Vector3 imu_angular_vel_
Definition: zr300_nodelet.h:61
std::function< void(rs::motion_data)> motion_handler_
Definition: zr300_nodelet.h:67
boost::shared_ptr< dynamic_reconfigure::Server< realsense_camera::zr300_paramsConfig > > dynamic_reconf_server_
Definition: zr300_nodelet.h:57
ros::ServiceServer get_imu_info_
Definition: zr300_nodelet.h:56
void configCallback(realsense_camera::zr300_paramsConfig &config, uint32_t level)
boost::shared_ptr< boost::thread > imu_thread_
Definition: zr300_nodelet.h:66
geometry_msgs::Vector3 imu_linear_accel_
Definition: zr300_nodelet.h:62
GLuint res
std::function< void(rs::timestamp_data)> timestamp_handler_
Definition: zr300_nodelet.h:68
rs_extrinsics color2fisheye_extrinsic_
Definition: zr300_nodelet.h:72
preset
std::string setDynamicReconfigDepthControlIndividuals()


realsense_camera
Author(s): Rajvi Jingar , Reagan Lopez , Matt Hansen , Mark Horn
autogenerated on Mon Jun 10 2019 14:40:37