mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +08:00
Fixed timestamp conversion. Srv: changed "global" member to "global_map" (python reserved word). CoreWrapper: fixed imu subscription.
This commit is contained in:
+7
-7
@@ -784,7 +784,7 @@ CoreWrapper::CoreWrapper(const rclcpp::NodeOptions & options) :
|
||||
#ifdef WITH_APRILTAG_MSGS
|
||||
tagDetectionsSub_ = this->create_subscription<apriltag_ros::msg::AprilTagDetectionArray>("tag_detections", 5, std::bind(&CoreWrapper::tagDetectionsAsyncCallback, this, std::placeholders::_1));
|
||||
#endif
|
||||
imuSub_ = this->create_subscription<geometry_msgs::msg::PoseWithCovarianceStamped>("imu", 100, std::bind(&CoreWrapper::imuAsyncCallback, this, std::placeholders::_1));
|
||||
imuSub_ = this->create_subscription<sensor_msgs::msg::Imu>("imu", 100, std::bind(&CoreWrapper::imuAsyncCallback, this, std::placeholders::_1));
|
||||
republishNodeDataSub_ = this->create_subscription<std_msgs::msg::Int32MultiArray>("republish_node_data", 5, std::bind(&CoreWrapper::republishNodeDataCallback, this, std::placeholders::_1));
|
||||
|
||||
parametersClient_ = std::make_shared<rclcpp::SyncParametersClient>(this);
|
||||
@@ -875,7 +875,7 @@ void CoreWrapper::saveParameters(const std::string & configFile)
|
||||
}
|
||||
else
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "Parameters are not saved! (No configuration file provided...)");
|
||||
RCLCPP_INFO(this->get_logger(), "Parameters are not saved (No configuration file provided...)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3306,7 +3306,7 @@ void CoreWrapper::getMapDataCallback(
|
||||
std::shared_ptr<rtabmap_ros::srv::GetMap::Response> res)
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "rtabmap: Getting map (global=%s optimized=%s graphOnly=%s)...",
|
||||
req->global?"true":"false",
|
||||
req->global_map?"true":"false",
|
||||
req->optimized?"true":"false",
|
||||
req->graph_only?"true":"false");
|
||||
std::map<int, Signature> signatures;
|
||||
@@ -3317,7 +3317,7 @@ void CoreWrapper::getMapDataCallback(
|
||||
poses,
|
||||
constraints,
|
||||
req->optimized,
|
||||
req->global,
|
||||
req->global_map,
|
||||
&signatures,
|
||||
!req->graph_only,
|
||||
!req->graph_only,
|
||||
@@ -3341,7 +3341,7 @@ void CoreWrapper::getMapData2Callback(
|
||||
std::shared_ptr<rtabmap_ros::srv::GetMap2::Response> res)
|
||||
{
|
||||
RCLCPP_INFO(get_logger(), "rtabmap: Getting map (global=%s optimized=%s with_images=%s with_scans=%s with_user_data=%s with_grids=%s)...",
|
||||
req->global?"true":"false",
|
||||
req->global_map?"true":"false",
|
||||
req->optimized?"true":"false",
|
||||
req->with_images?"true":"false",
|
||||
req->with_scans?"true":"false",
|
||||
@@ -3355,7 +3355,7 @@ void CoreWrapper::getMapData2Callback(
|
||||
poses,
|
||||
constraints,
|
||||
req->optimized,
|
||||
req->global,
|
||||
req->global_map,
|
||||
&signatures,
|
||||
req->with_images,
|
||||
req->with_scans,
|
||||
@@ -3480,7 +3480,7 @@ void CoreWrapper::publishMapCallback(
|
||||
poses,
|
||||
constraints,
|
||||
req->optimized,
|
||||
req->global,
|
||||
req->global_map,
|
||||
&signatures,
|
||||
!req->graph_only,
|
||||
!req->graph_only,
|
||||
|
||||
+1
-1
@@ -257,7 +257,7 @@ bool GuiWrapper::callMapDataService(const std::string & name, bool global, bool
|
||||
if(client->wait_for_service(std::chrono::seconds(2)))
|
||||
{
|
||||
auto request = std::make_shared<rtabmap_ros::srv::GetMap::Request>();
|
||||
request->global = global;
|
||||
request->global_map = global;
|
||||
request->optimized = optimized;
|
||||
request->graph_only = graphOnly;
|
||||
|
||||
|
||||
+3
-2
@@ -398,6 +398,7 @@ void OdometryROS::callbackIMU(const sensor_msgs::msg::Imu::SharedPtr msg)
|
||||
localTransform);
|
||||
|
||||
imus_.insert(std::make_pair(stamp, imu));
|
||||
//RCLCPP_WARN(get_logger(), "Received imu: %f", stamp);
|
||||
|
||||
if(bufferedData_.first.isValid() && stamp > bufferedData_.first.stamp())
|
||||
{
|
||||
@@ -423,7 +424,7 @@ void OdometryROS::processData(SensorData & data, const std_msgs::msg::Header & h
|
||||
|
||||
if(waitIMUToinit_ && (imus_.empty() || imus_.rbegin()->first < timestampFromROS(header.stamp)))
|
||||
{
|
||||
//NODELET_WARN("No imu received with higher stamp than last image (%f)! Buffering this image until we get more imu msgs...", stamp.toSec());
|
||||
//RCLCPP_WARN(get_logger(), "No imu received with higher stamp than last image (%f)! Buffering this image until we get more imu msgs...", timestampFromROS(header.stamp));
|
||||
|
||||
// keep in cache to process later when we will receive imu msgs
|
||||
if(bufferedData_.first.isValid())
|
||||
@@ -452,7 +453,7 @@ void OdometryROS::processData(SensorData & data, const std_msgs::msg::Header & h
|
||||
imuProcessed_ = true;
|
||||
}
|
||||
|
||||
//NODELET_WARN("img callback: process image %f", stamp.toSec());
|
||||
//RCLCPP_WARN(get_logger(), "img callback: process image %f", timestampFromROS(header.stamp));
|
||||
|
||||
Transform groundTruth;
|
||||
if(!data.imageRaw().empty() || !data.laserScanRaw().isEmpty())
|
||||
|
||||
@@ -42,8 +42,8 @@ using namespace rtabmap;
|
||||
|
||||
PreferencesDialogROS::PreferencesDialogROS(rclcpp::Node * node, const QString & configFile, const std::string & rtabmapNodeName) :
|
||||
configFile_(configFile),
|
||||
rtabmapNodeName_(rtabmapNodeName),
|
||||
node_(node)
|
||||
node_(node),
|
||||
rtabmapNodeName_(rtabmapNodeName)
|
||||
{
|
||||
UASSERT(node_);
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ void CommonDataSubscriber::rgbd5OdomInfoCallback(
|
||||
void CommonDataSubscriber::setupRGBD5Callbacks(
|
||||
rclcpp::Node& node,
|
||||
bool subscribeOdom,
|
||||
bool subscribeUserData,
|
||||
bool /*subscribeUserData*/,
|
||||
bool subscribeScan2d,
|
||||
bool subscribeScan3d,
|
||||
bool subscribeScanDesc,
|
||||
|
||||
@@ -270,7 +270,7 @@ void CommonDataSubscriber::rgbd6OdomInfoCallback(
|
||||
void CommonDataSubscriber::setupRGBD6Callbacks(
|
||||
rclcpp::Node& node,
|
||||
bool subscribeOdom,
|
||||
bool subscribeUserData,
|
||||
bool /*subscribeUserData*/,
|
||||
bool subscribeScan2d,
|
||||
bool subscribeScan3d,
|
||||
bool subscribeScanDesc,
|
||||
|
||||
Reference in New Issue
Block a user