mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Merge branch 'ros2' of github.com:introlab/rtabmap_ros into jazzy-devel
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_conversions</name>
|
<name>rtabmap_conversions</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's conversions package. This package can be used to convert rtabmap_msgs's msgs into RTAB-Map's library objects.</description>
|
<description>RTAB-Map's conversions package. This package can be used to convert rtabmap_msgs's msgs into RTAB-Map's library objects.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -3058,6 +3058,25 @@ bool deskew_impl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(secFirst > 1.e18)
|
||||||
|
{
|
||||||
|
// convert nanoseconds to seconds
|
||||||
|
secFirst /= 1.e9;
|
||||||
|
secLast /= 1.e9;
|
||||||
|
}
|
||||||
|
else if(secFirst > 1.e15)
|
||||||
|
{
|
||||||
|
// convert microseconds to seconds
|
||||||
|
secFirst /= 1.e6;
|
||||||
|
secLast /= 1.e6;
|
||||||
|
}
|
||||||
|
else if(secFirst > 1.e12)
|
||||||
|
{
|
||||||
|
// convert milliseconds to seconds
|
||||||
|
secFirst /= 1.e3;
|
||||||
|
secLast /= 1.e3;
|
||||||
|
}
|
||||||
|
|
||||||
firstStamp = timestampToROS(secFirst);
|
firstStamp = timestampToROS(secFirst);
|
||||||
lastStamp = timestampToROS(secLast);
|
lastStamp = timestampToROS(secLast);
|
||||||
}
|
}
|
||||||
@@ -3196,6 +3215,21 @@ bool deskew_impl(
|
|||||||
else if(timeDatatype == 8) //float64
|
else if(timeDatatype == 8) //float64
|
||||||
{
|
{
|
||||||
double sec = *((const double*)(&output.data[u*output.point_step]+offsetTime));
|
double sec = *((const double*)(&output.data[u*output.point_step]+offsetTime));
|
||||||
|
if(sec > 1.e18)
|
||||||
|
{
|
||||||
|
// convert nanoseconds to seconds
|
||||||
|
sec /= 1.e9;
|
||||||
|
}
|
||||||
|
else if(sec > 1.e15)
|
||||||
|
{
|
||||||
|
// convert microseconds to seconds
|
||||||
|
sec /= 1.e6;
|
||||||
|
}
|
||||||
|
else if(sec > 1.e12)
|
||||||
|
{
|
||||||
|
// sec milliseconds to seconds
|
||||||
|
sec /= 1.e3;
|
||||||
|
}
|
||||||
stamp = timestampToROS(sec);
|
stamp = timestampToROS(sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3275,6 +3309,21 @@ bool deskew_impl(
|
|||||||
else if(timeDatatype == 8)
|
else if(timeDatatype == 8)
|
||||||
{
|
{
|
||||||
double sec = *((const double*)(&output.data[v*output.row_step]+offsetTime));
|
double sec = *((const double*)(&output.data[v*output.row_step]+offsetTime));
|
||||||
|
if(sec > 1.e18)
|
||||||
|
{
|
||||||
|
// convert nanoseconds to seconds
|
||||||
|
sec /= 1.e9;
|
||||||
|
}
|
||||||
|
else if(sec > 1.e15)
|
||||||
|
{
|
||||||
|
// convert microseconds to seconds
|
||||||
|
sec /= 1.e6;
|
||||||
|
}
|
||||||
|
else if(sec > 1.e12)
|
||||||
|
{
|
||||||
|
// sec milliseconds to seconds
|
||||||
|
sec /= 1.e3;
|
||||||
|
}
|
||||||
stamp = timestampToROS(sec);
|
stamp = timestampToROS(sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+43
-72
@@ -1,101 +1,72 @@
|
|||||||
# rtabmap_demos
|
# rtabmap_demos
|
||||||
|
+ [Outdoor Stereo VSLAM](#outdoor-stereo-vslam)
|
||||||
- [rtabmap_demos](#rtabmap-demos)
|
+ [Indoor 2D LiDAR and RGB-D SLAM](#indoor-2d-lidar-and-rgb-d-slam)
|
||||||
+ [Outdoor Stereo VSLAM](#outdoor-stereo-vslam)
|
+ [Multi-Session Indoor 2D LiDAR and RGB-D SLAM](#multi-session-indoor-2d-lidar-and-rgb-d-slam)
|
||||||
+ [Indoor 2D LiDAR and RGB-D SLAM](#indoor-2d-lidar-and-rgb-d-slam)
|
+ [Find-Object with SLAM](#find-object-with-slam)
|
||||||
+ [Multi-Session Indoor 2D LiDAR and RGB-D SLAM](#multi-session-indoor-2d-lidar-and-rgb-d-slam)
|
+ [Turtlebot4 Nav2, 2D LiDAR and RGB-D SLAM](#turtlebot4-nav2-2d-lidar-and-rgb-d-slam)
|
||||||
+ [Find-Object with SLAM](#find-object-with-slam)
|
+ [Turtlebot3 Nav2 and 2D LiDAR SLAM](#turtlebot3-nav2-and-2d-lidar-slam)
|
||||||
+ [Turtlebot4 Nav2, 2D LiDAR and RGB-D SLAM](#turtlebot4-nav2--2d-lidar-and-rgb-d-slam)
|
+ [Turtlebot3 Nav2 and RGB-D SLAM](#turtlebot3-nav2-and-rgb-d-slam)
|
||||||
+ [Turtlebot3 Nav2 and 2D LiDAR SLAM](#turtlebot3-nav2-and-2d-lidar-slam)
|
+ [Turtlebot3 Nav2, 2D LiDAR and RGB-D SLAM](#turtlebot3-nav2-2d-lidar-and-rgb-d-slam)
|
||||||
+ [Turtlebot3 Nav2 and RGB-D SLAM](#turtlebot3-nav2-and-rgb-d-slam)
|
+ [Champ Quadruped Nav2, Elevation Map and VSLAM](#champ-quadruped-nav2-elevation-map-and-vslam)
|
||||||
+ [Turtlebot3 Nav2, 2D LiDAR and RGB-D SLAM](#turtlebot3-nav2--2d-lidar-and-rgb-d-slam)
|
+ [Clearpath Husky Nav2, 2D LiDAR and RGB-D SLAM](#clearpath-husky-nav2-2d-lidar-and-rgb-d-slam)
|
||||||
+ [Champ Quadruped Nav2, Elevation Map and VSLAM](#champ-quadruped-nav2--elevation-map-and-vslam)
|
+ [Clearpath Husky Nav2, 3D LiDAR and RGB-D SLAM](#clearpath-husky-nav2-3d-lidar-and-rgb-d-slam)
|
||||||
+ [Clearpath Husky Nav2, 2D LiDAR and RGB-D SLAM](#clearpath-husky-nav2--2d-lidar-and-rgb-d-slam)
|
+ [Clearpath Husky Nav2, 3D LiDAR Assembling and RGB-D SLAM](#clearpath-husky-nav2-3d-lidar-assembling-and-rgb-d-slam)
|
||||||
+ [Clearpath Husky Nav2, 3D LiDAR and RGB-D SLAM](#clearpath-husky-nav2--3d-lidar-and-rgb-d-slam)
|
+ [Isaac Sim Nav2 and Stereo SLAM](#isaac-sim-nav2-and-stereo-slam)
|
||||||
+ [Clearpath Husky Nav2, 3D LiDAR Assembling and RGB-D SLAM](#clearpath-husky-nav2--3d-lidar-assembling-and-rgb-d-slam)
|
+ [Isaac Sim Nav2 and RGB-D VSLAM](#isaac-sim-nav2-and-rgb-d-vslam)
|
||||||
+ [Isaac Sim Nav2 and Stereo SLAM](#isaac-sim-nav2-and-stereo-slam)
|
|
||||||
+ [Isaac Sim Nav2 and RGB-D VSLAM](#isaac-sim-nav2-and-rgb-d-vslam)
|
|
||||||
|
|
||||||
### Outdoor Stereo VSLAM
|
### Outdoor Stereo VSLAM
|
||||||
```
|
[stereo_outdoor_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/stereo_outdoor_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos stereo_outdoor_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Indoor 2D LiDAR and RGB-D SLAM
|
### Indoor 2D LiDAR and RGB-D SLAM
|
||||||
```
|
[robot_mapping_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/robot_mapping_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos robot_mapping_demo.launch.py rviz:=true rtabmap_viz:=true
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Multi-Session Indoor 2D LiDAR and RGB-D SLAM
|
### Multi-Session Indoor 2D LiDAR and RGB-D SLAM
|
||||||
```
|
[multisession_mapping_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/multisession_mapping_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos multisession_mapping_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Find-Object with SLAM
|
### Find-Object with SLAM
|
||||||
```
|
[find_object_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/find_object_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos find_object_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Turtlebot4 Nav2, 2D LiDAR and RGB-D SLAM
|
### Turtlebot4 Nav2, 2D LiDAR and RGB-D SLAM
|
||||||
```
|
[turtlebot4_sim_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/turtlebot4/turtlebot4_sim_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos turtlebot4_sim_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Turtlebot3 Nav2 and 2D LiDAR SLAM
|
### Turtlebot3 Nav2 and 2D LiDAR SLAM
|
||||||
```
|
[turtlebot3_sim_scan_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_scan_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos turtlebot3_sim_scan_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Turtlebot3 Nav2 and RGB-D SLAM
|
### Turtlebot3 Nav2 and RGB-D SLAM
|
||||||
```
|
[turtlebot3_sim_rgbd_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos turtlebot3_sim_rgbd_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Turtlebot3 Nav2, 2D LiDAR and RGB-D SLAM
|
### Turtlebot3 Nav2, 2D LiDAR and RGB-D SLAM
|
||||||
```
|
[turtlebot3_sim_rgbd_scan_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/turtlebot3/turtlebot3_sim_rgbd_scan_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos turtlebot3_sim_rgbd_scan_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Champ Quadruped Nav2, Elevation Map and VSLAM
|
### Champ Quadruped Nav2, Elevation Map and VSLAM
|
||||||
```
|
[champ_sim_vslam.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/champ/champ_sim_vslam.launch.py)
|
||||||
ros2 launch rtabmap_demos champ_sim_vslam.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Clearpath Husky Nav2, 2D LiDAR and RGB-D SLAM
|
### Clearpath Husky Nav2, 2D LiDAR and RGB-D SLAM
|
||||||
```
|
[husky_sim_scan2d_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/husky/husky_sim_scan2d_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos husky_sim_scan2d_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Clearpath Husky Nav2, 3D LiDAR and RGB-D SLAM
|
### Clearpath Husky Nav2, 3D LiDAR and RGB-D SLAM
|
||||||
```
|
[husky_sim_scan3d_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/husky/husky_sim_scan3d_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos husky_sim_scan3d_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Clearpath Husky Nav2, 3D LiDAR Assembling and RGB-D SLAM
|
### Clearpath Husky Nav2, 3D LiDAR Assembling and RGB-D SLAM
|
||||||
```
|
[husky_sim_scan3d_assemble_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/husky/husky_sim_scan3d_assemble_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos husky_sim_scan3d_assemble_demo.launch.py
|
|
||||||
```
|
|
||||||

|

|
||||||
|
|
||||||
### Isaac Sim Nav2 and Stereo SLAM
|
### Isaac Sim Nav2 and Stereo SLAM
|
||||||
```
|
[isaac_sim_vslam_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/isaac/isaac_sim_vslam_demo.launch.py)
|
||||||
ros2 launch rtabmap_demos isaac_sim_vslam_demo.launch.py
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
|

|
||||||
### Isaac Sim Nav2 and RGB-D VSLAM
|
### Isaac Sim Nav2 and RGB-D VSLAM
|
||||||
```
|
[isaac_sim_vslam_demo.launch.py](https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_demos/launch/isaac/isaac_sim_vslam_demo.launch.py) stereo:=false vo:=rtabmap
|
||||||
ros2 launch rtabmap_demos isaac_sim_vslam_demo.launch.py stereo:=false vo:=rtabmap
|
|
||||||
```
|

|
||||||

|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_demos</name>
|
<name>rtabmap_demos</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's demo launch files.</description>
|
<description>RTAB-Map's demo launch files.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_examples</name>
|
<name>rtabmap_examples</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's example launch files.</description>
|
<description>RTAB-Map's example launch files.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_launch</name>
|
<name>rtabmap_launch</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's main launch files.</description>
|
<description>RTAB-Map's main launch files.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_msgs</name>
|
<name>rtabmap_msgs</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's msgs package.</description>
|
<description>RTAB-Map's msgs package.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ private:
|
|||||||
USemaphore dataReady_;
|
USemaphore dataReady_;
|
||||||
rtabmap::SensorData dataToProcess_;
|
rtabmap::SensorData dataToProcess_;
|
||||||
std_msgs::msg::Header dataHeaderToProcess_;
|
std_msgs::msg::Header dataHeaderToProcess_;
|
||||||
|
bool bufferedDataToProcess_;
|
||||||
|
|
||||||
bool paused_;
|
bool paused_;
|
||||||
int resetCountdown_;
|
int resetCountdown_;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_odom</name>
|
<name>rtabmap_odom</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's odometry package.</description>
|
<description>RTAB-Map's odometry package.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -420,25 +420,36 @@ void OdometryROS::callbackIMU(const sensor_msgs::msg::Imu::SharedPtr msg)
|
|||||||
double stamp = rtabmap_conversions::timestampFromROS(msg->header.stamp);
|
double stamp = rtabmap_conversions::timestampFromROS(msg->header.stamp);
|
||||||
//RCLCPP_WARN(get_logger(), "Received imu: %f delay=%f", stamp, (now() - msg->header.stamp).seconds());
|
//RCLCPP_WARN(get_logger(), "Received imu: %f delay=%f", stamp, (now() - msg->header.stamp).seconds());
|
||||||
|
|
||||||
UScopeMutex m(imuMutex_);
|
|
||||||
|
|
||||||
if(!imuProcessed_ && imus_.empty())
|
|
||||||
{
|
{
|
||||||
rtabmap::Transform localTransform = rtabmap_conversions::getTransform(this->frameId(), msg->header.frame_id, msg->header.stamp, *tfBuffer_, waitForTransform_);
|
UScopeMutex m(imuMutex_);
|
||||||
if(localTransform.isNull())
|
|
||||||
|
if(!imuProcessed_ && imus_.empty())
|
||||||
{
|
{
|
||||||
RCLCPP_WARN(this->get_logger(), "Dropping imu data! A valid TF between %s and %s is required to initialize IMU.",
|
rtabmap::Transform localTransform = rtabmap_conversions::getTransform(this->frameId(), msg->header.frame_id, msg->header.stamp, *tfBuffer_, waitForTransform_);
|
||||||
this->frameId().c_str(), msg->header.frame_id.c_str());
|
if(localTransform.isNull())
|
||||||
return;
|
{
|
||||||
|
RCLCPP_WARN(this->get_logger(), "Dropping imu data! A valid TF between %s and %s is required to initialize IMU.",
|
||||||
|
this->frameId().c_str(), msg->header.frame_id.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
imus_.insert(std::make_pair(stamp, msg));
|
||||||
|
|
||||||
|
if(imus_.size() > 1000)
|
||||||
|
{
|
||||||
|
RCLCPP_WARN(this->get_logger(), "Dropping imu data!");
|
||||||
|
imus_.erase(imus_.begin());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(dataMutex_.lockTry() == 0)
|
||||||
imus_.insert(std::make_pair(stamp, msg));
|
|
||||||
|
|
||||||
if(imus_.size() > 1000)
|
|
||||||
{
|
{
|
||||||
RCLCPP_WARN(this->get_logger(), "Dropping imu data!");
|
if(bufferedDataToProcess_ && rtabmap_conversions::timestampFromROS(dataHeaderToProcess_.stamp) <= stamp)
|
||||||
imus_.erase(imus_.begin());
|
{
|
||||||
|
bufferedDataToProcess_ = false;
|
||||||
|
dataReady_.release();
|
||||||
|
}
|
||||||
|
dataMutex_.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -448,8 +459,14 @@ void OdometryROS::processData(SensorData & data, const std_msgs::msg::Header & h
|
|||||||
//RCLCPP_WARN(get_logger(), "Received image: %f delay=%f", data.stamp(), (now() - header.stamp).seconds());
|
//RCLCPP_WARN(get_logger(), "Received image: %f delay=%f", data.stamp(), (now() - header.stamp).seconds());
|
||||||
if(dataMutex_.lockTry() == 0)
|
if(dataMutex_.lockTry() == 0)
|
||||||
{
|
{
|
||||||
|
if(bufferedDataToProcess_) {
|
||||||
|
RCLCPP_ERROR(this->get_logger(), "We didn't receive IMU newer than previous image (%f) and we just received a new image (%f). The previous image is dropped!",
|
||||||
|
rtabmap_conversions::timestampFromROS(dataHeaderToProcess_.stamp), rtabmap_conversions::timestampFromROS(header.stamp));
|
||||||
|
++droppedMsgs_;
|
||||||
|
}
|
||||||
dataToProcess_ = data;
|
dataToProcess_ = data;
|
||||||
dataHeaderToProcess_ = header;
|
dataHeaderToProcess_ = header;
|
||||||
|
bufferedDataToProcess_ = false;
|
||||||
dataReady_.release();
|
dataReady_.release();
|
||||||
dataMutex_.unlock();
|
dataMutex_.unlock();
|
||||||
++processedMsgs_;
|
++processedMsgs_;
|
||||||
@@ -495,8 +512,9 @@ void OdometryROS::mainLoop()
|
|||||||
|
|
||||||
if(waitIMUToinit_ && (imus_.empty() || imus_.rbegin()->first < rtabmap_conversions::timestampFromROS(header.stamp)))
|
if(waitIMUToinit_ && (imus_.empty() || imus_.rbegin()->first < rtabmap_conversions::timestampFromROS(header.stamp)))
|
||||||
{
|
{
|
||||||
RCLCPP_ERROR(this->get_logger(), "Make sure IMU is published faster than data rate! (last image stamp=%f and last imu stamp received=%f)",
|
RCLCPP_WARN(this->get_logger(), "Make sure IMU is published faster than data rate! (last image stamp=%f and last imu stamp received=%f). Buffering the image until an imu with same or greater stamp is received.",
|
||||||
data.stamp(), imus_.empty()?0:imus_.rbegin()->first);
|
data.stamp(), imus_.empty()?0:imus_.rbegin()->first);
|
||||||
|
bufferedDataToProcess_ = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// process all imu data up to current image stamp (or just after so that underlying odom approach can do interpolation of imu at image stamp)
|
// process all imu data up to current image stamp (or just after so that underlying odom approach can do interpolation of imu at image stamp)
|
||||||
@@ -922,10 +940,9 @@ void OdometryROS::mainLoop()
|
|||||||
"is %fs too old (>%fs, min_update_rate = %f Hz). Previous data stamp is %f while new data stamp is %f.",
|
"is %fs too old (>%fs, min_update_rate = %f Hz). Previous data stamp is %f while new data stamp is %f.",
|
||||||
rtabmap_conversions::timestampFromROS(header.stamp) - previousStamp_, 1.0/minUpdateRate_, minUpdateRate_, previousStamp_, rtabmap_conversions::timestampFromROS(header.stamp));
|
rtabmap_conversions::timestampFromROS(header.stamp) - previousStamp_, 1.0/minUpdateRate_, minUpdateRate_, previousStamp_, rtabmap_conversions::timestampFromROS(header.stamp));
|
||||||
}
|
}
|
||||||
else
|
else if(--resetCurrentCount_>0)
|
||||||
{
|
{
|
||||||
RCLCPP_WARN(this->get_logger(), "Odometry lost! Odometry will be reset after next %d consecutive unsuccessful odometry updates...", resetCurrentCount_);
|
RCLCPP_WARN(this->get_logger(), "Odometry lost! Odometry will be reset after next %d consecutive unsuccessful odometry updates...", resetCurrentCount_);
|
||||||
--resetCurrentCount_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(resetCurrentCount_ == 0 || tooOldPreviousData)
|
if(resetCurrentCount_ == 0 || tooOldPreviousData)
|
||||||
@@ -953,6 +970,11 @@ void OdometryROS::mainLoop()
|
|||||||
odometry_->reset(tfPose);
|
odometry_->reset(tfPose);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Keep resetting if the odometry cannot initialize in next updates (e.g., lack of features).
|
||||||
|
// This will make sure we keep updating to latest guess pose.
|
||||||
|
if(resetCurrentCount_ == 0) {
|
||||||
|
++resetCurrentCount_;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1149,6 +1171,7 @@ void OdometryROS::reset(const Transform & pose)
|
|||||||
imuProcessed_ = false;
|
imuProcessed_ = false;
|
||||||
dataToProcess_ = SensorData();
|
dataToProcess_ = SensorData();
|
||||||
dataHeaderToProcess_ = std_msgs::msg::Header();
|
dataHeaderToProcess_ = std_msgs::msg::Header();
|
||||||
|
bufferedDataToProcess_ = false;
|
||||||
imuMutex_.lock();
|
imuMutex_.lock();
|
||||||
imus_.clear();
|
imus_.clear();
|
||||||
imuMutex_.unlock();
|
imuMutex_.unlock();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_python</name>
|
<name>rtabmap_python</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's python package.</description>
|
<description>RTAB-Map's python package.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_ros</name>
|
<name>rtabmap_ros</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>
|
<description>
|
||||||
RTAB-Map Stack
|
RTAB-Map Stack
|
||||||
</description>
|
</description>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_rviz_plugins</name>
|
<name>rtabmap_rviz_plugins</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's rviz plugins.</description>
|
<description>RTAB-Map's rviz plugins.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_slam</name>
|
<name>rtabmap_slam</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's SLAM package.</description>
|
<description>RTAB-Map's SLAM package.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ CoreWrapper::CoreWrapper(const rclcpp::NodeOptions & options) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// declare parameters
|
// declare parameters
|
||||||
this->declare_parameter("is_rtabmap_paused", paused_);
|
paused_ = this->declare_parameter("is_rtabmap_paused", paused_);
|
||||||
if(paused_)
|
if(paused_)
|
||||||
{
|
{
|
||||||
RCLCPP_WARN(get_logger(), "Node paused... don't forget to call service \"resume\" to start rtabmap.");
|
RCLCPP_WARN(get_logger(), "Node paused... don't forget to call service \"resume\" to start rtabmap.");
|
||||||
@@ -388,6 +388,7 @@ CoreWrapper::CoreWrapper(const rclcpp::NodeOptions & options) :
|
|||||||
|
|
||||||
char ** argv = new char*[argList.size()];
|
char ** argv = new char*[argList.size()];
|
||||||
bool deleteDbOnStart = false;
|
bool deleteDbOnStart = false;
|
||||||
|
deleteDbOnStart = this->declare_parameter("delete_db_on_start", deleteDbOnStart);
|
||||||
for(unsigned int i=0; i<argList.size(); ++i)
|
for(unsigned int i=0; i<argList.size(); ++i)
|
||||||
{
|
{
|
||||||
argv[i] = &argList[i].at(0);
|
argv[i] = &argList[i].at(0);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_sync</name>
|
<name>rtabmap_sync</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's synchronization package.</description>
|
<description>RTAB-Map's synchronization package.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_util</name>
|
<name>rtabmap_util</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's various useful nodes and nodelets.</description>
|
<description>RTAB-Map's various useful nodes and nodelets.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>rtabmap_viz</name>
|
<name>rtabmap_viz</name>
|
||||||
<version>0.21.9</version>
|
<version>0.21.10</version>
|
||||||
<description>RTAB-Map's visualization package.</description>
|
<description>RTAB-Map's visualization package.</description>
|
||||||
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
<maintainer email="[email protected]">Mathieu Labbe</maintainer>
|
||||||
<author>Mathieu Labbe</author>
|
<author>Mathieu Labbe</author>
|
||||||
|
|||||||
Reference in New Issue
Block a user