Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • trappejo/semesterprojekt-modulbasiertes-testen
1 result
Show changes
Commits on Source (37)
Showing
with 19631 additions and 2 deletions
cmake_minimum_required(VERSION 2.8.3)
project(sim)
## 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
std_msgs
)
## 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
# )
################################################
## 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 sim
# CATKIN_DEPENDS roscpp rospy std_msgs
# 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}/sim.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/sim_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 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_sim.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)
Waffle waffle
\ No newline at end of file
Platzhalter
EventLog - INFO - [T:0.589] Distance of the obstacle : inf
EventLog - INFO - [T:0.783] Distance of the obstacle : inf
EventLog - INFO - [T:0.987] Distance of the obstacle : inf
EventLog - INFO - [T:1.183] Distance of the obstacle : inf
EventLog - INFO - [T:1.388] Distance of the obstacle : inf
EventLog - INFO - [T:1.582] Distance of the obstacle : inf
EventLog - INFO - [T:1.787] Distance of the obstacle : inf
EventLog - INFO - [T:1.982] Distance of the obstacle : inf
EventLog - INFO - [T:2.186] Distance of the obstacle : inf
EventLog - INFO - [T:2.381] Distance of the obstacle : inf
EventLog - INFO - [T:2.586] Distance of the obstacle : inf
EventLog - INFO - [T:2.781] Distance of the obstacle : inf
EventLog - INFO - [T:2.985] Distance of the obstacle : inf
EventLog - INFO - [T:3.181] Distance of the obstacle : inf
EventLog - INFO - [T:3.385] Distance of the obstacle : inf
EventLog - INFO - [T:3.58] Distance of the obstacle : inf
EventLog - INFO - [T:3.786] Distance of the obstacle : inf
EventLog - INFO - [T:3.981] Distance of the obstacle : inf
EventLog - INFO - [T:4.185] Distance of the obstacle : inf
EventLog - INFO - [T:4.379] Distance of the obstacle : inf
EventLog - INFO - [T:4.585] Distance of the obstacle : inf
EventLog - INFO - [T:4.779] Distance of the obstacle : inf
EventLog - INFO - [T:4.984] Distance of the obstacle : inf
EventLog - INFO - [T:5.179] Distance of the obstacle : inf
EventLog - INFO - [T:5.384] Distance of the obstacle : inf
EventLog - INFO - [T:5.579] Distance of the obstacle : inf
EventLog - INFO - [T:5.784] Distance of the obstacle : inf
EventLog - INFO - [T:5.978] Distance of the obstacle : inf
EventLog - INFO - [T:6.183] Distance of the obstacle : inf
EventLog - INFO - [T:6.387] Distance of the obstacle : inf
EventLog - INFO - [T:6.582] Distance of the obstacle : inf
EventLog - INFO - [T:6.787] Distance of the obstacle : inf
EventLog - INFO - [T:6.982] Distance of the obstacle : inf
EventLog - INFO - [T:7.187] Distance of the obstacle : inf
EventLog - INFO - [T:7.382] Distance of the obstacle : inf
EventLog - INFO - [T:7.587] Distance of the obstacle : inf
EventLog - INFO - [T:7.782] Distance of the obstacle : inf
EventLog - INFO - [T:7.987] Distance of the obstacle : inf
EventLog - INFO - [T:8.181] Distance of the obstacle : inf
EventLog - INFO - [T:8.386] Distance of the obstacle : inf
EventLog - INFO - [T:8.58] Distance of the obstacle : inf
EventLog - INFO - [T:8.786] Distance of the obstacle : inf
EventLog - INFO - [T:8.98] Distance of the obstacle : inf
EventLog - INFO - [T:9.186] Distance of the obstacle : inf
EventLog - INFO - [T:9.38] Distance of the obstacle : inf
EventLog - INFO - [T:9.585] Distance of the obstacle : inf
EventLog - INFO - [T:9.78] Distance of the obstacle : inf
EventLog - INFO - [T:9.984] Distance of the obstacle : inf
EventLog - INFO - [T:10.179] Distance of the obstacle : inf
EventLog - INFO - [T:10.384] Distance of the obstacle : inf
EventLog - INFO - [T:10.579] Distance of the obstacle : inf
EventLog - INFO - [T:10.784] Distance of the obstacle : inf
EventLog - INFO - [T:10.979] Distance of the obstacle : inf
EventLog - INFO - [T:11.184] Distance of the obstacle : inf
EventLog - INFO - [T:11.379] Distance of the obstacle : inf
EventLog - INFO - [T:11.584] Distance of the obstacle : inf
EventLog - INFO - [T:11.778] Distance of the obstacle : inf
EventLog - INFO - [T:11.983] Distance of the obstacle : inf
EventLog - INFO - [T:12.188] Distance of the obstacle : inf
EventLog - INFO - [T:12.382] Distance of the obstacle : inf
EventLog - INFO - [T:12.587] Distance of the obstacle : inf
EventLog - INFO - [T:12.782] Distance of the obstacle : inf
EventLog - INFO - [T:12.987] Distance of the obstacle : inf
EventLog - INFO - [T:13.182] Distance of the obstacle : inf
EventLog - INFO - [T:13.387] Distance of the obstacle : inf
EventLog - INFO - [T:13.582] Distance of the obstacle : inf
EventLog - INFO - [T:13.786] Distance of the obstacle : inf
EventLog - INFO - [T:13.981] Distance of the obstacle : inf
EventLog - INFO - [T:14.186] Distance of the obstacle : inf
EventLog - INFO - [T:14.38] Distance of the obstacle : inf
EventLog - INFO - [T:14.585] Distance of the obstacle : inf
EventLog - INFO - [T:14.779] Distance of the obstacle : inf
EventLog - INFO - [T:14.983] Distance of the obstacle : inf
EventLog - INFO - [T:15.178] Distance of the obstacle : inf
EventLog - INFO - [T:15.382] Distance of the obstacle : inf
EventLog - INFO - [T:15.587] Distance of the obstacle : inf
EventLog - INFO - [T:15.782] Distance of the obstacle : inf
EventLog - INFO - [T:15.987] Distance of the obstacle : inf
EventLog - INFO - [T:16.181] Distance of the obstacle : inf
EventLog - INFO - [T:16.386] Distance of the obstacle : inf
EventLog - INFO - [T:16.581] Distance of the obstacle : inf
EventLog - INFO - [T:16.785] Distance of the obstacle : inf
EventLog - INFO - [T:16.98] Distance of the obstacle : inf
EventLog - INFO - [T:17.184] Distance of the obstacle : inf
EventLog - INFO - [T:17.379] Distance of the obstacle : inf
EventLog - INFO - [T:17.583] Distance of the obstacle : inf
EventLog - INFO - [T:17.788] Distance of the obstacle : inf
EventLog - INFO - [T:17.983] Distance of the obstacle : inf
EventLog - INFO - [T:18.187] Distance of the obstacle : inf
EventLog - INFO - [T:18.382] Distance of the obstacle : inf
EventLog - INFO - [T:18.588] Distance of the obstacle : inf
EventLog - INFO - [T:18.783] Distance of the obstacle : inf
EventLog - INFO - [T:18.988] Distance of the obstacle : inf
EventLog - INFO - [T:19.191] Distance of the obstacle : inf
EventLog - INFO - [T:19.385] Distance of the obstacle : inf
EventLog - INFO - [T:19.579] Distance of the obstacle : inf
EventLog - INFO - [T:19.784] Distance of the obstacle : inf
EventLog - INFO - [T:19.979] Distance of the obstacle : inf
EventLog - INFO - [T:20.184] Distance of the obstacle : inf
EventLog - INFO - [T:20.378] Distance of the obstacle : inf
EventLog - INFO - [T:20.583] Distance of the obstacle : inf
EventLog - INFO - [T:20.788] Distance of the obstacle : inf
EventLog - INFO - [T:20.982] Distance of the obstacle : inf
EventLog - INFO - [T:21.187] Distance of the obstacle : inf
EventLog - INFO - [T:21.382] Distance of the obstacle : inf
EventLog - INFO - [T:21.587] Distance of the obstacle : inf
EventLog - INFO - [T:21.782] Distance of the obstacle : inf
EventLog - INFO - [T:21.986] Distance of the obstacle : inf
EventLog - INFO - [T:22.181] Distance of the obstacle : inf
EventLog - INFO - [T:22.386] Distance of the obstacle : inf
EventLog - INFO - [T:22.581] Distance of the obstacle : inf
EventLog - INFO - [T:22.786] Distance of the obstacle : inf
EventLog - INFO - [T:22.98] Distance of the obstacle : inf
EventLog - INFO - [T:23.184] Distance of the obstacle : inf
EventLog - INFO - [T:23.38] Distance of the obstacle : inf
EventLog - INFO - [T:23.585] Distance of the obstacle : inf
EventLog - INFO - [T:23.779] Distance of the obstacle : inf
EventLog - INFO - [T:23.984] Distance of the obstacle : inf
EventLog - INFO - [T:24.179] Distance of the obstacle : inf
EventLog - INFO - [T:24.384] Distance of the obstacle : inf
EventLog - INFO - [T:24.578] Distance of the obstacle : inf
EventLog - INFO - [T:24.783] Distance of the obstacle : inf
EventLog - INFO - [T:24.988] Distance of the obstacle : inf
EventLog - INFO - [T:25.183] Distance of the obstacle : inf
EventLog - INFO - [T:25.388] Distance of the obstacle : inf
EventLog - INFO - [T:25.583] Distance of the obstacle : inf
EventLog - INFO - [T:25.788] Distance of the obstacle : inf
EventLog - INFO - [T:25.983] Distance of the obstacle : inf
EventLog - INFO - [T:26.188] Distance of the obstacle : inf
EventLog - INFO - [T:26.383] Distance of the obstacle : inf
EventLog - INFO - [T:26.588] Distance of the obstacle : inf
EventLog - INFO - [T:26.782] Distance of the obstacle : inf
EventLog - INFO - [T:26.986] Distance of the obstacle : inf
EventLog - INFO - [T:27.181] Distance of the obstacle : inf
EventLog - INFO - [T:27.386] Distance of the obstacle : inf
EventLog - INFO - [T:27.581] Distance of the obstacle : inf
EventLog - INFO - [T:27.785] Distance of the obstacle : inf
EventLog - INFO - [T:27.979] Distance of the obstacle : inf
EventLog - INFO - [T:28.184] Distance of the obstacle : inf
EventLog - INFO - [T:28.379] Distance of the obstacle : inf
EventLog - INFO - [T:28.584] Distance of the obstacle : inf
EventLog - INFO - [T:28.779] Distance of the obstacle : inf
EventLog - INFO - [T:28.983] Distance of the obstacle : inf
EventLog - INFO - [T:29.187] Distance of the obstacle : inf
EventLog - INFO - [T:29.383] Distance of the obstacle : inf
EventLog - INFO - [T:29.587] Distance of the obstacle : inf
EventLog - INFO - [T:29.782] Distance of the obstacle : inf
EventLog - INFO - [T:29.987] Distance of the obstacle : inf
EventLog - INFO - [T:0.377] Distance of the obstacle : inf
EventLog - INFO - [T:0.581] Distance of the obstacle : inf
EventLog - INFO - [T:0.775] Distance of the obstacle : inf
EventLog - INFO - [T:0.98] Distance of the obstacle : inf
EventLog - INFO - [T:1.174] Distance of the obstacle : inf
EventLog - INFO - [T:1.379] Distance of the obstacle : inf
EventLog - INFO - [T:1.573] Distance of the obstacle : inf
EventLog - INFO - [T:1.779] Distance of the obstacle : inf
EventLog - INFO - [T:1.974] Distance of the obstacle : inf
EventLog - INFO - [T:2.18] Distance of the obstacle : inf
EventLog - INFO - [T:2.374] Distance of the obstacle : inf
EventLog - INFO - [T:2.578] Distance of the obstacle : inf
EventLog - INFO - [T:2.773] Distance of the obstacle : inf
EventLog - INFO - [T:2.978] Distance of the obstacle : inf
EventLog - INFO - [T:3.173] Distance of the obstacle : inf
EventLog - INFO - [T:3.378] Distance of the obstacle : inf
EventLog - INFO - [T:3.572] Distance of the obstacle : inf
EventLog - INFO - [T:3.776] Distance of the obstacle : inf
EventLog - INFO - [T:3.981] Distance of the obstacle : inf
EventLog - INFO - [T:4.176] Distance of the obstacle : inf
EventLog - INFO - [T:4.38] Distance of the obstacle : inf
EventLog - INFO - [T:4.576] Distance of the obstacle : inf
EventLog - INFO - [T:4.78] Distance of the obstacle : inf
EventLog - INFO - [T:4.975] Distance of the obstacle : inf
EventLog - INFO - [T:5.18] Distance of the obstacle : inf
EventLog - INFO - [T:5.375] Distance of the obstacle : inf
EventLog - INFO - [T:5.58] Distance of the obstacle : inf
EventLog - INFO - [T:5.775] Distance of the obstacle : inf
EventLog - INFO - [T:5.981] Distance of the obstacle : inf
EventLog - INFO - [T:6.175] Distance of the obstacle : inf
EventLog - INFO - [T:6.38] Distance of the obstacle : inf
EventLog - INFO - [T:6.574] Distance of the obstacle : inf
EventLog - INFO - [T:6.779] Distance of the obstacle : inf
EventLog - INFO - [T:6.975] Distance of the obstacle : inf
EventLog - INFO - [T:7.178] Distance of the obstacle : inf
EventLog - INFO - [T:7.373] Distance of the obstacle : inf
EventLog - INFO - [T:7.578] Distance of the obstacle : inf
EventLog - INFO - [T:7.773] Distance of the obstacle : inf
EventLog - INFO - [T:7.977] Distance of the obstacle : inf
EventLog - INFO - [T:8.182] Distance of the obstacle : inf
EventLog - INFO - [T:8.377] Distance of the obstacle : inf
EventLog - INFO - [T:8.581] Distance of the obstacle : inf
EventLog - INFO - [T:8.776] Distance of the obstacle : inf
EventLog - INFO - [T:8.981] Distance of the obstacle : inf
EventLog - INFO - [T:9.175] Distance of the obstacle : inf
EventLog - INFO - [T:9.38] Distance of the obstacle : inf
EventLog - INFO - [T:9.574] Distance of the obstacle : inf
EventLog - INFO - [T:9.78] Distance of the obstacle : inf
EventLog - INFO - [T:9.974] Distance of the obstacle : inf
EventLog - INFO - [T:10.179] Distance of the obstacle : inf
EventLog - INFO - [T:10.374] Distance of the obstacle : inf
EventLog - INFO - [T:10.579] Distance of the obstacle : inf
EventLog - INFO - [T:10.773] Distance of the obstacle : inf
EventLog - INFO - [T:10.978] Distance of the obstacle : inf
EventLog - INFO - [T:11.173] Distance of the obstacle : inf
EventLog - INFO - [T:11.378] Distance of the obstacle : inf
EventLog - INFO - [T:11.571] Distance of the obstacle : inf
EventLog - INFO - [T:11.777] Distance of the obstacle : inf
EventLog - INFO - [T:11.972] Distance of the obstacle : inf
EventLog - INFO - [T:12.176] Distance of the obstacle : inf
EventLog - INFO - [T:12.381] Distance of the obstacle : inf
EventLog - INFO - [T:12.576] Distance of the obstacle : inf
EventLog - INFO - [T:12.781] Distance of the obstacle : inf
EventLog - INFO - [T:12.977] Distance of the obstacle : inf
EventLog - INFO - [T:13.182] Distance of the obstacle : inf
EventLog - INFO - [T:13.377] Distance of the obstacle : inf
EventLog - INFO - [T:13.582] Distance of the obstacle : inf
EventLog - INFO - [T:13.777] Distance of the obstacle : inf
EventLog - INFO - [T:13.982] Distance of the obstacle : inf
EventLog - INFO - [T:14.177] Distance of the obstacle : inf
EventLog - INFO - [T:14.382] Distance of the obstacle : inf
EventLog - INFO - [T:14.576] Distance of the obstacle : inf
EventLog - INFO - [T:14.781] Distance of the obstacle : inf
EventLog - INFO - [T:14.975] Distance of the obstacle : inf
EventLog - INFO - [T:15.181] Distance of the obstacle : inf
EventLog - INFO - [T:15.375] Distance of the obstacle : inf
EventLog - INFO - [T:15.58] Distance of the obstacle : inf
EventLog - INFO - [T:15.775] Distance of the obstacle : inf
EventLog - INFO - [T:15.98] Distance of the obstacle : inf
EventLog - INFO - [T:16.174] Distance of the obstacle : inf
EventLog - INFO - [T:16.379] Distance of the obstacle : inf
EventLog - INFO - [T:16.574] Distance of the obstacle : inf
EventLog - INFO - [T:16.778] Distance of the obstacle : inf
EventLog - INFO - [T:16.973] Distance of the obstacle : inf
EventLog - INFO - [T:17.178] Distance of the obstacle : inf
EventLog - INFO - [T:17.373] Distance of the obstacle : inf
EventLog - INFO - [T:17.577] Distance of the obstacle : inf
EventLog - INFO - [T:17.772] Distance of the obstacle : inf
EventLog - INFO - [T:17.977] Distance of the obstacle : inf
EventLog - INFO - [T:18.181] Distance of the obstacle : inf
EventLog - INFO - [T:18.376] Distance of the obstacle : inf
EventLog - INFO - [T:18.58] Distance of the obstacle : inf
EventLog - INFO - [T:18.775] Distance of the obstacle : inf
EventLog - INFO - [T:18.98] Distance of the obstacle : inf
EventLog - INFO - [T:19.174] Distance of the obstacle : inf
EventLog - INFO - [T:19.379] Distance of the obstacle : inf
EventLog - INFO - [T:19.574] Distance of the obstacle : inf
EventLog - INFO - [T:19.778] Distance of the obstacle : inf
EventLog - INFO - [T:19.973] Distance of the obstacle : inf
EventLog - INFO - [T:20.178] Distance of the obstacle : inf
EventLog - INFO - [T:20.372] Distance of the obstacle : inf
EventLog - INFO - [T:20.577] Distance of the obstacle : inf
EventLog - INFO - [T:20.781] Distance of the obstacle : inf
EventLog - INFO - [T:20.975] Distance of the obstacle : inf
EventLog - INFO - [T:21.18] Distance of the obstacle : inf
EventLog - INFO - [T:21.375] Distance of the obstacle : inf
EventLog - INFO - [T:21.581] Distance of the obstacle : inf
EventLog - INFO - [T:21.775] Distance of the obstacle : inf
EventLog - INFO - [T:21.979] Distance of the obstacle : inf
EventLog - INFO - [T:22.174] Distance of the obstacle : inf
EventLog - INFO - [T:22.379] Distance of the obstacle : inf
EventLog - INFO - [T:22.572] Distance of the obstacle : inf
EventLog - INFO - [T:22.777] Distance of the obstacle : inf
EventLog - INFO - [T:22.982] Distance of the obstacle : inf
EventLog - INFO - [T:23.177] Distance of the obstacle : inf
EventLog - INFO - [T:23.381] Distance of the obstacle : inf
EventLog - INFO - [T:23.575] Distance of the obstacle : inf
EventLog - INFO - [T:23.779] Distance of the obstacle : inf
EventLog - INFO - [T:23.974] Distance of the obstacle : inf
EventLog - INFO - [T:24.179] Distance of the obstacle : inf
EventLog - INFO - [T:24.374] Distance of the obstacle : inf
EventLog - INFO - [T:24.579] Distance of the obstacle : inf
EventLog - INFO - [T:24.773] Distance of the obstacle : inf
EventLog - INFO - [T:24.978] Distance of the obstacle : inf
EventLog - INFO - [T:25.173] Distance of the obstacle : inf
EventLog - INFO - [T:25.378] Distance of the obstacle : inf
EventLog - INFO - [T:25.573] Distance of the obstacle : inf
EventLog - INFO - [T:25.778] Distance of the obstacle : inf
EventLog - INFO - [T:25.973] Distance of the obstacle : inf
EventLog - INFO - [T:26.177] Distance of the obstacle : inf
EventLog - INFO - [T:26.382] Distance of the obstacle : inf
EventLog - INFO - [T:26.577] Distance of the obstacle : inf
EventLog - INFO - [T:26.781] Distance of the obstacle : inf
EventLog - INFO - [T:26.976] Distance of the obstacle : inf
EventLog - INFO - [T:27.181] Distance of the obstacle : inf
EventLog - INFO - [T:27.376] Distance of the obstacle : inf
EventLog - INFO - [T:27.58] Distance of the obstacle : inf
EventLog - INFO - [T:27.775] Distance of the obstacle : inf
EventLog - INFO - [T:27.979] Distance of the obstacle : inf
EventLog - INFO - [T:28.174] Distance of the obstacle : inf
EventLog - INFO - [T:28.379] Distance of the obstacle : inf
EventLog - INFO - [T:28.573] Distance of the obstacle : inf
EventLog - INFO - [T:28.778] Distance of the obstacle : inf
EventLog - INFO - [T:28.973] Distance of the obstacle : inf
EventLog - INFO - [T:29.177] Distance of the obstacle : inf
EventLog - INFO - [T:29.382] Distance of the obstacle : inf
EventLog - INFO - [T:29.577] Distance of the obstacle : inf
EventLog - INFO - [T:29.782] Distance of the obstacle : inf
EventLog - INFO - [T:29.976] Distance of the obstacle : inf
EventLog - INFO - [T:0.573] Distance of the obstacle : inf
EventLog - INFO - [T:0.768] Distance of the obstacle : inf
EventLog - INFO - [T:0.973] Distance of the obstacle : inf
EventLog - INFO - [T:1.169] Distance of the obstacle : inf
EventLog - INFO - [T:1.374] Distance of the obstacle : inf
EventLog - INFO - [T:1.568] Distance of the obstacle : inf
EventLog - INFO - [T:1.772] Distance of the obstacle : inf
EventLog - INFO - [T:1.967] Distance of the obstacle : inf
EventLog - INFO - [T:2.172] Distance of the obstacle : inf
EventLog - INFO - [T:2.376] Distance of the obstacle : inf
EventLog - INFO - [T:2.571] Distance of the obstacle : inf
EventLog - INFO - [T:2.775] Distance of the obstacle : inf
EventLog - INFO - [T:2.971] Distance of the obstacle : inf
EventLog - INFO - [T:3.175] Distance of the obstacle : inf
EventLog - INFO - [T:3.369] Distance of the obstacle : inf
EventLog - INFO - [T:3.575] Distance of the obstacle : inf
EventLog - INFO - [T:3.769] Distance of the obstacle : inf
EventLog - INFO - [T:3.974] Distance of the obstacle : inf
EventLog - INFO - [T:4.168] Distance of the obstacle : inf
EventLog - INFO - [T:4.373] Distance of the obstacle : inf
EventLog - INFO - [T:4.567] Distance of the obstacle : inf
EventLog - INFO - [T:4.772] Distance of the obstacle : inf
EventLog - INFO - [T:4.977] Distance of the obstacle : inf
EventLog - INFO - [T:5.171] Distance of the obstacle : inf
EventLog - INFO - [T:5.375] Distance of the obstacle : inf
EventLog - INFO - [T:5.57] Distance of the obstacle : inf
EventLog - INFO - [T:5.775] Distance of the obstacle : inf
EventLog - INFO - [T:5.971] Distance of the obstacle : inf
EventLog - INFO - [T:6.176] Distance of the obstacle : inf
EventLog - INFO - [T:6.37] Distance of the obstacle : inf
EventLog - INFO - [T:6.575] Distance of the obstacle : inf
EventLog - INFO - [T:6.77] Distance of the obstacle : inf
EventLog - INFO - [T:6.975] Distance of the obstacle : inf
EventLog - INFO - [T:7.169] Distance of the obstacle : inf
EventLog - INFO - [T:7.374] Distance of the obstacle : inf
EventLog - INFO - [T:7.569] Distance of the obstacle : inf
EventLog - INFO - [T:7.774] Distance of the obstacle : inf
EventLog - INFO - [T:7.969] Distance of the obstacle : inf
EventLog - INFO - [T:8.173] Distance of the obstacle : inf
EventLog - INFO - [T:8.368] Distance of the obstacle : inf
EventLog - INFO - [T:8.573] Distance of the obstacle : inf
EventLog - INFO - [T:8.768] Distance of the obstacle : inf
EventLog - INFO - [T:8.973] Distance of the obstacle : inf
EventLog - INFO - [T:9.167] Distance of the obstacle : inf
EventLog - INFO - [T:9.372] Distance of the obstacle : inf
EventLog - INFO - [T:9.577] Distance of the obstacle : inf
EventLog - INFO - [T:9.772] Distance of the obstacle : inf
EventLog - INFO - [T:9.976] Distance of the obstacle : inf
EventLog - INFO - [T:10.171] Distance of the obstacle : inf
EventLog - INFO - [T:10.377] Distance of the obstacle : inf
EventLog - INFO - [T:10.571] Distance of the obstacle : inf
EventLog - INFO - [T:10.776] Distance of the obstacle : inf
EventLog - INFO - [T:10.972] Distance of the obstacle : inf
EventLog - INFO - [T:11.177] Distance of the obstacle : inf
EventLog - INFO - [T:11.371] Distance of the obstacle : inf
EventLog - INFO - [T:11.576] Distance of the obstacle : inf
EventLog - INFO - [T:11.77] Distance of the obstacle : inf
EventLog - INFO - [T:11.975] Distance of the obstacle : inf
EventLog - INFO - [T:12.169] Distance of the obstacle : inf
EventLog - INFO - [T:12.375] Distance of the obstacle : inf
EventLog - INFO - [T:12.572] Distance of the obstacle : inf
EventLog - INFO - [T:12.777] Distance of the obstacle : inf
EventLog - INFO - [T:12.979] Distance of the obstacle : inf
EventLog - INFO - [T:13.172] Distance of the obstacle : inf
EventLog - INFO - [T:13.368] Distance of the obstacle : inf
EventLog - INFO - [T:13.573] Distance of the obstacle : inf
EventLog - INFO - [T:13.777] Distance of the obstacle : inf
EventLog - INFO - [T:13.972] Distance of the obstacle : inf
EventLog - INFO - [T:14.176] Distance of the obstacle : inf
EventLog - INFO - [T:14.371] Distance of the obstacle : inf
EventLog - INFO - [T:14.577] Distance of the obstacle : inf
EventLog - INFO - [T:14.773] Distance of the obstacle : inf
EventLog - INFO - [T:14.976] Distance of the obstacle : inf
EventLog - INFO - [T:15.171] Distance of the obstacle : inf
EventLog - INFO - [T:15.376] Distance of the obstacle : inf
EventLog - INFO - [T:15.571] Distance of the obstacle : inf
EventLog - INFO - [T:15.776] Distance of the obstacle : inf
EventLog - INFO - [T:15.97] Distance of the obstacle : inf
EventLog - INFO - [T:16.175] Distance of the obstacle : inf
EventLog - INFO - [T:16.37] Distance of the obstacle : inf
EventLog - INFO - [T:16.574] Distance of the obstacle : inf
EventLog - INFO - [T:16.769] Distance of the obstacle : inf
EventLog - INFO - [T:16.973] Distance of the obstacle : inf
EventLog - INFO - [T:17.169] Distance of the obstacle : inf
EventLog - INFO - [T:17.373] Distance of the obstacle : inf
EventLog - INFO - [T:17.568] Distance of the obstacle : inf
EventLog - INFO - [T:17.772] Distance of the obstacle : inf
EventLog - INFO - [T:17.976] Distance of the obstacle : inf
EventLog - INFO - [T:18.17] Distance of the obstacle : inf
EventLog - INFO - [T:18.375] Distance of the obstacle : inf
EventLog - INFO - [T:18.569] Distance of the obstacle : inf
EventLog - INFO - [T:18.774] Distance of the obstacle : inf
EventLog - INFO - [T:18.968] Distance of the obstacle : inf
EventLog - INFO - [T:19.174] Distance of the obstacle : inf
EventLog - INFO - [T:19.367] Distance of the obstacle : inf
EventLog - INFO - [T:19.573] Distance of the obstacle : inf
EventLog - INFO - [T:19.767] Distance of the obstacle : inf
EventLog - INFO - [T:19.972] Distance of the obstacle : inf
EventLog - INFO - [T:20.176] Distance of the obstacle : inf
EventLog - INFO - [T:20.37] Distance of the obstacle : inf
EventLog - INFO - [T:20.575] Distance of the obstacle : inf
EventLog - INFO - [T:20.789] Distance of the obstacle : inf
EventLog - INFO - [T:20.976] Distance of the obstacle : inf
EventLog - INFO - [T:21.171] Distance of the obstacle : inf
EventLog - INFO - [T:21.376] Distance of the obstacle : inf
EventLog - INFO - [T:21.571] Distance of the obstacle : inf
EventLog - INFO - [T:21.776] Distance of the obstacle : inf
EventLog - INFO - [T:21.97] Distance of the obstacle : inf
EventLog - INFO - [T:22.175] Distance of the obstacle : inf
EventLog - INFO - [T:22.369] Distance of the obstacle : inf
EventLog - INFO - [T:22.574] Distance of the obstacle : inf
EventLog - INFO - [T:22.769] Distance of the obstacle : inf
EventLog - INFO - [T:22.975] Distance of the obstacle : inf
EventLog - INFO - [T:23.169] Distance of the obstacle : inf
EventLog - INFO - [T:23.374] Distance of the obstacle : inf
EventLog - INFO - [T:23.568] Distance of the obstacle : inf
EventLog - INFO - [T:23.773] Distance of the obstacle : inf
EventLog - INFO - [T:23.967] Distance of the obstacle : inf
EventLog - INFO - [T:24.172] Distance of the obstacle : inf
EventLog - INFO - [T:24.367] Distance of the obstacle : inf
EventLog - INFO - [T:24.572] Distance of the obstacle : inf
EventLog - INFO - [T:24.777] Distance of the obstacle : inf
EventLog - INFO - [T:24.972] Distance of the obstacle : inf
EventLog - INFO - [T:25.168] Distance of the obstacle : inf
EventLog - INFO - [T:25.374] Distance of the obstacle : inf
EventLog - INFO - [T:25.569] Distance of the obstacle : inf
EventLog - INFO - [T:25.773] Distance of the obstacle : inf
EventLog - INFO - [T:25.967] Distance of the obstacle : inf
EventLog - INFO - [T:26.175] Distance of the obstacle : inf
EventLog - INFO - [T:26.37] Distance of the obstacle : inf
EventLog - INFO - [T:26.575] Distance of the obstacle : inf
EventLog - INFO - [T:26.77] Distance of the obstacle : inf
EventLog - INFO - [T:26.975] Distance of the obstacle : inf
EventLog - INFO - [T:27.169] Distance of the obstacle : inf
EventLog - INFO - [T:27.374] Distance of the obstacle : inf
EventLog - INFO - [T:27.57] Distance of the obstacle : inf
EventLog - INFO - [T:27.774] Distance of the obstacle : inf
EventLog - INFO - [T:27.969] Distance of the obstacle : inf
EventLog - INFO - [T:28.173] Distance of the obstacle : inf
EventLog - INFO - [T:28.367] Distance of the obstacle : inf
EventLog - INFO - [T:28.571] Distance of the obstacle : inf
EventLog - INFO - [T:28.777] Distance of the obstacle : inf
EventLog - INFO - [T:28.971] Distance of the obstacle : inf
EventLog - INFO - [T:29.175] Distance of the obstacle : inf
EventLog - INFO - [T:29.37] Distance of the obstacle : inf
EventLog - INFO - [T:29.574] Distance of the obstacle : inf
EventLog - INFO - [T:29.769] Distance of the obstacle : inf
EventLog - INFO - [T:29.974] Distance of the obstacle : inf
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0"?>
<package format="2">
<name>sim</name>
<version>0.0.0</version>
<description>The sim package</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="stolzenp@todo.todo">stolzenp</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>
<!-- Url tags are optional, but multiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/sim</url> -->
<!-- Author tags are optional, multiple are allowed, one per tag -->
<!-- Authors do not have to be maintainers, but could be -->
<!-- Example: -->
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
<!-- The *depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
<!-- <depend>roscpp</depend> -->
<!-- Note that this is equivalent to the following: -->
<!-- <build_depend>roscpp</build_depend> -->
<!-- <exec_depend>roscpp</exec_depend> -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use build_export_depend for packages you need in order to build against this package: -->
<!-- <build_export_depend>message_generation</build_export_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use exec_depend for packages you need at runtime: -->
<!-- <exec_depend>message_runtime</exec_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<!-- Use doc_depend for packages you need only for building documentation: -->
<!-- <doc_depend>doxygen</doc_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
<launch>
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="x_pos" default="0"/>
<arg name="y_pos" default="5"/>
<arg name="z_pos" default="-0.001001"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find sim)/worlds/test.world"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
</include>
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
<node pkg="gazebo_ros" type="spawn_model" name="spawn_urdf" args="-urdf -model turtlebot3_$(arg model) -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />
</launch>
#!/bin/bash
cd ~/catkin_ws
echo "testing ..."
echo ""
chmod +x ~/catkin_ws/src/semesterprojekt/src/sim/location_monitor/scripts/bot_listener.py
chmod +x ~/catkin_ws/src/semesterprojekt/src/sim/location_monitor/scripts/location_monitor_node.py
type=$(cat ~/catkin_ws/src/semesterprojekt/build/sim/botname.txt)
if [ "$type" = "burger" ]
then
botradius=0.069
else
botradius=0.1405
fi
c=0
cd ~/catkin_ws/src/semesterprojekt/build/test/testfaelle
testfall=$(find ./ -name "$c")
while [ -f $testfall/test.world ]; do
echo "test$c"
echo ""
timeout=$(grep -i "timeout" $testfall/config.ini | tr -d -c 0-9.)
rightBorder=$(grep -i "rangeRightBorder=" $testfall/config.ini | tr -d -c 0-9.)
leftBorder=$(grep -i "rangeLeftBorder=" $testfall/config.ini | tr -d -c 0-9.)
dist=$(bc -l <<< "scale=10; ($rightBorder-$leftBorder)")
cp $testfall/test.world ~/catkin_ws/src/semesterprojekt/build/sim/worlds/test.world
#configuring launch file
echo '<launch>
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="x_pos" default="0"/>
<arg name="y_pos" default="5"/>
<arg name="z_pos" default="-0.001001"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find sim)/worlds/test.world"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
</include>
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
<node pkg="gazebo_ros" type="spawn_model" name="spawn_urdf" args="-urdf -model turtlebot3_$(arg model) -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />
</launch>' > ~/catkin_ws/src/semesterprojekt/build/sim/sim.launch
#Launch Welt
gnome-terminal -- bash -c 'cd ~/catkin_ws; source devel/setup.bash; export TURTLEBOT3_MODEL='$type'; roslaunch sim sim.launch; sleep 5'
#bot_listener
sleep 1
gnome-terminal -- bash -c 'cd ~/catkin_ws; source devel/setup.bash; cd ~/catkin_ws/src/semesterprojekt/build/sim/log; rosrun location_monitor bot_listener.py;'
#location_monitor
# gnome-terminal -- bash -c 'cd ~/catkin_ws; source devel/setup.bash; cd ~/catkin_ws/src/semesterprojekt/build/sim/log; rosrun location_monitor location_monitor_node.py '$botradius' '$dist' 500 '$timeout';'
#Launch Test
gnome-terminal -- bash -c 'cd ~/catkin_ws; source devel/setup.bash; export TURTLEBOT3_MODEL=burger; rosrun sim turtlebot3_obstacle '$dist';'
cd ~/catkin_ws; source devel/setup.bash
cd ~/catkin_ws/src/semesterprojekt/build/sim/log
echo 'Location_Monitor:'
echo ''
if [ "$type" = "burger" ]
then
rosrun location_monitor location_monitor_node.py $botradius 0 0 $dist 500 $timeout
else
rosrun location_monitor location_monitor_node.py $botradius 0.07 68 $dist 500 $timeout
fi
# if ( rosrun location_monitor location_monitor_node.py $botradius $dist 500 $timeout & ) | grep -q -m 1 'Collision\|Stop\|Timeout'; then
# ps ax | grep -i python | awk {'print $1'} | xargs kill -9
# ps ax | grep -i gzclient | awk {'print $1'} | xargs kill -9
# ps ax | grep -i gzserver | awk {'print $1'} | xargs kill -9
# fi
# sleep 30
ps ax | grep -i python | awk {'print $1'} | xargs kill -9 > /dev/null 2> /dev/null || :
ps ax | grep -i gzclient | awk {'print $1'} | xargs kill -9 > /dev/null 2> /dev/null || :
ps ax | grep -i gzserver | awk {'print $1'} | xargs kill -9 > /dev/null 2> /dev/null || :
mv ~/catkin_ws/src/semesterprojekt/build/sim/log/bot_listener.log ~/catkin_ws/src/semesterprojekt/build/sim/log/bl$c.log
mv ~/catkin_ws/src/semesterprojekt/build/sim/log/location_monitor.log ~/catkin_ws/src/semesterprojekt/build/sim/log/lm$c.log
let c=c+1
cd ~/catkin_ws/src/semesterprojekt/build/test/testfaelle
testfall=$(find ./ -name "$c")
done
cd ~/catkin_ws
echo ""
echo "Done"
#!/usr/bin/env python
#################################################################################
# Copyright 2018 ROBOTIS CO., LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#################################################################################
# Authors: Gilbert #
import sys
import rospy
import math
from sensor_msgs.msg import LaserScan
from std_msgs.msg import String
from geometry_msgs.msg import Twist
from datetime import datetime
from gazebo_msgs.srv import GetWorldProperties
#Angepasst fuer Log-Aufzeichnung
topic = 'chatter'
pub = rospy.Publisher(topic, String)
LINEAR_VEL = 0.22
STOP_DISTANCE = float(sys.argv[1])
LIDAR_ERROR = 0.05
SAFE_STOP_DISTANCE = STOP_DISTANCE + LIDAR_ERROR
class Obstacle():
def __init__(self):
self._cmd_pub = rospy.Publisher('cmd_vel', Twist, queue_size=1)
self.obstacle()
def get_scan(self):
scan = rospy.wait_for_message('scan', LaserScan)
scan_filter = []
samples = len(scan.ranges) # The number of samples is defined in
# turtlebot3_<model>.gazebo.xacro file,
# the default is 360.
samples_view = 1 # 1 <= samples_view <= samples
if samples_view > samples:
samples_view = samples
if samples_view is 1:
scan_filter.append(scan.ranges[0])
else:
left_lidar_samples_ranges = -(samples_view//2 + samples_view % 2)
right_lidar_samples_ranges = samples_view//2
left_lidar_samples = scan.ranges[left_lidar_samples_ranges:]
right_lidar_samples = scan.ranges[:right_lidar_samples_ranges]
scan_filter.extend(left_lidar_samples + right_lidar_samples)
for i in range(samples_view):
if math.isnan(scan_filter[i]):
scan_filter[i] = 0
return scan_filter
def obstacle(self):
global pub
twist = Twist()
turtlebot_moving = True
while not rospy.is_shutdown():
lidar_distances = self.get_scan()
min_distance = min(lidar_distances)
if min_distance < SAFE_STOP_DISTANCE:
if turtlebot_moving:
twist.linear.x = 0.0
twist.angular.z = 0.0
self._cmd_pub.publish(twist)
turtlebot_moving = False
rospy.loginfo('Stop!')
pub.publish("Stop!")
else:
twist.linear.x = LINEAR_VEL
twist.angular.z = 0.0
self._cmd_pub.publish(twist)
turtlebot_moving = True
rospy.loginfo('Distance of the obstacle : %f', min_distance)
pub.publish("Distance of the obstacle : " + str(min_distance))
def main():
rospy.init_node('turtlebot3_obstacle')
try:
obstacle = Obstacle()
except rospy.ROSInterruptException:
pass
if __name__ == '__main__':
main()
No preview for this file type
No preview for this file type