Fixed timestamp conversion. Srv: changed "global" member to "global_map" (python reserved word). CoreWrapper: fixed imu subscription.

This commit is contained in:
matlabbe
2021-10-05 13:53:13 -04:00
parent 801fcade72
commit fb1200c8f1
11 changed files with 24 additions and 22 deletions
+7 -7
View File
@@ -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
View File
@@ -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
View File
@@ -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())
+2 -2
View File
@@ -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_);
}
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,