mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +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())
|
||||
{
|
||||
pcl::IndicesPtr groundIndices(new std::vector<int>);
|
||||
|
||||
Reference in New Issue
Block a user