2011-06-20 16:49:22 +00:00
|
|
|
/*
|
2014-08-11 17:03:39 +00:00
|
|
|
Copyright (c) 2010-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
|
modification, are permitted provided that the following conditions are met:
|
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
|
* Neither the name of the Universite de Sherbrooke nor the
|
|
|
|
|
names of its contributors may be used to endorse or promote products
|
|
|
|
|
derived from this software without specific prior written permission.
|
|
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
|
|
|
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
2011-06-20 16:49:22 +00:00
|
|
|
|
|
|
|
|
#ifndef COREWRAPPER_H_
|
|
|
|
|
#define COREWRAPPER_H_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <ros/ros.h>
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
#include <std_srvs/Empty.h>
|
|
|
|
|
|
2015-05-14 00:42:21 -04:00
|
|
|
#include <tf/transform_listener.h>
|
|
|
|
|
#include <tf2_ros/transform_broadcaster.h>
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
#include <std_msgs/Empty.h>
|
2015-01-30 15:31:44 -05:00
|
|
|
#include <std_msgs/Int32.h>
|
2013-12-11 00:12:44 +00:00
|
|
|
#include <sensor_msgs/PointCloud2.h>
|
|
|
|
|
#include <sensor_msgs/Image.h>
|
|
|
|
|
#include <sensor_msgs/CameraInfo.h>
|
|
|
|
|
#include <sensor_msgs/LaserScan.h>
|
|
|
|
|
#include <nav_msgs/Odometry.h>
|
2015-02-11 17:09:29 -05:00
|
|
|
#include <nav_msgs/GetMap.h>
|
2013-12-11 00:12:44 +00:00
|
|
|
|
|
|
|
|
#include <rtabmap/core/Parameters.h>
|
|
|
|
|
#include <rtabmap/core/Rtabmap.h>
|
|
|
|
|
|
2014-11-25 17:13:15 -05:00
|
|
|
#include "rtabmap_ros/GetMap.h"
|
2015-03-06 16:17:09 -05:00
|
|
|
#include "rtabmap_ros/ListLabels.h"
|
2014-11-25 17:13:15 -05:00
|
|
|
#include "rtabmap_ros/PublishMap.h"
|
2015-02-06 13:56:20 -05:00
|
|
|
#include "rtabmap_ros/SetGoal.h"
|
2015-02-27 15:26:30 -05:00
|
|
|
#include "rtabmap_ros/SetLabel.h"
|
2014-07-06 19:58:15 +00:00
|
|
|
|
2015-05-14 02:16:19 -04:00
|
|
|
#include "MapsManager.h"
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
#include <message_filters/subscriber.h>
|
|
|
|
|
#include <message_filters/synchronizer.h>
|
|
|
|
|
#include <message_filters/sync_policies/approximate_time.h>
|
2014-11-14 19:16:16 +00:00
|
|
|
#include <message_filters/sync_policies/exact_time.h>
|
2013-12-11 00:12:44 +00:00
|
|
|
|
|
|
|
|
#include <image_transport/image_transport.h>
|
|
|
|
|
#include <image_transport/subscriber_filter.h>
|
2011-06-20 16:49:22 +00:00
|
|
|
|
2015-05-01 13:41:08 -04:00
|
|
|
#ifdef WITH_OCTOMAP
|
|
|
|
|
#include <octomap_msgs/GetOctomap.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-02-06 15:27:02 -05:00
|
|
|
#include <actionlib/client/simple_action_client.h>
|
|
|
|
|
#include <move_base_msgs/MoveBaseAction.h>
|
|
|
|
|
#include <move_base_msgs/MoveBaseActionGoal.h>
|
|
|
|
|
#include <move_base_msgs/MoveBaseActionResult.h>
|
|
|
|
|
#include <move_base_msgs/MoveBaseActionFeedback.h>
|
|
|
|
|
#include <actionlib_msgs/GoalStatusArray.h>
|
|
|
|
|
typedef actionlib::SimpleActionClient<move_base_msgs::MoveBaseAction> MoveBaseClient;
|
|
|
|
|
|
2013-02-03 22:12:44 +00:00
|
|
|
class CoreWrapper
|
2011-06-20 16:49:22 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2014-10-28 01:23:52 +00:00
|
|
|
CoreWrapper(bool deleteDbOnStart);
|
2011-06-20 16:49:22 +00:00
|
|
|
virtual ~CoreWrapper();
|
|
|
|
|
|
|
|
|
|
private:
|
2015-05-31 01:28:54 -04:00
|
|
|
void setupCallbacks(
|
|
|
|
|
bool subscribeDepth,
|
|
|
|
|
bool subscribeLaserScan,
|
|
|
|
|
bool subscribeStereo,
|
|
|
|
|
int queueSize,
|
|
|
|
|
bool stereoApproxSync,
|
|
|
|
|
int depthCameras);
|
2013-12-11 00:12:44 +00:00
|
|
|
void defaultCallback(const sensor_msgs::ImageConstPtr & imageMsg); // no odom
|
2014-12-18 16:58:23 -05:00
|
|
|
|
2015-02-23 18:27:53 -05:00
|
|
|
bool commonOdomUpdate(const nav_msgs::OdometryConstPtr & odomMsg);
|
|
|
|
|
bool commonOdomTFUpdate(const ros::Time & stamp); // TF odom
|
2015-05-03 18:23:56 -04:00
|
|
|
rtabmap::Transform getTransform(const std::string & fromFrameId, const std::string & toFrameId, const ros::Time & stamp) const;
|
2015-02-23 18:27:53 -05:00
|
|
|
|
|
|
|
|
void commonDepthCallback(
|
|
|
|
|
const std::string & odomFrameId,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageMsg,
|
2015-05-31 01:28:54 -04:00
|
|
|
const sensor_msgs::ImageConstPtr& depthMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& cameraInfoMsg,
|
|
|
|
|
const sensor_msgs::LaserScanConstPtr& scanMsg);
|
|
|
|
|
void commonDepthCallback(
|
|
|
|
|
const std::string & odomFrameId,
|
|
|
|
|
const std::vector<sensor_msgs::ImageConstPtr> & imageMsgs,
|
|
|
|
|
const std::vector<sensor_msgs::ImageConstPtr> & depthMsgs,
|
|
|
|
|
const std::vector<sensor_msgs::CameraInfoConstPtr> & cameraInfoMsgs,
|
2015-02-23 18:27:53 -05:00
|
|
|
const sensor_msgs::LaserScanConstPtr& scanMsg);
|
|
|
|
|
void commonStereoCallback(
|
|
|
|
|
const std::string & odomFrameId,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& leftImageMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& rightImageMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& leftCamInfoMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& rightCamInfoMsg,
|
|
|
|
|
const sensor_msgs::LaserScanConstPtr& scanMsg);
|
|
|
|
|
|
|
|
|
|
// with odom msg
|
|
|
|
|
void depthCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageMsg,
|
|
|
|
|
const nav_msgs::OdometryConstPtr & odomMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageDepthMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& camInfoMsg);
|
|
|
|
|
void depthScanCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageMsg,
|
|
|
|
|
const nav_msgs::OdometryConstPtr & odomMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageDepthMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& camInfoMsg,
|
|
|
|
|
const sensor_msgs::LaserScanConstPtr& scanMsg);
|
|
|
|
|
void stereoCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& leftImageMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& rightImageMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& leftCamInfoMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& rightCamInfoMsg,
|
|
|
|
|
const nav_msgs::OdometryConstPtr & odomMsg);
|
|
|
|
|
void stereoScanCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& leftImageMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& rightImageMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& leftCamInfoMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& rightCamInfoMsg,
|
|
|
|
|
const sensor_msgs::LaserScanConstPtr& scanMsg,
|
|
|
|
|
const nav_msgs::OdometryConstPtr & odomMsg);
|
2015-05-31 01:28:54 -04:00
|
|
|
void depth2Callback(
|
|
|
|
|
const nav_msgs::OdometryConstPtr & odomMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& image1Msg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageDepth1Msg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& camInfo1Msg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& image2Msg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageDept2hMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& camInfo2Msg);
|
2015-02-23 18:27:53 -05:00
|
|
|
|
|
|
|
|
// without odom, when TF is used for odom
|
|
|
|
|
void depthTFCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageDepthMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& camInfoMsg);
|
|
|
|
|
void depthScanTFCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& imageDepthMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& camInfoMsg,
|
|
|
|
|
const sensor_msgs::LaserScanConstPtr& scanMsg);
|
|
|
|
|
void stereoTFCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& leftImageMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& rightImageMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& leftCamInfoMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& rightCamInfoMsg);
|
|
|
|
|
void stereoScanTFCallback(
|
|
|
|
|
const sensor_msgs::ImageConstPtr& leftImageMsg,
|
|
|
|
|
const sensor_msgs::ImageConstPtr& rightImageMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& leftCamInfoMsg,
|
|
|
|
|
const sensor_msgs::CameraInfoConstPtr& rightCamInfoMsg,
|
|
|
|
|
const sensor_msgs::LaserScanConstPtr& scanMsg);
|
2015-02-06 13:56:20 -05:00
|
|
|
|
2015-02-17 17:31:03 -05:00
|
|
|
void goalCommonCallback(const std::vector<std::pair<int, rtabmap::Transform> > & poses);
|
2015-02-06 13:56:20 -05:00
|
|
|
void goalCallback(const geometry_msgs::PoseStampedConstPtr & msg);
|
2015-02-03 11:16:06 -05:00
|
|
|
void updateGoal(const ros::Time & stamp);
|
2011-06-20 16:49:22 +00:00
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
void process(
|
2015-02-27 15:26:30 -05:00
|
|
|
const ros::Time & stamp,
|
2015-05-31 01:28:54 -04:00
|
|
|
const rtabmap::SensorData & data,
|
2013-12-11 00:12:44 +00:00
|
|
|
const rtabmap::Transform & odom = rtabmap::Transform(),
|
|
|
|
|
const std::string & odomFrameId = "",
|
2015-05-30 20:08:20 -04:00
|
|
|
double odomRotationalVariance = 1.0,
|
2015-05-31 01:28:54 -04:00
|
|
|
double odomTransitionalVariance = 1.0);
|
2011-06-20 16:49:22 +00:00
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
bool updateRtabmapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
|
|
|
|
bool resetRtabmapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
|
|
|
|
bool pauseRtabmapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
|
|
|
|
bool resumeRtabmapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
|
|
|
|
bool triggerNewMapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
2015-03-20 15:17:01 -04:00
|
|
|
bool backupDatabaseCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
2014-07-09 21:12:24 +00:00
|
|
|
bool setModeLocalizationCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
|
|
|
|
bool setModeMappingCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
2015-02-11 17:09:29 -05:00
|
|
|
bool getMapCallback(rtabmap_ros::GetMap::Request& req, rtabmap_ros::GetMap::Response& res);
|
|
|
|
|
bool getProjMapCallback(nav_msgs::GetMap::Request &req, nav_msgs::GetMap::Response &res);
|
|
|
|
|
bool getGridMapCallback(nav_msgs::GetMap::Request &req, nav_msgs::GetMap::Response &res);
|
2014-11-25 17:13:15 -05:00
|
|
|
bool publishMapCallback(rtabmap_ros::PublishMap::Request&, rtabmap_ros::PublishMap::Response&);
|
2015-02-06 13:56:20 -05:00
|
|
|
bool setGoalCallback(rtabmap_ros::SetGoal::Request& req, rtabmap_ros::SetGoal::Response& res);
|
2015-06-21 20:17:31 -04:00
|
|
|
bool cancelGoalCallback(std_srvs::Empty::Request& req, std_srvs::Empty::Response& res);
|
2015-02-27 15:26:30 -05:00
|
|
|
bool setLabelCallback(rtabmap_ros::SetLabel::Request& req, rtabmap_ros::SetLabel::Response& res);
|
2015-03-06 16:17:09 -05:00
|
|
|
bool listLabelsCallback(rtabmap_ros::ListLabels::Request& req, rtabmap_ros::ListLabels::Response& res);
|
2015-05-01 13:41:08 -04:00
|
|
|
#ifdef WITH_OCTOMAP
|
2015-02-20 19:00:31 -05:00
|
|
|
bool octomapBinaryCallback(octomap_msgs::GetOctomap::Request &req, octomap_msgs::GetOctomap::Response &res);
|
|
|
|
|
bool octomapFullCallback(octomap_msgs::GetOctomap::Request &req, octomap_msgs::GetOctomap::Response &res);
|
2015-05-01 13:41:08 -04:00
|
|
|
#endif
|
2013-12-11 00:12:44 +00:00
|
|
|
|
|
|
|
|
rtabmap::ParametersMap loadParameters(const std::string & configFile);
|
|
|
|
|
void saveParameters(const std::string & configFile);
|
|
|
|
|
|
|
|
|
|
void publishLoop(double tfDelay);
|
2011-06-20 16:49:22 +00:00
|
|
|
|
2015-02-11 17:09:29 -05:00
|
|
|
void publishStats(const ros::Time & stamp);
|
2015-02-06 13:56:20 -05:00
|
|
|
void publishCurrentGoal(const ros::Time & stamp);
|
2015-02-06 15:27:02 -05:00
|
|
|
void goalDoneCb(const actionlib::SimpleClientGoalState& state, const move_base_msgs::MoveBaseResultConstPtr& result);
|
|
|
|
|
void goalActiveCb();
|
|
|
|
|
void goalFeedbackCb(const move_base_msgs::MoveBaseFeedbackConstPtr& feedback);
|
2015-02-03 11:16:06 -05:00
|
|
|
void publishLocalPath(const ros::Time & stamp);
|
2011-06-20 16:49:22 +00:00
|
|
|
|
|
|
|
|
private:
|
2013-12-11 00:12:44 +00:00
|
|
|
rtabmap::Rtabmap rtabmap_;
|
|
|
|
|
bool paused_;
|
2014-12-18 16:58:23 -05:00
|
|
|
rtabmap::Transform lastPose_;
|
2015-05-03 18:23:56 -04:00
|
|
|
ros::Time lastPoseStamp_;
|
2015-05-30 20:08:20 -04:00
|
|
|
double rotVariance_;
|
|
|
|
|
double transVariance_;
|
2015-01-30 15:31:44 -05:00
|
|
|
rtabmap::Transform currentMetricGoal_;
|
2015-03-05 15:26:50 -05:00
|
|
|
bool latestNodeWasReached_;
|
2015-03-20 15:17:01 -04:00
|
|
|
rtabmap::ParametersMap parameters_;
|
2013-12-11 00:12:44 +00:00
|
|
|
|
|
|
|
|
std::string frameId_;
|
|
|
|
|
std::string mapFrameId_;
|
|
|
|
|
std::string odomFrameId_;
|
2013-04-30 20:25:52 +00:00
|
|
|
std::string configPath_;
|
2014-10-28 01:23:52 +00:00
|
|
|
std::string databasePath_;
|
2014-12-03 22:35:43 -05:00
|
|
|
bool waitForTransform_;
|
2015-08-14 15:01:51 -04:00
|
|
|
double waitForTransformDuration_;
|
2015-02-06 15:27:02 -05:00
|
|
|
bool useActionForGoal_;
|
2015-05-31 01:28:54 -04:00
|
|
|
bool genScan_;
|
|
|
|
|
double genScanMaxDepth_;
|
2011-06-20 16:49:22 +00:00
|
|
|
|
2015-05-14 00:42:21 -04:00
|
|
|
rtabmap::Transform mapToOdom_;
|
2013-12-11 00:12:44 +00:00
|
|
|
boost::mutex mapToOdomMutex_;
|
|
|
|
|
|
2015-05-14 02:16:19 -04:00
|
|
|
MapsManager mapsManager_;
|
2015-02-11 17:09:29 -05:00
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
ros::Publisher infoPub_;
|
2015-02-11 17:09:29 -05:00
|
|
|
ros::Publisher mapDataPub_;
|
2015-09-15 16:40:07 -04:00
|
|
|
ros::Publisher mapGraphPub_;
|
2015-03-06 16:17:09 -05:00
|
|
|
ros::Publisher labelsPub_;
|
2013-12-11 00:12:44 +00:00
|
|
|
|
2015-01-30 15:31:44 -05:00
|
|
|
//Planning stuff
|
2015-02-06 13:56:20 -05:00
|
|
|
ros::Subscriber goalSub_;
|
2015-01-30 15:31:44 -05:00
|
|
|
ros::Publisher nextMetricGoalPub_;
|
|
|
|
|
ros::Publisher goalReachedPub_;
|
2015-02-03 11:16:06 -05:00
|
|
|
ros::Publisher globalPathPub_;
|
|
|
|
|
ros::Publisher localPathPub_;
|
2015-01-30 15:31:44 -05:00
|
|
|
|
2014-10-16 00:17:11 +00:00
|
|
|
// for loop closure detection only
|
2013-12-11 00:12:44 +00:00
|
|
|
image_transport::Subscriber defaultSub_;
|
2014-10-16 00:17:11 +00:00
|
|
|
|
|
|
|
|
//for depth callback
|
2015-05-31 01:28:54 -04:00
|
|
|
std::vector<image_transport::SubscriberFilter*> imageSubs_;
|
|
|
|
|
std::vector<image_transport::SubscriberFilter*> imageDepthSubs_;
|
|
|
|
|
std::vector<message_filters::Subscriber<sensor_msgs::CameraInfo>*> cameraInfoSubs_;
|
2014-10-16 00:17:11 +00:00
|
|
|
|
|
|
|
|
//stereo callback
|
|
|
|
|
image_transport::SubscriberFilter imageRectLeft_;
|
|
|
|
|
image_transport::SubscriberFilter imageRectRight_;
|
|
|
|
|
message_filters::Subscriber<sensor_msgs::CameraInfo> cameraInfoLeft_;
|
|
|
|
|
message_filters::Subscriber<sensor_msgs::CameraInfo> cameraInfoRight_;
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
message_filters::Subscriber<nav_msgs::Odometry> odomSub_;
|
|
|
|
|
message_filters::Subscriber<sensor_msgs::LaserScan> scanSub_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
nav_msgs::Odometry,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::LaserScan> MyDepthScanSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyDepthScanSyncPolicy> * depthScanSync_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
nav_msgs::Odometry,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo> MyDepthSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyDepthSyncPolicy> * depthSync_;
|
|
|
|
|
|
2014-10-16 00:17:11 +00:00
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::LaserScan,
|
|
|
|
|
nav_msgs::Odometry> MyStereoScanSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyStereoScanSyncPolicy> * stereoScanSync_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
2014-11-14 19:16:16 +00:00
|
|
|
nav_msgs::Odometry> MyStereoApproxSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyStereoApproxSyncPolicy> * stereoApproxSync_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ExactTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
nav_msgs::Odometry> MyStereoExactSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyStereoExactSyncPolicy> * stereoExactSync_;
|
2014-10-16 00:17:11 +00:00
|
|
|
|
2015-05-31 01:28:54 -04:00
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
nav_msgs::Odometry,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo> MyDepth2SyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyDepth2SyncPolicy> * depth2Sync_;
|
|
|
|
|
|
2015-02-23 18:27:53 -05:00
|
|
|
// without odom, when TF is used for odom
|
|
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::LaserScan> MyDepthScanTFSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyDepthScanTFSyncPolicy> * depthScanTFSync_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo> MyDepthTFSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyDepthTFSyncPolicy> * depthTFSync_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::LaserScan> MyStereoScanTFSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyStereoScanTFSyncPolicy> * stereoScanTFSync_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ApproximateTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::CameraInfo> MyStereoApproxTFSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyStereoApproxTFSyncPolicy> * stereoApproxTFSync_;
|
|
|
|
|
|
|
|
|
|
typedef message_filters::sync_policies::ExactTime<
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::Image,
|
|
|
|
|
sensor_msgs::CameraInfo,
|
|
|
|
|
sensor_msgs::CameraInfo> MyStereoExactTFSyncPolicy;
|
|
|
|
|
message_filters::Synchronizer<MyStereoExactTFSyncPolicy> * stereoExactTFSync_;
|
|
|
|
|
|
2015-05-14 00:42:21 -04:00
|
|
|
tf2_ros::TransformBroadcaster tfBroadcaster_;
|
2013-12-11 00:12:44 +00:00
|
|
|
tf::TransformListener tfListener_;
|
|
|
|
|
|
|
|
|
|
ros::ServiceServer updateSrv_;
|
|
|
|
|
ros::ServiceServer resetSrv_;
|
|
|
|
|
ros::ServiceServer pauseSrv_;
|
|
|
|
|
ros::ServiceServer resumeSrv_;
|
|
|
|
|
ros::ServiceServer triggerNewMapSrv_;
|
2015-03-20 15:17:01 -04:00
|
|
|
ros::ServiceServer backupDatabase_;
|
2014-07-09 21:12:24 +00:00
|
|
|
ros::ServiceServer setModeLocalizationSrv_;
|
|
|
|
|
ros::ServiceServer setModeMappingSrv_;
|
2014-07-06 19:58:15 +00:00
|
|
|
ros::ServiceServer getMapDataSrv_;
|
2015-02-11 17:09:29 -05:00
|
|
|
ros::ServiceServer getProjMapSrv_;
|
|
|
|
|
ros::ServiceServer getGridMapSrv_;
|
2014-08-13 19:25:44 +00:00
|
|
|
ros::ServiceServer publishMapDataSrv_;
|
2015-02-06 13:56:20 -05:00
|
|
|
ros::ServiceServer setGoalSrv_;
|
2015-06-21 20:17:31 -04:00
|
|
|
ros::ServiceServer cancelGoalSrv_;
|
2015-02-27 15:26:30 -05:00
|
|
|
ros::ServiceServer setLabelSrv_;
|
2015-03-06 16:17:09 -05:00
|
|
|
ros::ServiceServer listLabelsSrv_;
|
2015-05-01 13:41:08 -04:00
|
|
|
#ifdef WITH_OCTOMAP
|
2015-02-20 19:00:31 -05:00
|
|
|
ros::ServiceServer octomapBinarySrv_;
|
|
|
|
|
ros::ServiceServer octomapFullSrv_;
|
2015-05-01 13:41:08 -04:00
|
|
|
#endif
|
2013-12-11 00:12:44 +00:00
|
|
|
|
2015-02-06 15:27:02 -05:00
|
|
|
MoveBaseClient mbClient_;
|
|
|
|
|
|
2013-12-11 00:12:44 +00:00
|
|
|
boost::thread* transformThread_;
|
|
|
|
|
|
|
|
|
|
float rate_;
|
|
|
|
|
ros::Time time_;
|
2011-06-20 16:49:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* COREWRAPPER_H_ */
|