Skip to content

Commit 29522e7

Browse files
Properly rotate GT rooms (#64)
* Properly rotate GT rooms * Set gt room frame id from config * drop header --------- Co-authored-by: Nathan Hughes <nathan.h.hughes@gmail.com>
1 parent 7523064 commit 29522e7

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

hydra_ros/include/hydra_ros/backend/gt_room_publisher.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ namespace hydra {
1414
class GtRoomPublisher : public UpdateRoomsFunctor::Sink {
1515
public:
1616
struct Config {
17-
std::string ns = "~gt_rooms";
17+
std::string ns = "~/gt_rooms";
18+
std::string room_frame_id = "map";
1819
visualizer::DiscreteColormap::Config colormap;
1920
} const config;
2021

hydra_ros/src/backend/gt_room_publisher.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ void declare_config(GtRoomPublisher::Config& config) {
2121
using namespace config;
2222
name("GtRoomPublisher::Config");
2323
field(config.ns, "ns");
24+
field(config.room_frame_id, "room_frame_id");
2425
field(config.colormap, "colormap");
2526
}
2627

@@ -35,7 +36,6 @@ GtRoomPublisher::GtRoomPublisher(const Config& config)
3536
std::string GtRoomPublisher::printInfo() const { return config::toString(config); }
3637

3738
void GtRoomPublisher::call(uint64_t, const RoomFinder& rf) const {
38-
LOG(WARNING) << "GT Room sink called";
3939
MarkerArray ma;
4040
auto& m = ma.markers.emplace_back();
4141
m.action = m.DELETEALL;
@@ -47,12 +47,17 @@ void GtRoomPublisher::call(uint64_t, const RoomFinder& rf) const {
4747
for (auto room : rf.room_extents.room_bounding_boxes) {
4848
for (auto box : room) {
4949
auto& m = ma.markers.emplace_back();
50-
m.header.frame_id = "map";
50+
m.header.frame_id = config.room_frame_id;
5151
m.ns = "gt_rooms";
5252
m.id = idx++;
5353
m.action = m.ADD;
5454
m.type = m.CUBE;
55-
m.pose.orientation.w = 1;
55+
56+
Eigen::Quaternionf q(box.world_R_center);
57+
m.pose.orientation.x = q.x();
58+
m.pose.orientation.y = q.y();
59+
m.pose.orientation.z = q.z();
60+
m.pose.orientation.w = q.w();
5661
m.pose.position.x = box.world_P_center.x();
5762
m.pose.position.y = box.world_P_center.y();
5863
m.pose.position.z = box.world_P_center.z();

0 commit comments

Comments
 (0)