diff --git a/roseus_bt/include/roseus_bt/eus_remote_action_node.h b/roseus_bt/include/roseus_bt/eus_remote_action_node.h index 2ef3b095c..441e89688 100644 --- a/roseus_bt/include/roseus_bt/eus_remote_action_node.h +++ b/roseus_bt/include/roseus_bt/eus_remote_action_node.h @@ -102,8 +102,6 @@ class EusRemoteActionNode : public BT::ActionNodeBase } // port related - // TODO: avoid unnecessary dumping & parsing - // cannot use rapidjson::Value directly because it is not `CopyConstructible' // TODO: translate to ROS message: how to loop through slots? void feedbackCallback(std::shared_ptr connection, diff --git a/roseus_bt/include/roseus_bt/eus_remote_subscriber_node.h b/roseus_bt/include/roseus_bt/eus_remote_subscriber_node.h index b1285143a..a736114d4 100644 --- a/roseus_bt/include/roseus_bt/eus_remote_subscriber_node.h +++ b/roseus_bt/include/roseus_bt/eus_remote_subscriber_node.h @@ -4,6 +4,7 @@ #include #include #include +#include namespace BT { @@ -34,7 +35,7 @@ class EusRemoteSubscriberNode: public BT::ActionNodeBase static PortsList providedPorts() { return { InputPort("topic_name", "name of the subscribed topic"), - OutputPort("output_port", "port to where messages are redirected"), + OutputPort("output_port", "port to where messages are redirected"), OutputPort("received_port", "port set to true every time a message is received"), InputPort("host_name", "name of the rosbridge_server host"), InputPort("host_port", "port of the rosbridge_server host") @@ -76,12 +77,9 @@ class EusRemoteSubscriberNode: public BT::ActionNodeBase void setOutputFromMessage(const std::string& name, const rapidjson::Value& message) { - rapidjson::StringBuffer strbuf; - rapidjson::Writer writer(strbuf); - rapidjson::Document document; + rapidjson::CopyDocument document; document.CopyFrom(message, document.GetAllocator()); - document.Accept(writer); - setOutput(name, strbuf.GetString()); + setOutput(name, document); } };