Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ros2 crystal #23

Open
wants to merge 33 commits into
base: ros2-crystal
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
279240a
Modified CMakeLists.txt and package.xml according to ROS2 migration g…
vandanamandlik Dec 17, 2018
067deb9
ROS2 changes for launch file.
vandanamandlik Dec 17, 2018
7e9d350
Modified AssembleScans.srv and AssembleScans2.srv for ROS2.
vandanamandlik Dec 17, 2018
654d367
Added point_cloud_conversion.h and point_field_conversion.h files.
vandanamandlik Dec 17, 2018
fff899e
Renamed base_assembler.h file to base_assembler.hpp.
vandanamandlik Dec 17, 2018
8b43aa2
Renamed base_assembler.h file to base_assembler.hpp
vandanamandlik Dec 17, 2018
47f192d
Added message_filter.hpp file to include directory of this package
vandanamandlik Dec 17, 2018
d1ae9de
Added service code which generates structure for request and response…
vandanamandlik Dec 17, 2018
3b9f7a7
Modified periodic_snapshotter.cpp file as per ros2 migration guide.
vandanamandlik Dec 17, 2018
81c094b
Ported laser_scan_assembler.cpp file to ROS2.
vandanamandlik Dec 17, 2018
1bdc082
Modified following files to ROS2 as per ROS2 migration guide.
vandanamandlik Dec 17, 2018
fdf9591
Ported test/dummy_scan_producer.cpp and test/test_assembler.cpp files…
vandanamandlik Dec 17, 2018
2b0d65f
Modified message_filter.hpp and tested with crystal release.
vandanamandlik Dec 18, 2018
2b09d96
cpp lint and python flake8 changes for laser_assembler.
vandanamandlik Dec 20, 2018
176669a
Added CONTRIBUTING.md and LICENSE file.
vandanamandlik Dec 20, 2018
d6c1b71
Replaced printf with ROS2 logging functions.
vandanamandlik Dec 21, 2018
f8ce9ab
Code cleanup
vandanamandlik Dec 21, 2018
bd19264
Removed commented code from CMakeLists.txt.
vandanamandlik Dec 21, 2018
081d2d7
- Applied linter (cpp_lint, uncrustify, lint_cmake etc) for code format.
vandanamandlik Dec 27, 2018
64ed3c8
Added Ros2 migration read me file.
vandanamandlik Dec 28, 2018
17baa16
Formatted ros2_migration_readme.md file
vandanamandlik Dec 28, 2018
c885af4
modified Ros2_migration_readme file.
vandanamandlik Dec 28, 2018
67771c8
Added ament_export_dependencies for laser_geometry package in CMakeLi…
vandanamandlik Dec 28, 2018
4eebfab
Added comments in source code and removed some unused code.
vandanamandlik Dec 28, 2018
4beead3
- Changed "filters/filter_chain.h" include to "filters/filter_chain.h…
vandanamandlik Jan 1, 2019
ed03910
Renamed ros2_migration_readme.md file to README.md.
vandanamandlik Jan 2, 2019
4995443
Changes for Crystal
vandanamandlik Jan 2, 2019
5dbb984
Replaced (nanoseconds()/1e+9) with seconds() funtion as it is availab…
vandanamandlik Jan 2, 2019
295d77f
Updated readme file
vandanamandlik Jan 9, 2019
b07b637
Update readme
vandanamandlik Jan 11, 2019
31c05a6
Removed filters_FOUND from CMakeLists.txt file.
vandanamandlik Jan 17, 2019
4011206
Removed laser_assembler_srv_gen, now laser_assembler.srv is generated…
vandanamandlik Jan 18, 2019
188675a
Ported merge_clouds.cpp, point_cloud2_assembler.cpp and point_cloud_a…
vandanamandlik Jan 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 122 additions & 86 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,102 +1,138 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(laser_assembler)

##############################################################################
# Find dependencies
##############################################################################

set(THIS_PACKAGE_ROS_DEPS
tf sensor_msgs message_filters roscpp laser_geometry filters)

find_package(catkin REQUIRED COMPONENTS
${THIS_PACKAGE_ROS_DEPS}
message_generation)
find_package(Boost REQUIRED COMPONENTS system signals)
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

##############################################################################
# Build service definitions
##############################################################################
add_service_files(FILES
AssembleScans.srv
AssembleScans2.srv)

generate_messages(DEPENDENCIES sensor_msgs std_msgs)

##############################################################################
# Define package
##############################################################################

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS ${THIS_PACKAGE_ROS_DEPS} message_runtime
DEPENDS
)

##############################################################################
# Build
##############################################################################
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()

