Skip to content

Commit 4d363c5

Browse files
committed
add c++ code for visualziation && voxel map
1 parent 652afc8 commit 4d363c5

22 files changed

+816
-98
lines changed

CMakeLists.txt

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,37 @@ cmake_minimum_required(VERSION 2.8.3)
22
project(segmentation_projection)
33

44
## Compile as C++11, supported in ROS Kinetic and newer
5-
# add_compile_options(-std=c++11)
5+
add_compile_options(-std=c++11)
66

77
## Find catkin macros and libraries
88
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
99
## is used, also find other catkin packages
1010
find_package(catkin REQUIRED COMPONENTS
1111
message_filters
1212
rospy
13+
#octomap
1314
sensor_msgs
15+
geometry_msgs
16+
nav_msgs
17+
tf2_ros
18+
cassie_msgs
1419
cv_bridge
20+
pcl_ros
21+
tf_conversions
22+
eigen_conversions
1523
)
1624

1725
## System dependencies are found with CMake's conventions
1826
# find_package(Boost REQUIRED COMPONENTS system)
27+
find_package(PCL REQUIRED)
28+
link_directories(${PCL_LIBRARY_DIRS})
29+
add_definitions(${PCL_DEFINITIONS})
1930

31+
find_package(Eigen3 REQUIRED)
32+
33+
#find_package(octomap REQUIRED)
34+
#include_directories(${OCTOMAP_INCLUDE_DIRS})
35+
#target_link_libraries(${OCTOMAP_LIBRARIES})
2036

2137
## Uncomment this if the package has a setup.py. This macro ensures
2238
## modules and global scripts declared therein get installed
@@ -104,7 +120,7 @@ catkin_python_setup()
104120
## CATKIN_DEPENDS: catkin_packages dependent projects also need
105121
## DEPENDS: system dependencies of this project that dependent projects also need
106122
catkin_package(
107-
# INCLUDE_DIRS include
123+
INCLUDE_DIRS include
108124
# LIBRARIES segmentation_projection
109125
# CATKIN_DEPENDS message_filter rospy sensor_msgs
110126
# DEPENDS system_lib
@@ -117,10 +133,14 @@ catkin_package(
117133
## Specify additional locations of header files
118134
## Your package locations should be listed before other locations
119135
include_directories(
120-
# include
121-
${catkin_INCLUDE_DIRS}
136+
include
137+
${catkin_INCLUDE_DIRS}
138+
${PCL_INCLUDE_DIRS}
139+
${EIGEN3_INCLUDE_DIRS}
122140
)
123141

142+
143+
124144
## Declare a C++ library
125145
# add_library(${PROJECT_NAME}
126146
# src/${PROJECT_NAME}/segmentation_projection.cpp
@@ -134,7 +154,7 @@ include_directories(
134154
## Declare a C++ executable
135155
## With catkin_make all packages are built within a single CMake context
136156
## The recommended prefix ensures that target names across packages don't collide
137-
# add_executable(${PROJECT_NAME}_node src/segmentation_projection_node.cpp)
157+
add_executable(labeled_pc_map_node src/labeled_pc_map_node.cpp)
138158

139159
## Rename C++ executable without prefix
140160
## The above recommended prefix causes long target names, the following renames the
@@ -147,9 +167,11 @@ include_directories(
147167
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
148168

149169
## Specify libraries to link a library or executable target against
150-
# target_link_libraries(${PROJECT_NAME}_node
151-
# ${catkin_LIBRARIES}
152-
# )
170+
target_link_libraries(labeled_pc_map_node
171+
${catkin_LIBRARIES}
172+
${PCL_COMMON_LIBRARIES}
173+
${PCL_IO_LIBRARIES}
174+
)
153175

154176
#############
155177
## Install ##
@@ -161,7 +183,7 @@ include_directories(
161183
## Mark executable scripts (Python etc.) for installation
162184
## in contrast to setup.py, you can choose the destination
163185
install(PROGRAMS
164-
scripts/segmentation_projection_node scripts/projection.py
186+
scripts/segmentation_projection_node scripts/projection.py scripts/gt_pose2bag.py
165187
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
166188
)
167189

config/nclt_cam2lidar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ def sixdof_to_transformation(sixdof):
6868
T_c_lb3 = np.linalg.inv(T_lb3_c)
6969
# because nclt lidar are in the body frame .........
7070
T_c_body = np.matmul(T_c_lb3, T_lb3_body)
71-
np.save(sys.argv[2], T_c_body)
71+
np.save(sys.argv[2], (T_c_body))
7272

config/nclt_cams/x_lb3_c0.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.000920, -0.000569, 0.062413, -0.028132, 0.196467, 0.248664

config/nclt_cams/x_lb3_c1.csv

100755100644
File mode changed.

config/nclt_cams/x_lb3_c2.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-0.032674, 0.025928, 0.000176, 160.101024, 89.836345, -56.101163

config/nclt_cams/x_lb3_c3.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-0.034969, -0.022993, 0.000030, 95.603967, 89.724274, -48.640335

config/nclt_cams/x_lb3_c4.csv

100755100644
File mode changed.

config/nclt_cams/x_lb3_c5.csv

100755100644
File mode changed.

0 commit comments

Comments
 (0)