Skip to content

Commit

Permalink
Merge pull request #16 from ros2/type-support-handle
Browse files Browse the repository at this point in the history
Use new type support infrastructure
  • Loading branch information
wjwwood committed Mar 26, 2015
2 parents 3619cd8 + 7bd8f9c commit bf61c2d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions rclcpp/include/rclcpp/node_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
#include <string>

#include <rmw/rmw.h>
#include <rmw/get_type_support_handle.h>

#include <rosidl_generator_cpp/MessageTypeSupport.h>
#include <rosidl_generator_cpp/ServiceTypeSupport.h>
#include <rosidl_generator_cpp/message_type_support.hpp>
#include <rosidl_generator_cpp/service_type_support.hpp>

#include <rclcpp/contexts/default_context.hpp>

Expand Down Expand Up @@ -65,8 +63,8 @@ template<typename MessageT>
publisher::Publisher::SharedPtr
Node::create_publisher(std::string topic_name, size_t queue_size)
{
using rmw::get_type_support_handle;
auto type_support_handle = get_type_support_handle<MessageT>();
using rosidl_generator_cpp::get_message_type_support_handle;
auto type_support_handle = get_message_type_support_handle<MessageT>();
rmw_publisher_t * publisher_handle = rmw_create_publisher(
node_handle_, type_support_handle, topic_name.c_str(), queue_size);

Expand Down Expand Up @@ -96,8 +94,8 @@ Node::create_subscription(
std::function<void(const std::shared_ptr<MessageT> &)> callback,
rclcpp::callback_group::CallbackGroup::SharedPtr group)
{
using rmw::get_type_support_handle;
auto type_support_handle = get_type_support_handle<MessageT>();
using rosidl_generator_cpp::get_message_type_support_handle;
auto type_support_handle = get_message_type_support_handle<MessageT>();
rmw_subscription_t * subscriber_handle = rmw_create_subscription(
node_handle_, type_support_handle, topic_name.c_str(), queue_size);

Expand Down

0 comments on commit bf61c2d

Please sign in to comment.