add_executable(laser_scan_assembler_srv src/laser_scan_assembler_srv.cpp)
target_link_libraries(laser_scan_assembler_srv ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(laser_scan_assembler_srv ${PROJECT_NAME}_gencpp)
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(rosidl_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(message_filters REQUIRED)
find_package(laser_geometry REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2 REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(filters REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME} "srv/AssembleScans.srv"
"srv/AssembleScans2.srv"
DEPENDENCIES builtin_interfaces sensor_msgs)

set(INCLUDE_DIRS include ${ament_cmake_INCLUDE_DIRS}
${rosidl_default_generators_INCLUDE_DIRS} ${signals_INCLUDE_DIRS}
${builtin_interfaces_INCLUDE_DIRS} ${rclcpp_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS} ${std_msgs_INCLUDE_DIRS}
${laser_geometry_INCLUDE_DIRS}
${tf2_ros_INCLUDE_DIRS} ${tf2_INCLUDE_DIRS}
${message_filters_INCLUDE_DIRS}
${rostest_INCLUDE_DIRS} ${system_INCLUDE_DIRS}
${geometry_msgs_INCLUDE_DIRS}
${filters_INCLUDE_DIRS})

include_directories(${INCLUDE_DIRS})

set(LIBS ${rclcpp_LIBRARIES} ${ament_cmake_LIBRARIES}
${rosidl_default_generators_LIBRARIES} ${signals_LIBRARIES}
${std_msgs_LIBRARIES}
${system_LIBRARIES} ${tf2_ros_LIBRARIES} ${tf2_LIBRARIES}
${laser_geometry_LIBRARIES}
${geometry_msgs_LIBRARIES}
${message_filters_LIBRARIES} ${sensor_msgs_LIBRARIES}
${filters_LIBRARIES})

add_executable(laser_scan_assembler src/laser_scan_assembler.cpp)
target_link_libraries(laser_scan_assembler ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(laser_scan_assembler ${PROJECT_NAME}_gencpp)

add_executable(merge_clouds src/merge_clouds.cpp)
target_link_libraries(merge_clouds ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(merge_clouds ${PROJECT_NAME}_gencpp)

add_executable(point_cloud_assembler_srv src/point_cloud_assembler_srv.cpp)
target_link_libraries(point_cloud_assembler_srv ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(point_cloud_assembler_srv ${PROJECT_NAME}_gencpp)
target_link_libraries(laser_scan_assembler ${LIBS})
rosidl_target_interfaces(laser_scan_assembler
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS laser_scan_assembler
DESTINATION lib/${PROJECT_NAME})

add_executable(point_cloud_assembler src/point_cloud_assembler.cpp)
target_link_libraries(point_cloud_assembler ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(point_cloud_assembler ${PROJECT_NAME}_gencpp)

add_executable(point_cloud2_assembler src/point_cloud2_assembler.cpp)
target_link_libraries(point_cloud2_assembler ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(point_cloud2_assembler ${PROJECT_NAME}_gencpp)
target_link_libraries(point_cloud_assembler ${LIBS})
rosidl_target_interfaces(point_cloud_assembler
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS point_cloud_assembler
DESTINATION lib/${PROJECT_NAME})

## unit testing
add_executable(merge_clouds src/merge_clouds.cpp)
target_link_libraries(merge_clouds ${LIBS})
rosidl_target_interfaces(merge_clouds
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS merge_clouds
DESTINATION lib/${PROJECT_NAME})

if(CATKIN_ENABLE_TESTING)
find_package(rostest)
add_executable(point_cloud2_assembler src/point_cloud2_assembler.cpp)
target_link_libraries(point_cloud2_assembler ${LIBS})
rosidl_target_interfaces(point_cloud2_assembler
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS point_cloud2_assembler
DESTINATION lib/${PROJECT_NAME})

include_directories(include)

install(DIRECTORY "include/"
DESTINATION include)

install(TARGETS laser_scan_assembler
DESTINATION lib/${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include)

ament_export_include_directories(include)
ament_export_dependencies(rclcpp)
ament_export_dependencies(signals)
ament_export_dependencies(sensor_msgs)
ament_export_dependencies(tf2_ros)
ament_export_dependencies(tf2)
ament_export_dependencies(message_filters)
ament_export_dependencies(laser_geometry)
ament_export_include_directories(${INCLUDE_DIRS})

install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}
)

add_executable(periodic_snapshotter examples/periodic_snapshotter.cpp)
target_link_libraries(periodic_snapshotter ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(periodic_snapshotter ${PROJECT_NAME}_gencpp)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()

add_executable(dummy_scan_producer test/dummy_scan_producer.cpp)
target_link_libraries(dummy_scan_producer ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_dependencies(dummy_scan_producer ${PROJECT_NAME}_gencpp)
target_link_libraries(dummy_scan_producer ${LIBS})
rosidl_target_interfaces(dummy_scan_producer
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS dummy_scan_producer
DESTINATION lib/${PROJECT_NAME})

ament_add_gtest(test_assembler test/test_assembler.cpp)
target_link_libraries(test_assembler ${LIBS})
rosidl_target_interfaces(test_assembler
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS test_assembler
DESTINATION lib/${PROJECT_NAME})

add_executable(test_assembler test/test_assembler.cpp)
target_link_libraries(test_assembler ${catkin_LIBRARIES} ${Boost_LIBRARIES} gtest)
add_dependencies(test_assembler ${PROJECT_NAME}_gencpp)
add_executable(periodic_snapshotter examples/periodic_snapshotter.cpp)
target_link_libraries(periodic_snapshotter ${LIBS})
rosidl_target_interfaces(periodic_snapshotter
${PROJECT_NAME} "rosidl_typesupport_cpp")
install(
TARGETS periodic_snapshotter
DESTINATION lib/${PROJECT_NAME})

add_rostest(test/test_laser_assembler.launch)
endif()

##############################################################################
# Install
##############################################################################

install(TARGETS
laser_scan_assembler_srv
laser_scan_assembler
merge_clouds
point_cloud_assembler_srv
point_cloud_assembler
point_cloud2_assembler
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

# Install headers
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
ament_package()
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Any contribution that you make to this repository will
be under the Apache 2 License, as dictated by that
[license](http://www.apache.org/licenses/LICENSE-2.0.html):

~~~
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
~~~
Loading