-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathros_tf_broadcaster.h
More file actions
33 lines (25 loc) · 819 Bytes
/
ros_tf_broadcaster.h
File metadata and controls
33 lines (25 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include "rapidjson/document.h"
#include <bson.h>
#include "ros_bridge.h"
#include "ros_topic.h"
#include "helper.h"
using json = rapidjson::Document;
namespace rosbridge2cpp {
class ROSTFBroadcaster {
public:
ROSTFBroadcaster(ROSBridge &ros) : ros_(ros) {};
// Send a single transform to /tf in JSON mode
void SendTransform(json &geometry_msgs_transformstamped_msg);
// Send Transform in BSON mode
void SendTransform(bson_t &bson);
// Accepts an json document (where .IsArray() is true) that contains
// an array of geometry_msgs_transformstamped messages.
// Only to be used in json mode
void SendTransforms(json &geometry_msgs_transformstamped_array_msg);
~ROSTFBroadcaster() = default;
private:
ROSBridge &ros_;
ROSTopic tf_topic_{ ros_,"/tf","tf/tfMessage" };
};
}