rtabmap: added republish_node_data input topic to request rtabmap to republish data of some nodes. max_nodes_republished parameter (default 2) limits the number of nodes republished at each update.

This commit is contained in:
matlabbe
2021-09-13 18:22:56 -04:00
parent a324562ee0
commit d21842408d
4 changed files with 119 additions and 10 deletions
+6 -2
View File
@@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <std_msgs/Empty.h>
#include <std_msgs/Int32.h>
#include "std_msgs/Int32MultiArray.h"
#include <sensor_msgs/NavSatFix.h>
#include <nav_msgs/GetMap.h>
#include <nav_msgs/GetPlan.h>
@@ -165,6 +166,7 @@ private:
void tagDetectionsAsyncCallback(const apriltag_ros::AprilTagDetectionArray & tagDetections);
#endif
void imuAsyncCallback(const sensor_msgs::ImuConstPtr & tagDetections);
void republishNodeDataCallback(const std_msgs::Int32MultiArray::ConstPtr& msg);
void interOdomCallback(const nav_msgs::OdometryConstPtr & msg);
void interOdomInfoCallback(const nav_msgs::OdometryConstPtr & msg1, const rtabmap_ros::OdomInfoConstPtr & msg2);
@@ -192,8 +194,6 @@ private:
const std::map<int, rtabmap::Transform> & nodes,
const rtabmap::Transform & currentPose);
void republishMaps();
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&);
@@ -243,6 +243,7 @@ private:
void goalFeedbackCb(const move_base_msgs::MoveBaseFeedbackConstPtr& feedback);
void publishLocalPath(const ros::Time & stamp);
void publishGlobalPath(const ros::Time & stamp);
void republishMaps();
private:
rtabmap::Rtabmap rtabmap_;
@@ -371,6 +372,7 @@ private:
ros::Subscriber imuSub_;
std::map<double, rtabmap::Transform> imus_;
std::string imuFrameId_;
ros::Subscriber republishNodeDataSub_;
ros::Subscriber interOdomSub_;
std::list<std::pair<nav_msgs::Odometry, rtabmap_ros::OdomInfo> > interOdoms_;
@@ -388,6 +390,8 @@ private:
bool alreadyRectifiedImages_;
bool twoDMapping_;
ros::Time previousStamp_;
std::set<int> nodesToRepublish_;
int maxNodesRepublished_;
};
}