Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add laser_retro support #603

Merged
merged 7 commits into from
Feb 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add laser_retro support
Signed-off-by: Guillaume Doisy <[email protected]>
Guillaume Doisy committed Feb 2, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ff05620f68ccd7dbbbff51d1217d68a4397f1756
6 changes: 6 additions & 0 deletions src/SdfEntityCreator.cc
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@
#include "ignition/gazebo/components/Joint.hh"
#include "ignition/gazebo/components/JointAxis.hh"
#include "ignition/gazebo/components/JointType.hh"
#include "ignition/gazebo/components/LaserRetro.hh"
#include "ignition/gazebo/components/Lidar.hh"
#include "ignition/gazebo/components/Light.hh"
#include "ignition/gazebo/components/LinearAcceleration.hh"
@@ -503,6 +504,11 @@ Entity SdfEntityCreator::CreateEntities(const sdf::Visual *_visual)
this->dataPtr->ecm->CreateComponent(visualEntity,
components::Transparency(_visual->Transparency()));

if (_visual->HasLaserRetro()){
doisyg marked this conversation as resolved.
Show resolved Hide resolved
this->dataPtr->ecm->CreateComponent(visualEntity,
components::LaserRetro(_visual->LaserRetro()));
}

if (_visual->Geom())
{
this->dataPtr->ecm->CreateComponent(visualEntity,
13 changes: 13 additions & 0 deletions src/rendering/RenderUtil.cc
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@
#include "ignition/gazebo/components/DepthCamera.hh"
#include "ignition/gazebo/components/GpuLidar.hh"
#include "ignition/gazebo/components/Geometry.hh"
#include "ignition/gazebo/components/LaserRetro.hh"
#include "ignition/gazebo/components/Light.hh"
#include "ignition/gazebo/components/Link.hh"
#include "ignition/gazebo/components/Material.hh"
@@ -568,6 +569,12 @@ void RenderUtilPrivate::CreateRenderingEntities(
visual.SetMaterial(material->Data());
}

auto laserRetro = _ecm.Component<components::LaserRetro>(_entity);
if (laserRetro != nullptr)
{
visual.SetLaserRetro(laserRetro->Data());
}

// todo(anyone) make visual updates more generic without using extra
// variables like entityTemp just for storing one specific visual
// param?
@@ -741,6 +748,12 @@ void RenderUtilPrivate::CreateRenderingEntities(
visual.SetMaterial(material->Data());
}

auto laserRetro = _ecm.Component<components::LaserRetro>(_entity);
if (laserRetro != nullptr)
{
visual.SetLaserRetro(laserRetro->Data());
}

this->newVisuals.push_back(
std::make_tuple(_entity, visual, _parent->Data()));
return true;
5 changes: 5 additions & 0 deletions src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
@@ -247,6 +247,11 @@ rendering::VisualPtr SceneManager::CreateVisual(Entity _id,
visualVis->SetUserData("pause-update", static_cast<int>(0));
visualVis->SetLocalPose(_visual.RawPose());

if (_visual.HasLaserRetro())
{
visualVis->SetUserData("laser_retro", _visual.LaserRetro());
}

math::Vector3d scale = math::Vector3d::One;
math::Pose3d localPose;
rendering::GeometryPtr geom =