diff --git a/Dockerfile b/Dockerfile index d8498cb..b7e4002 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ ros-noetic-robot-pose-ekf \ ros-noetic-tf2-sensor-msgs \ ros-noetic-move-base-msgs \ + ros-noetic-velodyne-gazebo-plugins \ libsdl1.2-dev \ libsdl-image1.2-dev \ libpcap-dev @@ -77,12 +78,18 @@ COPY src /home/ubuntu/catkin_ws/src -RUN pip3 install --upgrade --no-cache-dir pip && \ - pip3 install --no-cache-dir \ - pymodbus && \ +ENV PYTHONPATH="$PYTHONPATH:$HOME/.local/lib/python3.8/site-packages" + +RUN python3 -m pip install --user --upgrade --no-cache-dir --no-warn-script-location pip && \ + python3 -m pip install --user --upgrade --no-cache-dir --no-warn-script-location \ + pymodbus \ + numpy-quaternion \ + ruamel.yaml \ + Pillow && \ cd /home/ubuntu/catkin_ws/src/ZLAC8015D_python && \ python3 setup.py install && \ - usermod -a -G dialout $USER + usermod -a -G dialout $USER && \ + chown -R $USER:$USER $HOME COPY ./startup.sh /startup.sh diff --git a/build.sh b/build.sh index d833065..bb2479f 100755 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -docker build -t bvbnatsu/tsukuba2022:v0.1 . +docker build -t bvbnatsu/tsukuba2022:latest . diff --git a/runLite.sh b/runLite.sh index 09e8591..4f953cc 100755 --- a/runLite.sh +++ b/runLite.sh @@ -8,14 +8,26 @@ docker run \ --rm \ +<<<<<<< HEAD --shm-size=512m \ +======= +>>>>>>> 7d3c39e7349c487e2d20e3ecba62f455c0a877ba -p 6080:80 \ -p 2222:22 \ -p 10940:10940 \ -p 2368:2368/udp \ -p 8308:8308/udp \ +<<<<<<< HEAD -e RESOLUTION=1920x1080 \ -e HOME=/home/ubuntu \ -e SHELL=/bin/bash \ --entrypoint '/startup.sh' \ bvbnatsu/tsukuba2022:$TAG +======= + -e HOME=/home/ubuntu \ + -e SHELL=/bin/bash \ + -v /home/kbkn/tsukuba2022/waypoint_navigation:/home/ubuntu/catkin_ws/src/waypoint_navigation \ + --shm-size=512m \ + --entrypoint '/startup.sh'\ + bvbnatsu/tsukuba2022:$TAG +>>>>>>> 7d3c39e7349c487e2d20e3ecba62f455c0a877ba diff --git a/src/waypoint_navigation/README.md b/src/waypoint_navigation/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/README.md diff --git a/src/waypoint_navigation/waypoint_manager/CMakeLists.txt b/src/waypoint_navigation/waypoint_manager/CMakeLists.txt new file mode 100644 index 0000000..2941813 --- /dev/null +++ b/src/waypoint_navigation/waypoint_manager/CMakeLists.txt @@ -0,0 +1,202 @@ +cmake_minimum_required(VERSION 3.0.2) +project(waypoint_manager) + +## 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) + +## 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 exec_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 exec_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 exec_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 waypoint_manager +# CATKIN_DEPENDS other_catkin_pkg +# 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}/waypoint_manager.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/waypoint_manager_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 +# catkin_install_python(PROGRAMS +# scripts/my_python_script +# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark executables for installation +## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html +# install(TARGETS ${PROJECT_NAME}_node +# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark libraries for installation +## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html +# install(TARGETS ${PROJECT_NAME} +# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# RUNTIME DESTINATION ${CATKIN_GLOBAL_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_waypoint_manager.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/src/waypoint_navigation/waypoint_manager/launch/start_manager.launch b/src/waypoint_navigation/waypoint_manager/launch/start_manager.launch new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_manager/launch/start_manager.launch diff --git a/src/waypoint_navigation/waypoint_manager/package.xml b/src/waypoint_navigation/waypoint_manager/package.xml new file mode 100644 index 0000000..e77ca19 --- /dev/null +++ b/src/waypoint_navigation/waypoint_manager/package.xml @@ -0,0 +1,59 @@ + + + waypoint_manager + 0.0.0 + The waypoint_manager package + + + + + ubuntu + + + + + + TODO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + catkin + + + + + + + + diff --git a/src/waypoint_navigation/waypoint_manager/scripts/manager_GUI.py b/src/waypoint_navigation/waypoint_manager/scripts/manager_GUI.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_manager/scripts/manager_GUI.py diff --git a/src/waypoint_navigation/waypoint_nav/CMakeLists.txt b/src/waypoint_navigation/waypoint_nav/CMakeLists.txt new file mode 100644 index 0000000..af262e2 --- /dev/null +++ b/src/waypoint_navigation/waypoint_nav/CMakeLists.txt @@ -0,0 +1,202 @@ +cmake_minimum_required(VERSION 3.0.2) +project(waypoint_nav) + +## 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) + +## 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 exec_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 exec_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 exec_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 waypoint_nav +# CATKIN_DEPENDS other_catkin_pkg +# 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}/waypoint_nav.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/waypoint_nav_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 +# catkin_install_python(PROGRAMS +# scripts/my_python_script +# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark executables for installation +## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html +# install(TARGETS ${PROJECT_NAME}_node +# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark libraries for installation +## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html +# install(TARGETS ${PROJECT_NAME} +# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# RUNTIME DESTINATION ${CATKIN_GLOBAL_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_waypoint_nav.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/src/waypoint_navigation/waypoint_nav/include/waypoint_nav.h b/src/waypoint_navigation/waypoint_nav/include/waypoint_nav.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_nav/include/waypoint_nav.h diff --git a/src/waypoint_navigation/waypoint_nav/launch/waypoint_nav.launch b/src/waypoint_navigation/waypoint_nav/launch/waypoint_nav.launch new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_nav/launch/waypoint_nav.launch diff --git a/src/waypoint_navigation/waypoint_nav/map/mymap.pgm b/src/waypoint_navigation/waypoint_nav/map/mymap.pgm new file mode 100644 index 0000000..26ecee0 --- /dev/null +++ b/src/waypoint_navigation/waypoint_nav/map/mymap.pgm Binary files differ diff --git a/src/waypoint_navigation/waypoint_nav/package.xml b/src/waypoint_navigation/waypoint_nav/package.xml new file mode 100644 index 0000000..45f9037 --- /dev/null +++ b/src/waypoint_navigation/waypoint_nav/package.xml @@ -0,0 +1,59 @@ + + + waypoint_nav + 0.0.0 + The waypoint_nav package + + + + + ubuntu + + + + + + TODO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + catkin + + + + + + + + diff --git a/src/waypoint_navigation/waypoint_nav/param/waypoints.yaml b/src/waypoint_navigation/waypoint_nav/param/waypoints.yaml new file mode 100644 index 0000000..96e2676 --- /dev/null +++ b/src/waypoint_navigation/waypoint_nav/param/waypoints.yaml @@ -0,0 +1,13 @@ +waypoints: +- point: {x: -8.729468527653239, y: 0.27403092325199907, z: 0.0} +- point: {x: -2.4868552877312595, y: -4.692719756685904, z: 0.0} +- point: {x: 2.8899940722015174, y: -5.102818436680778, z: 0.0} +- point: {x: 14.363099999999989, y: 0.3898580000000038, z: 0.0} +- point: {x: 16.024200000000008, y: 2.0383000000000067, z: 0.0} +- point: {x: 16.2397, y: 8.29131000000001, z: 0.0} +- point: {x: 16.376199999999997, y: 12.534899999999993, z: 0.0} +finish_pose: + header: {seq: 0.0, stamp: 1.6203674303803937E9, frame_id: hokuyo_link} + pose: + position: {x: 1.41991, y: 0.45038, z: 0.0} + orientation: {x: 0.0, y: 0.0, z: -0.705545, w: 0.708666} diff --git a/src/waypoint_navigation/waypoint_nav/src/waypoint_nav.cpp b/src/waypoint_navigation/waypoint_nav/src/waypoint_nav.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_nav/src/waypoint_nav.cpp diff --git a/src/waypoint_navigation/waypoint_saver/CMakeLists.txt b/src/waypoint_navigation/waypoint_saver/CMakeLists.txt new file mode 100644 index 0000000..497b438 --- /dev/null +++ b/src/waypoint_navigation/waypoint_saver/CMakeLists.txt @@ -0,0 +1,202 @@ +cmake_minimum_required(VERSION 3.0.2) +project(waypoint_saver) + +## 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) + +## 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 exec_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 exec_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 exec_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 waypoint_saver +# CATKIN_DEPENDS other_catkin_pkg +# 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}/waypoint_saver.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/waypoint_saver_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 +# catkin_install_python(PROGRAMS +# scripts/my_python_script +# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark executables for installation +## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html +# install(TARGETS ${PROJECT_NAME}_node +# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +# ) + +## Mark libraries for installation +## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html +# install(TARGETS ${PROJECT_NAME} +# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} +# RUNTIME DESTINATION ${CATKIN_GLOBAL_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_waypoint_saver.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/src/waypoint_navigation/waypoint_saver/include/waypoint_saver.h b/src/waypoint_navigation/waypoint_saver/include/waypoint_saver.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_saver/include/waypoint_saver.h diff --git a/src/waypoint_navigation/waypoint_saver/launch/waypoint_saver.launch b/src/waypoint_navigation/waypoint_saver/launch/waypoint_saver.launch new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_saver/launch/waypoint_saver.launch diff --git a/src/waypoint_navigation/waypoint_saver/package.xml b/src/waypoint_navigation/waypoint_saver/package.xml new file mode 100644 index 0000000..e64c74b --- /dev/null +++ b/src/waypoint_navigation/waypoint_saver/package.xml @@ -0,0 +1,59 @@ + + + waypoint_saver + 0.0.0 + The waypoint_saver package + + + + + ubuntu + + + + + + TODO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + catkin + + + + + + + + diff --git a/src/waypoint_navigation/waypoint_saver/src/waypoint_saver.cpp b/src/waypoint_navigation/waypoint_saver/src/waypoint_saver.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/waypoint_navigation/waypoint_saver/src/waypoint_saver.cpp diff --git a/src/zlac8015d_ros/README.md b/src/zlac8015d_ros/README.md index 73275cb..bf8aa92 100644 --- a/src/zlac8015d_ros/README.md +++ b/src/zlac8015d_ros/README.md @@ -1,57 +1,55 @@ -# ROS package for ZLAC8015D dual-channel servo driver -The latest repository is below. -[https://github.com/Alpaca-zip/zlac8015d_ros.git](https://github.com/Alpaca-zip/zlac8015d_ros.git) -[![](https://img.shields.io/badge/ROS-Noetic-brightgreen.svg)](https://www.ikko-lab.k.hosei.ac.jp/gitbucket/git/tsukuba2022/zlac8015d_ros) - - -## 1 Installation -Not recommended for `git clone https://www.ikko-lab.k.hosei.ac.jp/gitbucket/git/tsukuba2022/zlac8015d_ros.git`. -``` -$ cd catkin_ws/src - -$ git clone https://github.com/Alpaca-zip/zlac8015d_ros.git - -$ cd .. && catkin_make -``` - -## 2 Change full pathname of parameter file -`scripts/motor_driver_node.py` refers to `/home/ubuntu/catkin_ws/src/zlac8015d_ros/params/motor_driver_params.yaml` as default. -If you want to specify a different full pathname, change line 34 in `scripts/motor_driver_node.py` - -## 3 Usage -### Run motor_driver_node -``` -$ rosrun zlac8015d_ros motor_driver_node.py -``` -### Parameters -- `port`: Name of the zlac8015d port. Default is `dev/ttyUSB0`. -- `travel_in_one_rev`: Tire circumference. Default is `0.655`[m]. -- `R_Wheel`: Tire radius. Default is `0.105`[m]. -- `cpr`: CPR(Counts Per Revolution). Default is `16385`. -- `wheels_base_width`: Distance between tires. Default is `0.440`[m]. -- `control_mode`: `1` is relative position control mode, `3` is speed rpm control mode. Default is `3`. -- `callback_timeout`: Motor automatically stops if no topics are received for a certain period of time. Default is `0.5`[s]. -- `decimil_coefficient`: Must be specified in digits. Smaller values will cause small changes in tire motion to have a greater impact on the odometry calculations. `0.01` or `0.001` is highly recommended. Default is `0.001`. -- `set_accel_time_left`: Acceleration time for left tire. Default is `200`[ms]. -- `set_accel_time_right`: Acceleration time for right tire. Default is `200`[ms]. -- `set_decel_time_left`: Deceleration time for left tire. Default is `200`[ms]. -- `set_decel_time_right`: Deceleration time for right tire. Default is `200`[ms]. -- `max_left_rpm`: Maximum rpm of left tire. Default is `150`. -- `max_right_rpm`: Maximum rpm of right tire. Default is `150`. -- `deadband_rpm`: Width of rpm to be regarded as 0. If `3`, then -3 to 3 is considered rpm 0. Default is `3`. -- `TF_header_flame`: Header flame of TF. Default is `odom`. -- `TF_child_flame`: Child flame of TF. Default is `base_link`. -- `odom_header_flame`: Header flame of odom. Default is `odom`. -- `odom_child_flame`: Child flame of odom. Default is `base_link`. - -### Topics -This node publishes the following topics. -- `/wheels_rpm`: The speed in RPM of each tire as [left, right]. -- `/odom`: Odometry data for the robot. [More detail](http://docs.ros.org/en/diamondback/api/nav_msgs/html/msg/Odometry.html) - -This node subscribes to the following topics. -- `/zlac8015d/twist/cmd_vel`: Send command as linear velocity and angular velocity in speed rpm control. [More detail](https://docs.ros.org/en/diamondback/api/geometry_msgs/html/msg/Twist.html) -- `/zlac8015d/vel/cmd_vel`: Send command as velocity in speed rpm control, e.g. [0.6, 0.5] 0.6[m/s] of left tire, 0.5[m/s] of right tire. -- `/zlac8015d/vel/cmd_rpm`: Send command as rpm in speed rpm control, e.g. [100, 50] 100 rpm of left wtire, 50 rpm of right tire. -- `/zlac8015d/pos/deg_cmd`: Send command as angle degree in position control, e.g. [90,70] 90 [deg] of left tire, 70 [deg] of right tire. -- `/zlac8015d/pos/dist_cmd`: Send command as desired travelling distance in position control, e.g. [1.0, 1.0] for 1[m] travelling distance of each tire. +# ROS package for ZLAC8015D dual-channel servo driver +[![](https://img.shields.io/badge/ROS-Noetic-brightgreen.svg)](https://github.com/Alpaca-zip/zlac8015d_ros) + + + +## 1 Installation +``` +$ cd catkin_ws/src + +$ git clone https://github.com/Alpaca-zip/zlac8015d_ros.git + +$ cd .. && catkin_make +``` + +## 2 Change full pathname of parameter file +`scripts/motor_driver_node.py` refers to `/home/ubuntu/catkin_ws/src/zlac8015d_ros/params/motor_driver_params.yaml` as default. +If you want to specify a different full pathname, change line 34 in `scripts/motor_driver_node.py` + +## 3 Usage +### Run motor_driver_node +``` +$ rosrun zlac8015d_ros motor_driver_node.py +``` +### Parameters +- `port`: Name of the zlac8015d port. Default is `dev/ttyUSB0`. +- `travel_in_one_rev`: Tire circumference. Default is `0.655`[m]. +- `R_Wheel`: Tire radius. Default is `0.105`[m]. +- `cpr`: CPR(Counts Per Revolution). Default is `16385`. +- `wheels_base_width`: Distance between tires. Default is `0.440`[m]. +- `control_mode`: `1` is relative position control mode, `3` is speed rpm control mode. Default is `3`. +- `callback_timeout`: Motor automatically stops if no topics are received for a certain period of time. Default is `0.5`[s]. +- `decimil_coefficient`: Must be specified in digits. Smaller values will cause small changes in tire motion to have a greater impact on the odometry calculations. `0.01` or `0.001` is highly recommended. Default is `0.001`. +- `set_accel_time_left`: Acceleration time for left tire. Default is `200`[ms]. +- `set_accel_time_right`: Acceleration time for right tire. Default is `200`[ms]. +- `set_decel_time_left`: Deceleration time for left tire. Default is `200`[ms]. +- `set_decel_time_right`: Deceleration time for right tire. Default is `200`[ms]. +- `max_left_rpm`: Maximum rpm of left tire. Default is `150`. +- `max_right_rpm`: Maximum rpm of right tire. Default is `150`. +- `deadband_rpm`: Width of rpm to be regarded as 0. If `3`, then -3 to 3 is considered rpm 0. Default is `3`. +- `TF_header_flame`: Header flame of TF. Default is `odom`. +- `TF_child_flame`: Child flame of TF. Default is `base_link`. +- `odom_header_flame`: Header flame of odom. Default is `odom`. +- `odom_child_flame`: Child flame of odom. Default is `base_link`. + +### Topics +This node publishes the following topics. +- `/wheels_rpm`: The speed in RPM of each tire as [left, right]. +- `/odom`: Odometry data for the robot. [More detail](http://docs.ros.org/en/diamondback/api/nav_msgs/html/msg/Odometry.html) + +This node subscribes to the following topics. +- `/zlac8015d/twist/cmd_vel`: Send command as linear velocity and angular velocity in speed rpm control. [More detail](https://docs.ros.org/en/diamondback/api/geometry_msgs/html/msg/Twist.html) +- `/zlac8015d/vel/cmd_vel`: Send command as velocity in speed rpm control, e.g. [0.6, 0.5] 0.6[m/s] of left tire, 0.5[m/s] of right tire. +- `/zlac8015d/vel/cmd_rpm`: Send command as rpm in speed rpm control, e.g. [100, 50] 100 rpm of left wtire, 50 rpm of right tire. +- `/zlac8015d/pos/deg_cmd`: Send command as angle degree in position control, e.g. [90,70] 90 [deg] of left tire, 70 [deg] of right tire. +- `/zlac8015d/pos/dist_cmd`: Send command as desired travelling distance in position control, e.g. [1.0, 1.0] for 1[m] travelling distance of each tire.