Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion hydra_ros/include/hydra_ros/backend/gt_room_publisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace hydra {
class GtRoomPublisher : public UpdateRoomsFunctor::Sink {
public:
struct Config {
std::string ns = "~gt_rooms";
std::string ns = "~/gt_rooms";
std::string room_frame_id = "map";
visualizer::DiscreteColormap::Config colormap;
} const config;

Expand Down
12 changes: 9 additions & 3 deletions hydra_ros/src/backend/gt_room_publisher.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "hydra_ros/backend/gt_room_publisher.h"

#include <Eigen/src/Geometry/Quaternion.h>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this to be <Eigen/Geometry> as an include

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you shouldn't need this if you're going through the spark_dsg bounding boxes

#include <config_utilities/config.h>
#include <config_utilities/factory.h>
#include <config_utilities/parsing/context.h>
Expand All @@ -21,6 +22,7 @@ void declare_config(GtRoomPublisher::Config& config) {
using namespace config;
name("GtRoomPublisher::Config");
field(config.ns, "ns");
field(config.room_frame_id, "room_frame_id");
field(config.colormap, "colormap");
}

Expand All @@ -35,7 +37,6 @@ GtRoomPublisher::GtRoomPublisher(const Config& config)
std::string GtRoomPublisher::printInfo() const { return config::toString(config); }

void GtRoomPublisher::call(uint64_t, const RoomFinder& rf) const {
LOG(WARNING) << "GT Room sink called";
MarkerArray ma;
auto& m = ma.markers.emplace_back();
m.action = m.DELETEALL;
Expand All @@ -47,12 +48,17 @@ void GtRoomPublisher::call(uint64_t, const RoomFinder& rf) const {
for (auto room : rf.room_extents.room_bounding_boxes) {
for (auto box : room) {
auto& m = ma.markers.emplace_back();
m.header.frame_id = "map";
m.header.frame_id = config.room_frame_id;
m.ns = "gt_rooms";
m.id = idx++;
m.action = m.ADD;
m.type = m.CUBE;
m.pose.orientation.w = 1;

Eigen::Quaternionf q(box.world_R_center);
m.pose.orientation.x = q.x();
m.pose.orientation.y = q.y();
m.pose.orientation.z = q.z();
m.pose.orientation.w = q.w();
m.pose.position.x = box.world_P_center.x();
m.pose.position.y = box.world_P_center.y();
m.pose.position.z = box.world_P_center.z();
Expand Down
Loading