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

Port to ROS 2 #44

Merged
merged 54 commits into from
Aug 30, 2019
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
a99e75a
Rough port of interactive marker server
sloretz Jun 4, 2019
aebb97f
Rename headers
jacobperron Jul 10, 2019
2ee853e
[WIP] Get client to compile
jacobperron Jul 10, 2019
226a4e0
Client compiling
jacobperron Jul 16, 2019
79dfc02
Cleanup package.xml
jacobperron Jul 16, 2019
5a4b6f0
Add linter tests
jacobperron Jul 16, 2019
31f6056
Uncrustify
jacobperron Jul 16, 2019
754009a
Lint
jacobperron Jul 16, 2019
1729212
Do not run flake8 linter test
jacobperron Jul 16, 2019
3c446ea
Add LICENSE and CONTRIBUTING.md
jacobperron Jul 16, 2019
b477c55
Fix deprecation warning
jacobperron Jul 16, 2019
17d934f
Use rcutils log macro instead of custom macro
jacobperron Jul 18, 2019
c34da0e
Use tf2::BufferCoreInterface
jacobperron Jul 18, 2019
a33aae0
Replace 'init' topic with a ROS service
jacobperron Jul 22, 2019
816b857
Add tests for InteractiveMarkerServer
jacobperron Jul 24, 2019
a1466fc
Lint after rebase
jacobperron Jul 24, 2019
79062ce
Add getter for client state
jacobperron Jul 24, 2019
bf72f64
Wait for service to be ready during INIT state
jacobperron Jul 24, 2019
bedff88
Add tests for InteractiveMarkerClient + fix tf2 dependency
jacobperron Jul 24, 2019
980f1cb
Minor refactoring
jacobperron Jul 29, 2019
7eaeeab
Major refactor
jacobperron Jul 30, 2019
7be1215
More refactoring
jacobperron Aug 6, 2019
2663078
Remove old test code and unused single_client.hpp
jacobperron Aug 6, 2019
1bb72aa
Refactor tools docs
jacobperron Aug 7, 2019
715ff69
Remove notion of server ID
jacobperron Aug 7, 2019
e06f1ce
Add missing MockInteractiveMarkerServer
jacobperron Aug 7, 2019
05639e4
Refactor interactive marker client docs
jacobperron Aug 9, 2019
b840d10
Update copyright license
jacobperron Aug 9, 2019
e7e2b16
Reduce spam
jacobperron Aug 19, 2019
a94e65e
Make shared library
jacobperron Aug 19, 2019
bbf7f8f
Guard against invalid namespace
jacobperron Aug 22, 2019
6d6da9f
Add feedback publisher to client
jacobperron Aug 22, 2019
2f1dd42
Call reset callback
jacobperron Aug 22, 2019
7dc225c
Add reset callback test and fix deconstructor bug
jacobperron Aug 22, 2019
e5d7ebf
Implement client request timeout
jacobperron Aug 22, 2019
14fef39
Add logic for 'extrapolation into future' error
jacobperron Aug 22, 2019
b7b6f25
Update TODO
jacobperron Aug 22, 2019
b42ce43
Add missing test depend on ament_cmake_gtest
jacobperron Aug 22, 2019
1e90766
Default to C++14 and set stricter compiler flags
jacobperron Aug 22, 2019
f95a235
Fix compiler warnings
jacobperron Aug 22, 2019
5d01022
Fix Windows compiler warnings
jacobperron Aug 22, 2019
12cabda
Remove StateMachine class
jacobperron Aug 22, 2019
aae3258
Fix Clang warnings
jacobperron Aug 22, 2019
762c72c
Remove include
jacobperron Aug 22, 2019
1f6ed3a
Move message context header into same directory as other headers
jacobperron Aug 22, 2019
4f41d7f
Revert "Fix Clang warnings"
jacobperron Aug 22, 2019
0dc3cef
Use uint64_t type specifier
jacobperron Aug 22, 2019
5891e0e
Attempt to resolve Windows build failure
jacobperron Aug 26, 2019
5507bf1
Workaround windows preprocessor
jacobperron Aug 26, 2019
09b26b4
Use visibility macros
jacobperron Aug 26, 2019
1ca267b
Fix conversion warnings
jacobperron Aug 26, 2019
f8ea7dc
Fix visibility macro usage
jacobperron Aug 29, 2019
063b0e5
Fix MSVC warnings
jacobperron Aug 29, 2019
899bb0f
Change error message to avoid false positive due to bug in CI setup
jacobperron Aug 30, 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
133 changes: 79 additions & 54 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,67 +1,92 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(interactive_markers)
find_package(catkin REQUIRED
rosconsole
roscpp
rospy
rostest
std_msgs
tf
visualization_msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES interactive_markers
CATKIN_DEPENDS roscpp rosconsole rospy tf visualization_msgs
)
catkin_python_setup()

