mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
added sensorToBase transform on global_pose
This commit is contained in:
+6
-4
@@ -958,14 +958,17 @@ void CoreWrapper::commonDepthCallbackImpl(
|
|||||||
if(!globalPose_.header.stamp.isZero())
|
if(!globalPose_.header.stamp.isZero())
|
||||||
{
|
{
|
||||||
// assume sensor is fixed
|
// assume sensor is fixed
|
||||||
Transform baseToSensor = rtabmap_ros::getTransform(
|
Transform sensorToBase = rtabmap_ros::getTransform(
|
||||||
frameId_,
|
|
||||||
globalPose_.header.frame_id,
|
globalPose_.header.frame_id,
|
||||||
|
frameId_,
|
||||||
lastPoseStamp_,
|
lastPoseStamp_,
|
||||||
tfListener_,
|
tfListener_,
|
||||||
waitForTransform_?waitForTransformDuration_:0.0);
|
waitForTransform_?waitForTransformDuration_:0.0);
|
||||||
if(!baseToSensor.isNull())
|
if(!sensorToBase.isNull())
|
||||||
{
|
{
|
||||||
|
Transform globalPose = rtabmap_ros::transformFromPoseMsg(globalPose_.pose.pose);
|
||||||
|
globalPose *= sensorToBase; // transform global pose from sensor frame to robot base frame
|
||||||
|
|
||||||
// Correction of the global pose accounting the odometry movement since we received it
|
// Correction of the global pose accounting the odometry movement since we received it
|
||||||
Transform correction = rtabmap_ros::getTransform(
|
Transform correction = rtabmap_ros::getTransform(
|
||||||
frameId_,
|
frameId_,
|
||||||
@@ -974,7 +977,6 @@ void CoreWrapper::commonDepthCallbackImpl(
|
|||||||
lastPoseStamp_,
|
lastPoseStamp_,
|
||||||
tfListener_,
|
tfListener_,
|
||||||
waitForTransform_?waitForTransformDuration_:0.0);
|
waitForTransform_?waitForTransformDuration_:0.0);
|
||||||
Transform globalPose = rtabmap_ros::transformFromPoseMsg(globalPose_.pose.pose);
|
|
||||||
if(!correction.isNull())
|
if(!correction.isNull())
|
||||||
{
|
{
|
||||||
globalPose *= correction;
|
globalPose *= correction;
|
||||||
|
|||||||
Reference in New Issue
Block a user