first prototype of templated rcl, using non-templated middleware interface, implemented by connext using dynamic data

This commit is contained in:
Dirk Thomas 2014-07-30 17:57:21 -07:00
parent a226aecd96
commit bcecf00928
13 changed files with 416 additions and 0 deletions

23
userland/CMakeLists.txt Normal file
View file

@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 2.8.3)
project(userland)
set(CMAKE_CXX_FLAGS "-std=c++0x")
find_package(ros_middleware_interface REQUIRED)
find_package(ros_dds_connext_dynamic REQUIRED)
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
ament_package()
include_directories(${rclcpp_INCLUDE_DIRS} ${std_msgs_INCLUDE_DIRS})
add_executable(userland src/main.cpp)
target_link_libraries(userland ${rclcpp_LIBRARIES} ${std_msgs_LIBRARIES})
install(
TARGETS userland
DESTINATION bin
)

16
userland/package.xml Normal file
View file

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<package format="2">
<name>userland</name>
<version>0.0.0</version>
<description>The userland package</description>
<maintainer email="dthomas@osrfoundation.org">Dirk Thomas</maintainer>
<license>Apache License 2.0</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<build_depend>rclcpp</build_depend>
<build_depend>std_msgs</build_depend>
<exec_depend>rclcpp</exec_depend>
<exec_depend>std_msgs</exec_depend>
</package>

16
userland/src/main.cpp Normal file
View file

@ -0,0 +1,16 @@
#include "rclcpp/Node.h"
#include "rclcpp/Publisher.h"
#include "std_msgs/Int32.h"
main(int argc, char** argv)
{
rclcpp::Node* n = create_node();
rclcpp::Publisher<std_msgs::Int32>* p = n->create_publisher<std_msgs::Int32>("topic_name");
std_msgs::Int32 ros_msg;
ros_msg.data = 23;
p->publish(ros_msg);
ros_msg.data = 42;
p->publish(ros_msg);
return 0;
}