From ecb825bf7e791a12f95c4d14d9160d2a3899b95a Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Sat, 30 Dec 2017 15:30:09 -0800 Subject: [PATCH] Cleaned up packages and added new launch file --- .../UDEV Rules/99-rover-cameras.rules | 2 +- .../UDEV Rules/99-rover-usb-serial.rules | 4 +- .../ZED Settings/SN2129.conf | 86 ++++++++ rover/rover_camera/src/rover_camera.cpp | 4 +- rover/rover_main/CMakeLists.txt | 2 +- rover/rover_main/launch/rover_main.launch | 57 +++-- rover/rover_main/launch/rover_nav.launch | 6 + rover/rover_main/package.xml | 2 +- rover/uvc_capture/CMakeLists.txt | 198 ------------------ rover/uvc_capture/launch/uvc.launch | 25 --- rover/uvc_capture/launch/uvc_one_cam.launch | 13 -- rover/uvc_capture/package.xml | 65 ------ rover/zed_wrapper/launch/zed.launch | 2 +- 13 files changed, 146 insertions(+), 320 deletions(-) create mode 100644 environment_reference/ZED Settings/SN2129.conf create mode 100644 rover/rover_main/launch/rover_nav.launch delete mode 100644 rover/uvc_capture/CMakeLists.txt delete mode 100644 rover/uvc_capture/launch/uvc.launch delete mode 100644 rover/uvc_capture/launch/uvc_one_cam.launch delete mode 100644 rover/uvc_capture/package.xml diff --git a/environment_reference/UDEV Rules/99-rover-cameras.rules b/environment_reference/UDEV Rules/99-rover-cameras.rules index 0ed9276..78cd323 100644 --- a/environment_reference/UDEV Rules/99-rover-cameras.rules +++ b/environment_reference/UDEV Rules/99-rover-cameras.rules @@ -12,4 +12,4 @@ KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="046d", ATTRS{ KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="082d", ATTRS{serial}=="A98AA5FF", SYMLINK+="rover/camera_gimbal" # The special main nav cam -KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="05a3", ATTRS{idProduct}=="9422", ATTRS{serial}=="SN0001", SYMLINK+="rover/camera_main_navigation" +KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", ATTRS{idVendor}=="05a3", ATTRS{idProduct}=="9422", ATTRS{serial}=="SN0001", ATTR{index}=="0", SYMLINK+="rover/camera_main_navigation" diff --git a/environment_reference/UDEV Rules/99-rover-usb-serial.rules b/environment_reference/UDEV Rules/99-rover-usb-serial.rules index cb616b8..03d4f75 100644 --- a/environment_reference/UDEV Rules/99-rover-usb-serial.rules +++ b/environment_reference/UDEV Rules/99-rover-usb-serial.rules @@ -2,6 +2,6 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{seria SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTU9EU0I", ENV{ID_USB_INTERFACE_NUM}=="01", SYMLINK+="rover/ttyDEV1" -SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTU9EU0I", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="rover/ttyDEV2" +SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTU9EU0I", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="rover/ttyCompass" -SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTU9EU0I", ENV{ID_USB_INTERFACE_NUM}=="03", SYMLINK+="rover/ttyDEV3" +SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{serial}=="FTU9EU0I", ENV{ID_USB_INTERFACE_NUM}=="03", SYMLINK+="rover/ttyGPS" diff --git a/environment_reference/ZED Settings/SN2129.conf b/environment_reference/ZED Settings/SN2129.conf new file mode 100644 index 0000000..af78846 --- /dev/null +++ b/environment_reference/ZED Settings/SN2129.conf @@ -0,0 +1,86 @@ +[LEFT_CAM_2K] +cx = 1103.74 +cy = 663.956 +fx = 1389.02 +fy = 1389.02 +k1 = -0.175403 +k2 = 0.0278335 + + +[LEFT_CAM_FHD] +cx = 959.74 +cy = 582.956 +fx = 1389.02 +fy = 1389.02 +k1 = -0.175403 +k2 = 0.0278335 + + +[LEFT_CAM_HD] +cx = 638.37 +cy = 379.978 +fx = 694.512 +fy = 694.512 +k1 = -0.175403 +k2 = 0.0278335 + + +[LEFT_CAM_VGA] +cx = 334.185 +cy = 196.989 +fx = 347.256 +fy = 347.256 +k1 = -0.175403 +k2 = 0.0278335 + + +[RIGHT_CAM_2K] +cx = 1152.59 +cy = 667.942 +fx = 1393.95 +fy = 1393.95 +k1 = -0.175501 +k2 = 0.0279378 + + +[RIGHT_CAM_FHD] +cx = 1008.59 +cy = 586.942 +fx = 1393.95 +fy = 1393.95 +k1 = -0.175501 +k2 = 0.0279378 + + +[RIGHT_CAM_HD] +cx = 662.797 +cy = 381.971 +fx = 696.977 +fy = 696.977 +k1 = -0.175501 +k2 = 0.0279378 + + +[RIGHT_CAM_VGA] +cx = 346.399 +cy = 197.985 +fx = 348.489 +fy = 348.489 +k1 = -0.175501 +k2 = 0.0279378 + + +[STEREO] +BaseLine = 120.098 +CV_2K = 4.66838e-06 +CV_FHD = 4.66838e-06 +CV_HD = 4.66838e-06 +CV_VGA = 4.66838e-06 +RX_2K = 0.000518746 +RX_FHD = 0.000518746 +RX_HD = 0.000518746 +RX_VGA = 0.000518746 +RZ_2K = -0.00147751 +RZ_FHD = -0.00147751 +RZ_HD = -0.00147751 +RZ_VGA = -0.00147751 diff --git a/rover/rover_camera/src/rover_camera.cpp b/rover/rover_camera/src/rover_camera.cpp index 8735c59..a42588a 100644 --- a/rover/rover_camera/src/rover_camera.cpp +++ b/rover/rover_camera/src/rover_camera.cpp @@ -56,7 +56,7 @@ int main(int argc, char** argv) ros::Rate loop_rate(fps + 5); - while (node_handle.ok()) { + while (ros::ok()) { cap.read(image); @@ -73,4 +73,6 @@ int main(int argc, char** argv) ros::spinOnce(); loop_rate.sleep(); } + + cap.release(); } diff --git a/rover/rover_main/CMakeLists.txt b/rover/rover_main/CMakeLists.txt index 8e17c4f..d8a9a49 100644 --- a/rover/rover_main/CMakeLists.txt +++ b/rover/rover_main/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.8.3) -project(rover) +project(rover_main) ## Compile as C++11, supported in ROS Kinetic and newer # add_compile_options(-std=c++11) diff --git a/rover/rover_main/launch/rover_main.launch b/rover/rover_main/launch/rover_main.launch index d6b38e1..ae87561 100644 --- a/rover/rover_main/launch/rover_main.launch +++ b/rover/rover_main/launch/rover_main.launch @@ -1,19 +1,52 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + - - - - - + + + diff --git a/rover/rover_main/launch/rover_nav.launch b/rover/rover_main/launch/rover_nav.launch new file mode 100644 index 0000000..353ae57 --- /dev/null +++ b/rover/rover_main/launch/rover_nav.launch @@ -0,0 +1,6 @@ + + + + + + diff --git a/rover/rover_main/package.xml b/rover/rover_main/package.xml index b7ef09d..a0af963 100644 --- a/rover/rover_main/package.xml +++ b/rover/rover_main/package.xml @@ -1,6 +1,6 @@ - rover + rover_main 0.0.0 The rover package diff --git a/rover/uvc_capture/CMakeLists.txt b/rover/uvc_capture/CMakeLists.txt deleted file mode 100644 index 90e9731..0000000 --- a/rover/uvc_capture/CMakeLists.txt +++ /dev/null @@ -1,198 +0,0 @@ -cmake_minimum_required(VERSION 2.8.3) -project(uvc_capture) - -## Compile as C++11, supported in ROS Kinetic and newer -# add_compile_options(-std=c++11) - -## Find catkin macros and libraries -## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) -## is used, also find other catkin packages -find_package(catkin REQUIRED COMPONENTS - roscpp - rospy -) - -## System dependencies are found with CMake's conventions -# find_package(Boost REQUIRED COMPONENTS system) - - -## Uncomment this if the package has a setup.py. This macro ensures -## modules and global scripts declared therein get installed -## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html -# catkin_python_setup() - -################################################ -## Declare ROS messages, services and actions ## -################################################ - -## To declare and build messages, services or actions from within this -## package, follow these steps: -## * Let MSG_DEP_SET be the set of packages whose message types you use in -## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). -## * In the file package.xml: -## * add a build_depend tag for "message_generation" -## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET -## * If MSG_DEP_SET isn't empty the following dependency has been pulled in -## but can be declared for certainty nonetheless: -## * add a run_depend tag for "message_runtime" -## * In this file (CMakeLists.txt): -## * add "message_generation" and every package in MSG_DEP_SET to -## find_package(catkin REQUIRED COMPONENTS ...) -## * add "message_runtime" and every package in MSG_DEP_SET to -## catkin_package(CATKIN_DEPENDS ...) -## * uncomment the add_*_files sections below as needed -## and list every .msg/.srv/.action file to be processed -## * uncomment the generate_messages entry below -## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) - -## Generate messages in the 'msg' folder -# add_message_files( -# FILES -# Message1.msg -# Message2.msg -# ) - -## Generate services in the 'srv' folder -# add_service_files( -# FILES -# Service1.srv -# Service2.srv -# ) - -## Generate actions in the 'action' folder -# add_action_files( -# FILES -# Action1.action -# Action2.action -# ) - -## Generate added messages and services with any dependencies listed here -# generate_messages( -# DEPENDENCIES -# std_msgs # Or other packages containing msgs -# ) - -################################################ -## Declare ROS dynamic reconfigure parameters ## -################################################ - -## To declare and build dynamic reconfigure parameters within this -## package, follow these steps: -## * In the file package.xml: -## * add a build_depend and a run_depend tag for "dynamic_reconfigure" -## * In this file (CMakeLists.txt): -## * add "dynamic_reconfigure" to -## find_package(catkin REQUIRED COMPONENTS ...) -## * uncomment the "generate_dynamic_reconfigure_options" section below -## and list every .cfg file to be processed - -## Generate dynamic reconfigure parameters in the 'cfg' folder -# generate_dynamic_reconfigure_options( -# cfg/DynReconf1.cfg -# cfg/DynReconf2.cfg -# ) - -################################### -## catkin specific configuration ## -################################### -## The catkin_package macro generates cmake config files for your package -## Declare things to be passed to dependent projects -## INCLUDE_DIRS: uncomment this if your package contains header files -## LIBRARIES: libraries you create in this project that dependent projects also need -## CATKIN_DEPENDS: catkin_packages dependent projects also need -## DEPENDS: system dependencies of this project that dependent projects also need -catkin_package( -# INCLUDE_DIRS include -# LIBRARIES uvc_capture -# CATKIN_DEPENDS roscpp rospy -# DEPENDS system_lib -) - -########### -## Build ## -########### - -## Specify additional locations of header files -## Your package locations should be listed before other locations -include_directories( -# include - ${catkin_INCLUDE_DIRS} -) - -## Declare a C++ library -# add_library(${PROJECT_NAME} -# src/${PROJECT_NAME}/uvc_capture.cpp -# ) - -## Add cmake target dependencies of the library -## as an example, code may need to be generated before libraries -## either from message generation or dynamic reconfigure -# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) - -## Declare a C++ executable -## With catkin_make all packages are built within a single CMake context -## The recommended prefix ensures that target names across packages don't collide -# add_executable(${PROJECT_NAME}_node src/uvc_capture_node.cpp) - -## Rename C++ executable without prefix -## The above recommended prefix causes long target names, the following renames the -## target back to the shorter version for ease of user use -## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" -# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") - -## Add cmake target dependencies of the executable -## same as for the library above -# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) - -## Specify libraries to link a library or executable target against -# target_link_libraries(${PROJECT_NAME}_node -# ${catkin_LIBRARIES} -# ) - -############# -## Install ## -############# - -# all install targets should use catkin DESTINATION variables -# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html - -## Mark executable scripts (Python etc.) for installation -## in contrast to setup.py, you can choose the destination -# install(PROGRAMS -# scripts/my_python_script -# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -# ) - -## Mark executables and/or libraries for installation -# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node -# 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} -# FILES_MATCHING PATTERN "*.h" -# PATTERN ".svn" EXCLUDE -# ) - -## Mark other files for installation (e.g. launch and bag files, etc.) -# install(FILES -# # myfile1 -# # myfile2 -# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} -# ) - -############# -## Testing ## -############# - -## Add gtest based cpp test target and link libraries -# catkin_add_gtest(${PROJECT_NAME}-test test/test_uvc_capture.cpp) -# if(TARGET ${PROJECT_NAME}-test) -# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) -# endif() - -## Add folders to be run by python nosetests -# catkin_add_nosetests(test) diff --git a/rover/uvc_capture/launch/uvc.launch b/rover/uvc_capture/launch/uvc.launch deleted file mode 100644 index 75aae59..0000000 --- a/rover/uvc_capture/launch/uvc.launch +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rover/uvc_capture/launch/uvc_one_cam.launch b/rover/uvc_capture/launch/uvc_one_cam.launch deleted file mode 100644 index d7a6812..0000000 --- a/rover/uvc_capture/launch/uvc_one_cam.launch +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/rover/uvc_capture/package.xml b/rover/uvc_capture/package.xml deleted file mode 100644 index aadb86a..0000000 --- a/rover/uvc_capture/package.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - uvc_capture - 0.0.0 - The uvc_capture package - - - - - caperren - - - - - - TODO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - catkin - roscpp - rospy - roscpp - rospy - roscpp - rospy - - - - - - - - diff --git a/rover/zed_wrapper/launch/zed.launch b/rover/zed_wrapper/launch/zed.launch index 00341d6..5f5509e 100755 --- a/rover/zed_wrapper/launch/zed.launch +++ b/rover/zed_wrapper/launch/zed.launch @@ -23,7 +23,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - +