Skip to content

Commit a5a18b2

Browse files
committed
feat:add lane line rigid tform
1 parent b24beba commit a5a18b2

18 files changed

+4476
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ add_subdirectory(ThirdParty/rigidTform2d)
1919
add_subdirectory(ThirdParty/selectUniform2)
2020
add_subdirectory(ThirdParty/slamMapGraph2D)
2121
add_subdirectory(ThirdParty/poseGraphOptimize)
22-
22+
add_subdirectory(ThirdParty/estgeotform2dForPtsAndLines)
2323

2424
add_executable(rigidTform2d ThirdParty/rigidTform2d/examples/main.cpp)
2525
target_include_directories(rigidTform2d PRIVATE
@@ -52,6 +52,7 @@ selectUniform2
5252
slamMapGraph2D
5353
poseGraphOptimize
5454
estimateAffineRigid2D
55+
estgeotform2dForPtsAndLines
5556
m)
5657
message(STATUS "CMAKE_CURRENT_SOURCE_DIR:${CMAKE_CURRENT_SOURCE_DIR}")
5758

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
######################################################################
2+
# CMakeLists.txt generated for component estgeotform2dForPtsAndLines
3+
# Product type: static library
4+
######################################################################
5+
cmake_minimum_required(VERSION 3.12)
6+
# project(estgeotform2dForPtsAndLines)
7+
if(DEFINED ENV{CMAKE_EXPORT_COMPILE_COMMANDS} AND NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
8+
set(CMAKE_EXPORT_COMPILE_COMMANDS $ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
9+
endif()
10+
11+
12+
######################################################################
13+
## Path variables
14+
######################################################################
15+
get_filename_component(START_DIR ./ ABSOLUTE)
16+
set(MATLAB_ROOT /opt/matlab/R2023a CACHE PATH "")
17+
if(${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
18+
set(BUILDING_IN_SOURCE_DIR TRUE)
19+
set(BINARY_START_DIR "${START_DIR}")
20+
else()
21+
set(BUILDING_IN_SOURCE_DIR FALSE)
22+
set(BINARY_START_DIR "${CMAKE_BINARY_DIR}")
23+
endif()
24+
if(WIN32 AND NOT MINGW)
25+
set(SYSLIB_PREFIX "lib")
26+
else()
27+
set(SYSLIB_PREFIX "")
28+
endif()
29+
30+
######################################################################
31+
## System libraries
32+
######################################################################
33+
find_library(FOUND_LIBM m NO_SYSTEM_ENVIRONMENT_PATH PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
34+
${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
35+
find_library(FOUND_LIBSTDCXX stdc++ NO_SYSTEM_ENVIRONMENT_PATH PATHS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
36+
${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
37+
38+
######################################################################
39+
## Target definition and commands
40+
######################################################################
41+
add_library(estgeotform2dForPtsAndLines SHARED ${START_DIR}/rt_nonfinite.cpp
42+
${START_DIR}/rtGetNaN.cpp
43+
${START_DIR}/rtGetInf.cpp
44+
${START_DIR}/estgeotform2dForPtsAndLines.cpp)
45+
set_target_properties(estgeotform2dForPtsAndLines PROPERTIES
46+
PREFIX ""
47+
POSITION_INDEPENDENT_CODE ON
48+
RUNTIME_OUTPUT_DIRECTORY "${BINARY_START_DIR}/$<0:>"
49+
LIBRARY_OUTPUT_DIRECTORY "${BINARY_START_DIR}/$<0:>"
50+
ARCHIVE_OUTPUT_DIRECTORY "${BINARY_START_DIR}/$<0:>")
51+
target_compile_features(estgeotform2dForPtsAndLines PUBLIC cxx_std_11)
52+
target_compile_definitions(estgeotform2dForPtsAndLines PRIVATE -DMODEL=estgeotform2dForPtsAndLines)
53+
target_include_directories(estgeotform2dForPtsAndLines PUBLIC $<BUILD_INTERFACE:${START_DIR}>
54+
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>>
55+
$<BUILD_INTERFACE:${START_DIR}>
56+
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>>
57+
$<BUILD_INTERFACE:${MATLAB_ROOT}/extern/include>)
58+
target_link_libraries(estgeotform2dForPtsAndLines INTERFACE $<$<BOOL:${FOUND_LIBM}>:m>
59+
$<$<BOOL:${FOUND_LIBSTDCXX}>:stdc++>)
60+
61+
62+
######################################################################
63+
## Build success message
64+
######################################################################
65+
add_custom_command(TARGET estgeotform2dForPtsAndLines POST_BUILD
66+
COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan "\\#\\#\\# Created library: $<TARGET_FILE:estgeotform2dForPtsAndLines>")
67+
68+
######################################################################
69+
## Call toolchain hook function if defined
70+
######################################################################
71+
if(COMMAND toolchain_target_hook)
72+
toolchain_target_hook(estgeotform2dForPtsAndLines)
73+
endif()

0 commit comments

Comments
 (0)