00001 /* 00002 * slam_gmapping 00003 * Copyright (c) 2008, Willow Garage, Inc. 00004 * 00005 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE 00006 * COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY 00007 * COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS 00008 * AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. 00009 * 00010 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO 00011 * BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS 00012 * CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND 00013 * CONDITIONS. 00014 * 00015 */ 00016 00017 #include <ros/ros.h> 00018 #include <nodelet/nodelet.h> 00019 #include <pluginlib/class_list_macros.h> 00020 00021 #include "slam_gmapping.h" 00022 00023 class SlamGMappingNodelet : public nodelet::Nodelet 00024 { 00025 public: 00026 SlamGMappingNodelet() {} 00027 00028 ~SlamGMappingNodelet() {} 00029 00030 virtual void onInit() 00031 { 00032 NODELET_INFO_STREAM("Initialising Slam GMapping nodelet..."); 00033 sg_.reset(new SlamGMapping(getNodeHandle(), getPrivateNodeHandle())); 00034 NODELET_INFO_STREAM("Starting live SLAM..."); 00035 sg_->startLiveSlam(); 00036 } 00037 00038 private: 00039 boost::shared_ptr<SlamGMapping> sg_; 00040 }; 00041 00042 PLUGINLIB_EXPORT_CLASS(SlamGMappingNodelet, nodelet::Nodelet)