From cd516d470fed232d1313367b3bd8aa9ce6408d9f Mon Sep 17 00:00:00 2001 From: Daisuke Sato Date: Tue, 21 Dec 2021 18:11:51 +0900 Subject: [PATCH] Update ROS package configuration (#6) --- CMakeLists.txt | 26 +++++++++++++------ ...x219-jetson-nano-160deg-fov-csi_cam_1.yaml | 26 +++++++++++++++++++ package.xml | 4 ++- 3 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 config/sainsmart-imx219-jetson-nano-160deg-fov-csi_cam_1.yaml diff --git a/CMakeLists.txt b/CMakeLists.txt index b15763a..f40db7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ project(jetson_nano_cuda_csi_cam) find_package(catkin REQUIRED COMPONENTS roscpp - std_msgs sensor_msgs ) @@ -16,7 +15,7 @@ message("-- CUDA version: ${CUDA_VERSION}") ################################### catkin_package( - CATKIN_DEPENDS roscpp std_msgs sensor_msgs + CATKIN_DEPENDS roscpp sensor_msgs ) ########### @@ -31,6 +30,7 @@ include_directories( include_directories(${PROJECT_INCLUDE_DIR} ${PROJECT_INCLUDE_DIR}/jetson-utils) include_directories(/usr/include/gstreamer-1.0 /usr/include/glib-2.0 /usr/include/libxml2 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/include /usr/lib/x86_64-linux-gnu/gstreamer-1.0/include/ /usr/lib/aarch64-linux-gnu/glib-2.0/include/ /usr/lib/x86_64-linux-gnu/glib-2.0/include/) +link_directories(/usr/lib/aarch64-linux-gnu/tegra) add_executable(video_stream src/video_stream_node.cpp src/image_converter.cpp) target_link_libraries(video_stream ${catkin_LIBRARIES} jetson-utils) @@ -40,13 +40,23 @@ target_link_libraries(video_stream ${catkin_LIBRARIES} jetson-utils) ## Install ## ############# -foreach(dir launch config) - install(DIRECTORY ${dir}/ - DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir} - ) -endforeach(dir) +# Mark executables and/or libraries for installation +install(TARGETS video_stream + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +# Mark cpp header files for installation +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) + +# Mark other files for installation (e.g. launch and bag files, etc.) +install(DIRECTORY config launch + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) ############# ## Testing ## ############# - diff --git a/config/sainsmart-imx219-jetson-nano-160deg-fov-csi_cam_1.yaml b/config/sainsmart-imx219-jetson-nano-160deg-fov-csi_cam_1.yaml new file mode 100644 index 0000000..3d98bb2 --- /dev/null +++ b/config/sainsmart-imx219-jetson-nano-160deg-fov-csi_cam_1.yaml @@ -0,0 +1,26 @@ +image_width: 480 +image_height: 270 +camera_name: csi_cam_1 +camera_matrix: + rows: 3 + cols: 3 + data: [ 420.01343, 0. , 254.07253, + 0. , 422.67127, 123.39681, + 0. , 0. , 1. ] +distortion_model: plumb_bob +distortion_coefficients: + rows: 1 + cols: 5 + data: [-0.400270, 0.195073, 0.008603, -0.003068, 0.000000] +rectification_matrix: + rows: 3 + cols: 3 + data: [ 1., 0., 0., + 0., 1., 0., + 0., 0., 1.] +projection_matrix: + rows: 3 + cols: 4 + data: [ 362.20416, 0. , 256.10214, 0. , + 0. , 405.09357, 123.67604, 0. , + 0. , 0. , 1. , 0. ] diff --git a/package.xml b/package.xml index 456462c..6763c48 100644 --- a/package.xml +++ b/package.xml @@ -14,8 +14,10 @@ https://github.com/rt-net/jetson_nano_cuda_csi_cam_ros catkin + camera_info_manager + image_transport + image_transport_plugins roscpp sensor_msgs - std_msgs \ No newline at end of file