stcamera_nodelet.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (C) 2018, OMRON SENTECH. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  * * Redistributions of source code must retain the above copyright notice,
9  * 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 names of OMRON SENTECH 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 
31 
32 namespace stcamera
33 {
35  {
36  }
37 
39  {
40  if (running_)
41  {
42  NODELET_INFO("Shutting down");
43  running_ = false;
44  spinThread_->join();
45  NODELET_INFO("Shutting down complete");
46  }
47  }
48 
50  {
52  node_.reset(new StCameraNode(nh));
53 
54  running_ = true;
56  (new boost::thread(boost::bind(&StCameraNodelet::spinFunc, this)));
57  };
58 
60  {
61  ros::Rate r(1);
62  while(running_)
63  {
64  node_->spin();
65  r.sleep();
66  }
67  }
68 }
boost::shared_ptr< boost::thread > spinThread_
boost::shared_ptr< StCameraNode > node_
Class implementation for stcamera_node.
Definition: stcamera_node.h:64
ros::NodeHandle & getPrivateNodeHandle() const
Nodelet implementation of stcamera_node.
PLUGINLIB_EXPORT_CLASS(stcamera::StCameraNodelet, nodelet::Nodelet)
bool sleep()
#define NODELET_INFO(...)
Nodelet implementation of stcamera_node.
virtual void onInit() override


omronsentech_camera
Author(s): OSE ROS Support
autogenerated on Tue Jul 2 2019 19:28:17