mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-12 20:49:50 +08:00
OdometryROS: set initial pose to guess transform when provided.
This commit is contained in:
+12
-1
@@ -617,7 +617,18 @@ void OdometryROS::processData(const SensorData & data, const ros::Time & stamp,
|
|||||||
if(!guessFrameId_.empty())
|
if(!guessFrameId_.empty())
|
||||||
{
|
{
|
||||||
guessCurrentPose = this->getTransform(guessFrameId_, frameId_, stamp);
|
guessCurrentPose = this->getTransform(guessFrameId_, frameId_, stamp);
|
||||||
Transform previousPose = guessPreviousPose_.isNull()?guessCurrentPose:guessPreviousPose_;
|
|
||||||
|
Transform previousPose = guessPreviousPose_;
|
||||||
|
if(guessPreviousPose_.isNull())
|
||||||
|
{
|
||||||
|
previousPose = guessCurrentPose;
|
||||||
|
if(!guessCurrentPose.isNull() && odometry_->getPose().isIdentity())
|
||||||
|
{
|
||||||
|
ROS_INFO("Odometry: init pose with guess %s", guessCurrentPose.prettyPrint().c_str());
|
||||||
|
odometry_->reset(guessCurrentPose);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!previousPose.isNull() && !guessCurrentPose.isNull())
|
if(!previousPose.isNull() && !guessCurrentPose.isNull())
|
||||||
{
|
{
|
||||||
if(guess_.isNull())
|
if(guess_.isNull())
|
||||||
|
|||||||
Reference in New Issue
Block a user