Skip to content

Commit 92b0a3f

Browse files
committed
Fix(RGBD) ray tracing collision/visual issues
1 parent 0b342b5 commit 92b0a3f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ed_sensor_integration/src/kinect/ray_tracer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ RayTraceResult ray_trace(const ed::WorldModel& world, const geo::Pose3D& raytrac
6363
{
6464
const ed::EntityConstPtr& e = *it;
6565

66-
if (!e->visual() || !e->has_pose())
66+
if ((!e->collision() && !e->visual()) || !e->has_pose())
6767
continue;
6868

6969
res.active_entity_ = e->id().str();
@@ -81,9 +81,10 @@ RayTraceResult ray_trace(const ed::WorldModel& world, const geo::Pose3D& raytrac
8181
}
8282
}
8383

84-
ROS_DEBUG_STREAM("Raytracing to " << e->id() << " mesh");
84+
ROS_DEBUG_STREAM("Raytracing to " << e->id() << " " << (e->collision() ? "collision" : "visual") << " mesh");
8585
geo::LaserRangeFinder::RenderOptions opt;
86-
opt.setMesh(e->collision()->getMesh(), raytrace_pose.inverse() * e->pose()); // Use mesh
86+
geo::ShapeConstPtr shape = e->collision() ? e->collision() : e->visual();
87+
opt.setMesh(shape->getMesh(), raytrace_pose.inverse() * e->pose()); // Use mesh
8788

8889
lrf.render(opt, res);
8990
}

0 commit comments

Comments
 (0)