Skip to content

Commit

Permalink
Fix pose of plane visual with non-default normal vector (#574)
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>
  • Loading branch information
azeey and chapulina authored Feb 12, 2021
1 parent 87b2f4b commit 1847513
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,19 @@ rendering::VisualPtr SceneManager::CreateVisual(Entity _id,
/// localPose is currently used to handle the normal vector in plane visuals
/// In general, this can be used to store any local transforms between the
/// parent Visual and geometry.
rendering::VisualPtr geomVis;
if (localPose != math::Pose3d::Zero)
{
geomVis = this->dataPtr->scene->CreateVisual(name + "_geom");
geomVis->SetUserData("gazebo-entity", static_cast<int>(_id));
geomVis->SetUserData("pause-update", static_cast<int>(0));
geomVis->SetLocalPose(_visual.RawPose() * localPose);
visualVis = geomVis;
rendering::VisualPtr geomVis =
this->dataPtr->scene->CreateVisual(name + "_geom");
geomVis->AddGeometry(geom);
geomVis->SetLocalPose(localPose);
visualVis->AddChild(geomVis);
}
else
{
visualVis->AddGeometry(geom);
}

visualVis->AddGeometry(geom);
visualVis->SetLocalScale(scale);

// set material
Expand Down

0 comments on commit 1847513

Please sign in to comment.