mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +08:00
ros-pkg:
-changed rtabmap service names publish_full_map_data -> publish_global_map_data and publish_current_map_data -> publish_local_map_data -added demo_multi-session_mapping.launch git-svn-id: http://rtabmap.googlecode.com/svn/trunk/ros-pkg@1118 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
<launch>
|
||||||
|
|
||||||
|
<!-- MULTI-SESSION MAPPING VERSION -->
|
||||||
|
|
||||||
|
<param name="use_sim_time" type="bool" value="True"/>
|
||||||
|
|
||||||
|
<!-- SLAM (robot side) -->
|
||||||
|
<!-- args: "delete_db_on_start" and "udebug" -->
|
||||||
|
<node name="rtabmap" pkg="rtabmap" type="rtabmap" output="screen" args="">
|
||||||
|
<param name="frame_id" type="string" value="base_footprint"/>
|
||||||
|
|
||||||
|
<param name="subscribe_depth" type="bool" value="true"/>
|
||||||
|
<param name="subscribe_laserScan" type="bool" value="true"/>
|
||||||
|
|
||||||
|
<remap from="odom" to="/base_controller/odom"/>
|
||||||
|
<remap from="scan" to="/base_scan"/>
|
||||||
|
|
||||||
|
<remap from="rgb/image" to="data_throttled_image"/>
|
||||||
|
<remap from="depth/image" to="data_throttled_image_depth"/>
|
||||||
|
<remap from="rgb/camera_info" to="data_throttled_camera_info"/>
|
||||||
|
|
||||||
|
<param name="rgb/image_transport" type="string" value="compressed"/>
|
||||||
|
<param name="depth/image_transport" type="string" value="compressedDepth"/>
|
||||||
|
|
||||||
|
<param name="queue_size" type="int" value="10"/>
|
||||||
|
|
||||||
|
<!-- RTAB-Map's parameters: do "rosrun rtabmap rtabmap (double-dash)params" to see the list of available parameters. -->
|
||||||
|
<param name="RGBD/ScanMatchingSize" type="string" value="0"/>
|
||||||
|
<param name="RGBD/LocalLoopDetectionSpace" type="string" value="false"/>
|
||||||
|
<param name="RGBD/LocalLoopDetectionTime" type="string" value="false"/>
|
||||||
|
<param name="Mem/BadSignaturesIgnored" type="string" value="false"/>
|
||||||
|
<param name="LccIcp/Type" type="string" value="1"/>
|
||||||
|
<param name="LccIcp2/Iterations" type="string" value="100"/>
|
||||||
|
<param name="LccIcp2/VoxelSize" type="string" value="0"/>
|
||||||
|
<param name="LccBow/MinInliers" type="string" value="5"/>
|
||||||
|
<param name="LccBow/MaxDepth" type="string" value="4.0"/>
|
||||||
|
<param name="LccBow/InlierDistance" type="string" value="0.1"/>
|
||||||
|
<param name="RGBD/AngularUpdate" type="string" value="0.01"/>
|
||||||
|
<param name="RGBD/LinearUpdate" type="string" value="0.01"/>
|
||||||
|
<param name="Rtabmap/TimeThr" type="string" value="700"/>
|
||||||
|
<param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
|
||||||
|
</node>
|
||||||
|
|
||||||
|
<!-- Visualisation (client side) -->
|
||||||
|
<node pkg="rtabmap" type="rtabmapviz" name="rtabmapviz" args="-d $(find rtabmap)/launch/config/rgbd_gui.ini" output="screen">
|
||||||
|
<param name="subscribe_depth" type="bool" value="true"/>
|
||||||
|
<param name="subscribe_laserScan" type="bool" value="true"/>
|
||||||
|
<param name="queue_size" type="int" value="10"/>
|
||||||
|
<param name="frame_id" type="string" value="base_footprint"/>
|
||||||
|
|
||||||
|
<remap from="rgb/image" to="data_throttled_image"/>
|
||||||
|
<remap from="depth/image" to="data_throttled_image_depth"/>
|
||||||
|
<remap from="rgb/camera_info" to="data_throttled_camera_info"/>
|
||||||
|
<remap from="scan" to="/base_scan"/>
|
||||||
|
<remap from="odom" to="/base_controller/odom"/>
|
||||||
|
|
||||||
|
<param name="rgb/image_transport" type="string" value="compressed"/>
|
||||||
|
<param name="depth/image_transport" type="string" value="compressedDepth"/>
|
||||||
|
</node>
|
||||||
|
|
||||||
|
</launch>
|
||||||
@@ -9,7 +9,7 @@ int32 refId
|
|||||||
int32 loopClosureId
|
int32 loopClosureId
|
||||||
int32 localLoopClosureId
|
int32 localLoopClosureId
|
||||||
|
|
||||||
# The map data (rgb, depth, depthConstant, depth2D, localTransform, poses, map ids)
|
# The map data (rgb, depth, depthConstant, depth2D, localTransform, poses, constraints, map ids)
|
||||||
rtabmap/MapData data
|
rtabmap/MapData data
|
||||||
|
|
||||||
geometry_msgs/Transform mapCorrection
|
geometry_msgs/Transform mapCorrection
|
||||||
@@ -18,7 +18,7 @@ geometry_msgs/Transform loopClosureTransform
|
|||||||
geometry_msgs/Pose currentPose
|
geometry_msgs/Pose currentPose
|
||||||
|
|
||||||
####
|
####
|
||||||
# For statistics and visualization below...
|
# For statistics and visualization ...
|
||||||
####
|
####
|
||||||
# std::map<int, float> posterior;
|
# std::map<int, float> posterior;
|
||||||
int32[] posteriorKeys
|
int32[] posteriorKeys
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ CoreWrapper::CoreWrapper(bool deleteDbOnStart) :
|
|||||||
}
|
}
|
||||||
if(paused_)
|
if(paused_)
|
||||||
{
|
{
|
||||||
UWARN("Node paused... dont' forget to call service \"pause_rtabmap\" to start rtabmap.");
|
UWARN("Node paused... dont' forget to call service \"resume\" to start rtabmap.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init RTAB-Map
|
// Init RTAB-Map
|
||||||
@@ -172,8 +172,8 @@ CoreWrapper::CoreWrapper(bool deleteDbOnStart) :
|
|||||||
pauseSrv_ = nh.advertiseService("pause", &CoreWrapper::pauseRtabmapCallback, this);
|
pauseSrv_ = nh.advertiseService("pause", &CoreWrapper::pauseRtabmapCallback, this);
|
||||||
resumeSrv_ = nh.advertiseService("resume", &CoreWrapper::resumeRtabmapCallback, this);
|
resumeSrv_ = nh.advertiseService("resume", &CoreWrapper::resumeRtabmapCallback, this);
|
||||||
triggerNewMapSrv_ = nh.advertiseService("trigger_new_map", &CoreWrapper::triggerNewMapCallback, this);
|
triggerNewMapSrv_ = nh.advertiseService("trigger_new_map", &CoreWrapper::triggerNewMapCallback, this);
|
||||||
publishFullMapDataSrv_ = nh.advertiseService("publish_full_map_data", &CoreWrapper::publishFullMapDataCallback, this);
|
publishGlobalMapDataSrv_ = nh.advertiseService("publish_global_map_data", &CoreWrapper::publishGlobalMapDataCallback, this);
|
||||||
publishCurrentMapDataSrv_ = nh.advertiseService("publish_current_map_data", &CoreWrapper::publishCurrentMapDataCallback, this);
|
publishLocalMapDataSrv_ = nh.advertiseService("publish_local_map_data", &CoreWrapper::publishLocalMapDataCallback, this);
|
||||||
|
|
||||||
|
|
||||||
setupCallbacks(subscribeDepth, subscribeLaserScan, queueSize);
|
setupCallbacks(subscribeDepth, subscribeLaserScan, queueSize);
|
||||||
@@ -604,21 +604,21 @@ bool CoreWrapper::triggerNewMapCallback(std_srvs::Empty::Request&, std_srvs::Emp
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CoreWrapper::publishFullMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&)
|
bool CoreWrapper::publishGlobalMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&)
|
||||||
{
|
{
|
||||||
publishMapData(true);
|
publishMapData(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CoreWrapper::publishCurrentMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&)
|
bool CoreWrapper::publishLocalMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&)
|
||||||
{
|
{
|
||||||
publishMapData(false);
|
publishMapData(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreWrapper::publishMapData(bool full)
|
void CoreWrapper::publishMapData(bool global)
|
||||||
{
|
{
|
||||||
ROS_INFO("rtabmap: Publishing map data (full=%s)...", full?"true":"false");
|
ROS_INFO("rtabmap: Publishing map data (global=%s)...", global?"true":"false");
|
||||||
std::map<int, std::vector<unsigned char> > images;
|
std::map<int, std::vector<unsigned char> > images;
|
||||||
std::map<int, std::vector<unsigned char> > depths;
|
std::map<int, std::vector<unsigned char> > depths;
|
||||||
std::map<int, std::vector<unsigned char> > depths2d;
|
std::map<int, std::vector<unsigned char> > depths2d;
|
||||||
@@ -640,7 +640,7 @@ void CoreWrapper::publishMapData(bool full)
|
|||||||
poses,
|
poses,
|
||||||
constraints,
|
constraints,
|
||||||
true,
|
true,
|
||||||
full);
|
global);
|
||||||
|
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
|
|||||||
@@ -74,10 +74,10 @@ private:
|
|||||||
bool pauseRtabmapCallback(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 resumeRtabmapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
||||||
bool triggerNewMapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
bool triggerNewMapCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
||||||
bool publishFullMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
bool publishGlobalMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
||||||
bool publishCurrentMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
bool publishLocalMapDataCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&);
|
||||||
|
|
||||||
void publishMapData(bool full);
|
void publishMapData(bool global);
|
||||||
|
|
||||||
rtabmap::ParametersMap loadParameters(const std::string & configFile);
|
rtabmap::ParametersMap loadParameters(const std::string & configFile);
|
||||||
void saveParameters(const std::string & configFile);
|
void saveParameters(const std::string & configFile);
|
||||||
@@ -138,8 +138,8 @@ private:
|
|||||||
ros::ServiceServer pauseSrv_;
|
ros::ServiceServer pauseSrv_;
|
||||||
ros::ServiceServer resumeSrv_;
|
ros::ServiceServer resumeSrv_;
|
||||||
ros::ServiceServer triggerNewMapSrv_;
|
ros::ServiceServer triggerNewMapSrv_;
|
||||||
ros::ServiceServer publishFullMapDataSrv_;
|
ros::ServiceServer publishGlobalMapDataSrv_;
|
||||||
ros::ServiceServer publishCurrentMapDataSrv_;
|
ros::ServiceServer publishLocalMapDataSrv_;
|
||||||
|
|
||||||
boost::thread* transformThread_;
|
boost::thread* transformThread_;
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class DataRecorderWrapper
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DataRecorderWrapper() :
|
DataRecorderWrapper() :
|
||||||
fileName_(""),
|
fileName_("output.db"),
|
||||||
frameId_("base_link"),
|
frameId_("base_link"),
|
||||||
depthScanSync_(0),
|
depthScanSync_(0),
|
||||||
depthSync_(0),
|
depthSync_(0),
|
||||||
|
|||||||
@@ -419,9 +419,9 @@ void GuiWrapper::handleEvent(UEvent * anEvent)
|
|||||||
{
|
{
|
||||||
if(mapDataTopic_.getNumPublishers())
|
if(mapDataTopic_.getNumPublishers())
|
||||||
{
|
{
|
||||||
if(!ros::service::call("publish_current_map_data", srv))
|
if(!ros::service::call("publish_local_map_data", srv))
|
||||||
{
|
{
|
||||||
ROS_WARN("Can't call \"publish_current_map_data\" service");
|
ROS_WARN("Can't call \"publish_local_map_data\" service");
|
||||||
this->post(new RtabmapEvent3DMap(1)); // service error
|
this->post(new RtabmapEvent3DMap(1)); // service error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,9 +435,9 @@ void GuiWrapper::handleEvent(UEvent * anEvent)
|
|||||||
{
|
{
|
||||||
if(mapDataTopic_.getNumPublishers())
|
if(mapDataTopic_.getNumPublishers())
|
||||||
{
|
{
|
||||||
if(!ros::service::call("publish_full_map_data", srv))
|
if(!ros::service::call("publish_global_map_data", srv))
|
||||||
{
|
{
|
||||||
ROS_WARN("Can't call \"publish_full_map_data\" service");
|
ROS_WARN("Can't call \"publish_global_map_data\" service");
|
||||||
this->post(new RtabmapEvent3DMap(1)); // service error
|
this->post(new RtabmapEvent3DMap(1)); // service error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user