Skip to content

Commit

Permalink
Moved RTPS->NGSIv2 and NGSIv2->RTPS libraries to FIROS2.
Browse files Browse the repository at this point in the history
Created example HelloWorld with communication with ROS2.
  • Loading branch information
Luis Gasco committed Apr 10, 2018
1 parent 3ebd382 commit 3adc6ab
Show file tree
Hide file tree
Showing 59 changed files with 14,968 additions and 15 deletions.
546 changes: 546 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

70 changes: 56 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,60 @@ find_package(ament_cmake REQUIRED)
find_package(fastrtps REQUIRED)
find_package(fastcdr REQUIRED)

add_executable(firos2 src/main.cpp)

add_library(dynamicload thirdparty/routing-service/src/dynamicload/dynamicload.cpp)
add_library(tinyxml2 thirdparty/routing-service/src/tinyxml2/tinyxml2.cpp)
add_library(RSManager thirdparty/routing-service/src/RSManager.cpp)
add_library(RSBridge thirdparty/routing-service/src/RSBridge.cpp)
add_library(GenericPubSubTypes thirdparty/routing-service/src/GenericPubSubTypes.cpp)

target_link_libraries(dynamicload ${CMAKE_DL_LIBS})
target_link_libraries(GenericPubSubTypes fastrtps fastcdr)
target_link_libraries(RSBridge GenericPubSubTypes dynamicload)
target_link_libraries(RSManager RSBridge tinyxml2)

target_link_libraries(firos2 RSManager)
add_executable(firos2 src/main.cpp
thirdparty/routing-service/src/RSManager.cpp
thirdparty/routing-service/src/dynamicload/dynamicload.cpp
thirdparty/routing-service/src/GenericPubSubTypes.cpp)

#add_library(dynamicload thirdparty/routing-service/src/dynamicload/dynamicload.cpp)
#add_library(tinyxml2 thirdparty/routing-service/src/tinyxml2/tinyxml2.cpp)
#add_library(RSManager thirdparty/routing-service/src/RSManager.cpp)
#add_library(GenericPubSubTypes thirdparty/routing-service/src/GenericPubSubTypes.cpp)

add_library(rsngsiv2rtpsbridgelib SHARED
src/NGSIv2/RSBridgeNGSIv2ToFastRTPS.cpp
src/NGSIv2/ngsiv2rtpslib.cpp
src/NGSIv2/idl/JsonNGSIv2.cxx
src/NGSIv2/idl/JsonNGSIv2PubSubTypes.cxx
thirdparty/routing-service/src/dynamicload/dynamicload.cpp
thirdparty/routing-service/src/GenericPubSubTypes.cpp)

add_library(rsrtpsngsiv2bridgelib SHARED
src/NGSIv2/RSBridgeFastRTPSToNGSIv2.cpp
src/NGSIv2/rtpsngsiv2lib.cpp
src/NGSIv2/idl/JsonNGSIv2.cxx
src/NGSIv2/idl/JsonNGSIv2PubSubTypes.cxx
thirdparty/routing-service/src/dynamicload/dynamicload.cpp
thirdparty/routing-service/src/GenericPubSubTypes.cpp)

#target_link_libraries(dynamicload ${CMAKE_DL_LIBS})
#target_link_libraries(GenericPubSubTypes fastrtps fastcdr)
#target_link_libraries(RSManager GenericPubSubTypes dynamicload tinyxml2)

target_link_libraries(firos2 fastrtps fastcdr tinyxml2
${CMAKE_DL_LIBS} -L/usr/lib/x86_64-linux-gnu curl curlpp pthread ${Boost_LIBRARIES} boost_system)

target_link_libraries(rsngsiv2rtpsbridgelib
fastrtps
fastcdr
-L/usr/lib/x86_64-linux-gnu
curl
curlpp
pthread
${Boost_LIBRARIES}
boost_system
${CMAKE_DL_LIBS})

target_link_libraries(rsrtpsngsiv2bridgelib
fastrtps
fastcdr
-L/usr/lib/x86_64-linux-gnu
curl
curlpp
pthread
${Boost_LIBRARIES}
boost_system
${CMAKE_DL_LIBS})

ament_export_dependencies(rosidl_cmake)
ament_export_dependencies(rosidl_generator_dds_idl)
Expand Down Expand Up @@ -104,6 +144,8 @@ if(BUILD_TESTING)
endif()

