Skip to content

Commit d11c782

Browse files
committed
fix object visualizer
1 parent 1adc435 commit d11c782

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

hydra_ros/include/hydra_ros/frontend/object_visualizer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class ObjectVisualizer : public MeshSegmenter::Sink {
5858

5959
void call(uint64_t timestamp_ns,
6060
const kimera_pgmo::MeshDelta& delta,
61-
const std::vector<size_t>& active,
6261
const LabelIndices& label_indices) const override;
6362

6463
protected:

hydra_ros/src/frontend/object_visualizer.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ std::string ObjectVisualizer::printInfo() const { return config::toString(config
6161

6262
void ObjectVisualizer::call(uint64_t timestamp_ns,
6363
const kimera_pgmo::MeshDelta& delta,
64-
const std::vector<size_t>& active,
6564
const LabelIndices& label_indices) const {
6665
pubs_.publish("active_vertices", [&]() {
6766
auto msg = std::make_unique<Marker>();
6867
msg->header.stamp = rclcpp::Time(timestamp_ns);
6968
msg->header.frame_id = GlobalInfo::instance().getFrames().odom;
7069
msg->ns = "active_vertices";
7170
msg->id = 0;
71+
std::vector<size_t> active(delta.getNumActiveVertices());
72+
std::iota(active.begin(), active.end(), delta.getNumArchivedVertices());
7273
fillMarkerFromCloud(delta, active, *msg);
7374
return msg;
7475
});
@@ -101,15 +102,15 @@ void ObjectVisualizer::fillMarkerFromCloud(const kimera_pgmo::MeshDelta& delta,
101102
msg.points.reserve(indices.size());
102103
msg.colors.reserve(indices.size());
103104
for (const auto idx : indices) {
104-
const auto& p = delta.vertex_updates->at(idx);
105+
const auto& p = delta.getVertex(idx);
105106
auto& point = msg.points.emplace_back();
106-
point.x = p.x;
107-
point.y = p.y;
108-
point.z = p.z;
107+
point.x = p.pos.x();
108+
point.y = p.pos.y();
109+
point.z = p.pos.z();
109110
auto& color = msg.colors.emplace_back();
110-
color.r = p.r / 255.0f;
111-
color.g = p.g / 255.0f;
112-
color.b = p.b / 255.0f;
111+
color.r = p.traits.color[0] / 255.0f;
112+
color.g = p.traits.color[1] / 255.0f;
113+
color.b = p.traits.color[2] / 255.0f;
113114
color.a = config.point_alpha;
114115
}
115116
}

0 commit comments

Comments
 (0)