mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
pointcloud_to_depthimage: fixed moving relative transformation
This commit is contained in:
@@ -58,6 +58,7 @@ class PointCloudToDepthImage : public nodelet::Nodelet
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PointCloudToDepthImage() :
|
PointCloudToDepthImage() :
|
||||||
|
listener_(0),
|
||||||
waitForTransform_(0.1),
|
waitForTransform_(0.1),
|
||||||
fillHolesSize_ (0),
|
fillHolesSize_ (0),
|
||||||
fillHolesError_(0.1),
|
fillHolesError_(0.1),
|
||||||
@@ -144,7 +145,7 @@ private:
|
|||||||
if(!fixedFrameId_.empty())
|
if(!fixedFrameId_.empty())
|
||||||
{
|
{
|
||||||
// approx sync
|
// approx sync
|
||||||
rtabmap::Transform cloudDisplacement = rtabmap_ros::getTransform(
|
cloudDisplacement = rtabmap_ros::getTransform(
|
||||||
pointCloud2Msg->header.frame_id,
|
pointCloud2Msg->header.frame_id,
|
||||||
fixedFrameId_,
|
fixedFrameId_,
|
||||||
pointCloud2Msg->header.stamp,
|
pointCloud2Msg->header.stamp,
|
||||||
@@ -170,7 +171,7 @@ private:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtabmap::Transform localTransform = cloudToCamera*cloudDisplacement;
|
rtabmap::Transform localTransform = cloudDisplacement.inverse()*cloudToCamera;
|
||||||
|
|
||||||
rtabmap::CameraModel model = rtabmap_ros::cameraModelFromROS(*cameraInfoMsg, localTransform);
|
rtabmap::CameraModel model = rtabmap_ros::cameraModelFromROS(*cameraInfoMsg, localTransform);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user