install(TARGETS firos2 DESTINATION bin)
install(TARGETS rsngsiv2rtpsbridgelib DESTINATION lib)
install(TARGETS rsrtpsngsiv2bridgelib DESTINATION lib)

ament_package(
CONFIG_EXTRAS "firos2-extras.cmake.in"
Expand Down
48 changes: 48 additions & 0 deletions examples/TIS_NGSIv2/.kdev4/TIS_NGSIv2.kdev4
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[Buildset]
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x14\x00T\x00I\x00S\x00_\x00N\x00G\x00S\x00I\x00v\x002)

[CMake]
Build Directory Count=1
Current Build Directory Index-Host System=0

[CMake][CMake Build Directory 0]
Build Directory Path=/home/luisgp/git/eProsima/routing-service/examples/TIS_NGSIv2/build
Build Type=
CMake Binary=/usr/bin/cmake
CMake Executable=/usr/bin/cmake
Environment Profile=
Extra Arguments=
Install Directory=/usr/local
Runtime=Host System

[Launch]
Launch Configurations=Launch Configuration 0

[Launch][Launch Configuration 0]
Configured Launch Modes=execute
Configured Launchers=nativeAppLauncher
Name=TIS_NGSIv2
Type=Native Application

[Launch][Launch Configuration 0][Data]
Arguments=../config.xml
Debugger Shell=
Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x00)
Dependency Action=Nothing
Display Demangle Names=true
Display Static Members=false
EnvironmentGroup=
Executable=file:///home/luisgp/git/eProsima/routing-service/examples/TIS_NGSIv2/build/tis_ngsiv2
External Terminal=konsole --noclose --workdir %workdir -e %exe
GDB Path=
Project Target=TIS_NGSIv2,rebuild_cache
Remote GDB Config Script=
Remote GDB Run Script=
Remote GDB Shell Script=
Start With=ApplicationOutput
Use External Terminal=false
Working Directory=file:///home/luisgp/git/eProsima/routing-service/examples/TIS_NGSIv2/build/
isExecutable=true

[Project]
VersionControlSupport=kdevgit
42 changes: 42 additions & 0 deletions examples/TIS_NGSIv2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
project(TIS_NGSIv2)
cmake_minimum_required(VERSION 2.9)

include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
check_cxx_compiler_flag(--std=c++11 SUPPORTS_CXX11)
if(SUPPORTS_CXX11)
add_compile_options(--std=c++11)
else()
message(FATAL_ERROR "Compiler doesn't support C++11")
endif()
endif()

find_package(fastcdr)
find_package(fastrtps)

add_definitions(-DEPROSIMA_USER_DLL_EXPORT -DBUILD_SHARED_LIBS)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(BUILD_SHARED_LIBS TRUE)

file(GLOB USER_LIB_SOURCES_CXX "*.cxx")
#file(GLOB USER_LIB_SOURCES_CPP "*.cpp")

#add_executable(tis_ngsiv2 main.cpp)

#add_library(RSManager ../../thirdparty/routing-service/src/RSManager.cpp
# ../../src/NGSIv2/idl/JsonNGSIv2.cxx
# ../../src/NGSIv2/idl/JsonNGSIv2PubSubTypes.cxx)

#add_library(userlib SHARED ${USER_LIB_SOURCES_CXX} ${USER_LIB_SOURCES_CPP})
#add_library(userlib2 SHARED ${USER_LIB_SOURCES_CXX} ${USER_LIB_SOURCES_CPP})
add_library(userlib SHARED ${USER_LIB_SOURCES_CXX} userlib.cpp jsoncpp.cpp)
add_library(userlib2 SHARED ${USER_LIB_SOURCES_CXX} userlib2.cpp jsoncpp.cpp)

target_link_libraries(userlib fastrtps fastcdr ${CMAKE_DL_LIBS})
target_link_libraries(userlib2 fastrtps fastcdr ${CMAKE_DL_LIBS})

#target_link_libraries(RSManager rslib fastrtps fastcdr tinyxml2)

#target_link_libraries(tis_ngsiv2 RSManager ${CMAKE_DL_LIBS} -L/usr/lib/x86_64-linux-gnu curl curlpp pthread ${Boost_LIBRARIES} boost_system)
Loading

0 comments on commit 3adc6ab

Please sign in to comment.