mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Grid: Adjusting viewpoint when projecting into map frame
This commit is contained in:
@@ -277,6 +277,17 @@ void OccupancyGrid::createLocalMap(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(projMapFrame_)
|
||||||
|
{
|
||||||
|
//we should rotate viewPoint in /map frame
|
||||||
|
float roll, pitch, yaw;
|
||||||
|
node.getPose().getEulerAngles(roll, pitch, yaw);
|
||||||
|
Transform viewpointRotated = Transform(0,0,0,roll,pitch,0) * Transform(viewPoint.x, viewPoint.y, viewPoint.z, 0,0,0);
|
||||||
|
viewPoint.x = viewpointRotated.x();
|
||||||
|
viewPoint.y = viewpointRotated.y();
|
||||||
|
viewPoint.z = viewpointRotated.z();
|
||||||
|
}
|
||||||
|
|
||||||
if(cloud->size())
|
if(cloud->size())
|
||||||
{
|
{
|
||||||
pcl::IndicesPtr groundIndices(new std::vector<int>);
|
pcl::IndicesPtr groundIndices(new std::vector<int>);
|
||||||
|
|||||||
Reference in New Issue
Block a user