include_directories(include ${catkin_INCLUDE_DIRS})
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

add_library(${PROJECT_NAME}
src/interactive_marker_server.cpp
src/tools.cpp
src/menu_handler.cpp
src/interactive_marker_client.cpp
src/single_client.cpp
src/message_context.cpp
)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rmw REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)

add_library(${PROJECT_NAME} SHARED
src/interactive_marker_server.cpp
src/tools.cpp
src/menu_handler.cpp
src/interactive_marker_client.cpp
src/message_context.cpp
)
target_include_directories(${PROJECT_NAME} PUBLIC include)
ament_target_dependencies(${PROJECT_NAME}
"rclcpp"
"rmw"
"tf2"
"tf2_geometry_msgs"
"visualization_msgs")

install(TARGETS ${PROJECT_NAME}
DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
install(DIRECTORY include/interactive_markers/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h")
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

# C++ Unit Tests
#
if(CATKIN_ENABLE_TESTING)
include_directories(${GTEST_INCLUDE_DIRS})
install(
DIRECTORY include/
DESTINATION include)

add_executable(server_test EXCLUDE_FROM_ALL src/test/server_test.cpp)
target_link_libraries(server_test ${PROJECT_NAME} ${GTEST_LIBRARIES})
add_dependencies(tests server_test)
add_rostest(test/cpp_server.test)
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME}
PRIVATE "INTERACTIVE_MARKERS_BUILDING_LIBRARY")

add_executable(client_test EXCLUDE_FROM_ALL src/test/client_test.cpp)
target_link_libraries(client_test ${PROJECT_NAME} ${GTEST_LIBRARIES})
add_dependencies(tests client_test)
add_rostest(test/cpp_client.test)
ament_export_dependencies("rclcpp")
ament_export_dependencies("rmw")
ament_export_dependencies("tf2")
ament_export_dependencies("tf2_geometry_msgs")
ament_export_dependencies("visualization_msgs")
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})

add_executable(server_client_test EXCLUDE_FROM_ALL src/test/server_client_test.cpp)
target_link_libraries(server_client_test ${PROJECT_NAME} ${GTEST_LIBRARIES})
add_dependencies(tests server_client_test)
add_rostest(test/cpp_server_client.test)
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(std_msgs REQUIRED)

# Test program to simulate Interactive Marker with missing tf information
add_executable(bursty_tf EXCLUDE_FROM_ALL src/test/bursty_tf.cpp)
target_link_libraries(bursty_tf ${PROJECT_NAME})
add_dependencies(tests bursty_tf)
set(ament_cmake_flake8_FOUND TRUE)
ament_lint_auto_find_test_dependencies()

# Test program to simulate Interactive Marker with wrong tf information
add_executable(missing_tf EXCLUDE_FROM_ALL src/test/missing_tf.cpp)
target_link_libraries(missing_tf ${PROJECT_NAME})
add_dependencies(tests missing_tf)
ament_add_gtest(test_interactive_marker_server
test/${PROJECT_NAME}/test_interactive_marker_server.cpp
)
ament_target_dependencies(test_interactive_marker_server
"geometry_msgs"
"rclcpp"
"std_msgs"
)
target_link_libraries(test_interactive_marker_server
${PROJECT_NAME}
)

ament_add_gtest(test_interactive_marker_client
test/${PROJECT_NAME}/test_interactive_marker_client.cpp
)
ament_target_dependencies(test_interactive_marker_client
"geometry_msgs"
"rclcpp"
"std_msgs"
"tf2"
)
target_link_libraries(test_interactive_marker_client
${PROJECT_NAME}
)
endif()

ament_package()
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Any contribution that you make to this repository will
be under the BSD license 2.0, as dictated by that
[license](https://opensource.org/licenses/BSD-3-Clause).
32 changes: 32 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Copyright (c) 2012, Willow Garage, Inc.
Copyright (c) 2019, Open Source Robotics Foundation, Inc.
All rights reserved.

Software License Agreement (BSD License 2.0)

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
93 changes: 0 additions & 93 deletions include/interactive_markers/detail/message_context.h

This file was deleted.

Loading