-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from yangmingustb/1227
tool: add tf2
- Loading branch information
Showing
41 changed files
with
10,133 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
||
cc_library( | ||
name = "tf2", | ||
srcs = [ | ||
"src/buffer_core.cpp", | ||
"src/cache.cpp", | ||
"src/static_cache.cpp", | ||
"src/time.cpp", | ||
], | ||
hdrs = glob([ | ||
"include/geometry_msgs/**", | ||
"include/tf2_msgs/**", | ||
"include/tf2/**", | ||
]), | ||
strip_include_prefix = "include", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@boost", | ||
], | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(tf2 CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_FLAGS "-fPIC -DNDEBUG -O3 -pipe -Wall") | ||
|
||
# set (CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/build/install CACHE STRING "" FORCE) | ||
# set (UNIT_TEST_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/tests CACHE STRING "" FORCE) | ||
# set(CMAKE_CXX_FLAGS "-std=c++11 -pthread -fPIE -fPIC -Wno-deprecated -pipe -W -Werror -Wall -g -O2" CACHE STRING "" FORCE) | ||
|
||
find_package(Boost REQUIRED COMPONENTS system thread) | ||
include_directories( | ||
include | ||
${Boost_INCLUDE_DIR} # for signals2 is header only | ||
) | ||
|
||
option(BUILD_TESTS "Build the tests" ON) | ||
|
||
# export user definitions | ||
#CPP Libraries | ||
add_library(tf2 SHARED | ||
src/cache.cpp | ||
src/buffer_core.cpp | ||
src/static_cache.cpp | ||
src/time.cpp | ||
) | ||
|
||
target_link_libraries(tf2 | ||
${Boost_LIBRARIES} | ||
) | ||
|
||
# ${catkin_LIBRARIES} ${console_bridge_LIBRARIES}) | ||
|
||
install(TARGETS ${PROJECT_NAME} DESTINATION | ||
${CMAKE_INSTALL_PREFIX}/lib | ||
) | ||
|
||
install(DIRECTORY include DESTINATION | ||
${CMAKE_INSTALL_PREFIX} | ||
) | ||
|
||
install(FILES README.md DESTINATION | ||
${CMAKE_INSTALL_PREFIX} | ||
) | ||
|
||
if (BUILD_TESTS) | ||
include(cmake/GTest.cmake) | ||
fetch_googletest( | ||
${PROJECT_SOURCE_DIR}/cmake | ||
${PROJECT_BINARY_DIR}/googletest | ||
) | ||
enable_testing() | ||
add_subdirectory(test) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# tf2-apollo | ||
|
||
## Intro | ||
|
||
tf2-apollo was Apollo's clone of ROS tf2 for coordinate transforms. | ||
It seems that it was based on `ros/geometry2` tagged `0.5.16` | ||
|
||
## How to build | ||
|
||
``` | ||
mkdir build && cd build | ||
cmake .. -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/tf2 | ||
make -j$(nproc) | ||
sudo make install | ||
``` | ||
|
||
## gtest support for tf2-apollo | ||
|
||
In order not to build gtest into our docker image, gtest support for tf2 was | ||
implemented according to https://crascit.com/2015/07/25/cmake-gtest | ||
|
||
## Reference | ||
- https://github.com/ros/geometry2 | ||
- http://wiki.ros.org/geometry2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# the following code to fetch googletest | ||
# is inspired by and adapted after https://crascit.com/2015/07/25/cmake-gtest/ | ||
# download and unpack googletest at configure time | ||
|
||
macro(fetch_googletest _download_module_path _download_root) | ||
set(GOOGLETEST_DOWNLOAD_ROOT ${_download_root}) | ||
configure_file( | ||
${_download_module_path}/GTestDownload.cmake | ||
${_download_root}/CMakeLists.txt | ||
@ONLY | ||
) | ||
unset(GOOGLETEST_DOWNLOAD_ROOT) | ||
|
||
execute_process( | ||
COMMAND | ||
"${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . | ||
WORKING_DIRECTORY | ||
${_download_root} | ||
) | ||
execute_process( | ||
COMMAND | ||
"${CMAKE_COMMAND}" --build . | ||
WORKING_DIRECTORY | ||
${_download_root} | ||
) | ||
|
||
# adds the targers: gtest, gtest_main, gmock, gmock_main | ||
add_subdirectory( | ||
${_download_root}/googletest-src | ||
${_download_root}/googletest-build | ||
) | ||
endmacro() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# code copied from https://crascit.com/2015/07/25/cmake-gtest/ | ||
cmake_minimum_required(VERSION 3.5 FATAL_ERROR) | ||
project(GoogleTestDownload NONE) | ||
|
||
include(ExternalProject) | ||
ExternalProject_Add(googletest | ||
SOURCE_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-src" | ||
BINARY_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-build" | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG release-1.10.0 | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
TEST_COMMAND "" | ||
) |
Oops, something went wrong.