Skip to content
Snippets Groups Projects
Commit eaff15c6 authored by marvin's avatar marvin
Browse files

Merge branch 'master' of...

Merge branch 'master' of https://gitlab.informatik.hu-berlin.de/trappejo/semesterprojekt-modulbasiertes-testen.git
parents ce5619ed c6e9a69e
No related merge requests found
...@@ -72,7 +72,7 @@ for ((i=0; i<${anzahlTests}; i++)); do ...@@ -72,7 +72,7 @@ for ((i=0; i<${anzahlTests}; i++)); do
rightBorder=$(grep -i "rangeRightBorder=" ~/catkin_ws/src/semesterprojekt-modulbasiertes-testen/build/test/testfaelle/$path/config.ini | tr -d -c 0-9.) rightBorder=$(grep -i "rangeRightBorder=" ~/catkin_ws/src/semesterprojekt-modulbasiertes-testen/build/test/testfaelle/$path/config.ini | tr -d -c 0-9.)
leftBorder=$(grep -i "rangeLeftBorder=" ~/catkin_ws/src/semesterprojekt-modulbasiertes-testen/build/test/testfaelle/$path/config.ini | tr -d -c 0-9.) leftBorder=$(grep -i "rangeLeftBorder=" ~/catkin_ws/src/semesterprojekt-modulbasiertes-testen/build/test/testfaelle/$path/config.ini | tr -d -c 0-9.)
# Safety Distance bestimmen anhand der gewonnen Informationen # Safety Distance bestimmen anhand der gewonnenen Informationen
dist=$(bc -l <<< "scale=10; ($rightBorder-$leftBorder)") dist=$(bc -l <<< "scale=10; ($rightBorder-$leftBorder)")
...@@ -105,6 +105,8 @@ for ((i=0; i<${anzahlTests}; i++)); do ...@@ -105,6 +105,8 @@ for ((i=0; i<${anzahlTests}; i++)); do
## Simulation ## Simulation
# Sollte während der Iterationen die Simulation aufhängen, dann innerhalb des Hauptterminals Strg+C drücken um den aktuellen Testfall zu überspringen
# Launch der Welt # Launch der Welt
gnome-terminal -- bash -c 'cd ~/catkin_ws; source devel/setup.bash; export TURTLEBOT3_MODEL='$type'; roslaunch sim '$filename'.launch; sleep 5' gnome-terminal -- bash -c 'cd ~/catkin_ws; source devel/setup.bash; export TURTLEBOT3_MODEL='$type'; roslaunch sim '$filename'.launch; sleep 5'
......
...@@ -182,9 +182,9 @@ def objectWithRadiusDetection(radius, cordlist, l_x, l_y, simtime): ...@@ -182,9 +182,9 @@ def objectWithRadiusDetection(radius, cordlist, l_x, l_y, simtime):
global logger global logger
global SafeDist global SafeDist
safedist = radius + SafeDist # Radius/Size + Bot front Rad + safe dist safedist = radius + SafeDist # Radius/Size + Bot front Rad + safe dist
rospy.loginfo("Safedist: " + str(safedist)) rospy.loginfo("Safedist: " + str(SafeDist))
if WriteFlag == 0: if WriteFlag == 0:
logger.info("Safedist.: " + str(safedist)) logger.info("Safedist.: " + str(SafeDist))
lenght = len(cordlist) lenght = len(cordlist)
distList = [] distList = []
...@@ -195,8 +195,8 @@ def objectWithRadiusDetection(radius, cordlist, l_x, l_y, simtime): ...@@ -195,8 +195,8 @@ def objectWithRadiusDetection(radius, cordlist, l_x, l_y, simtime):
temp = min(distList) temp = min(distList)
#print(distList) #print(distList)
if WriteFlag == 0: if WriteFlag == 0:
logger.info("[T:" + str(simtime) + "] " + "Dist. To nearest Bot Collision point: " + str(temp)) logger.info("[T:" + str(simtime) + "] " + "Dist. To nearest Bot Collision point: " + str(temp-radius))
rospy.loginfo("Dist to collision point: " + str(temp)) rospy.loginfo("Dist to collision point: " + str(temp-radius))
if temp < safedist: if temp < safedist:
rospy.loginfo("Collision!") rospy.loginfo("Collision!")
if WriteFlag == 0: if WriteFlag == 0:
...@@ -212,10 +212,9 @@ def boxkdetection(size, cordlist, l_x, l_y, yaw_degrees, simtime): ...@@ -212,10 +212,9 @@ def boxkdetection(size, cordlist, l_x, l_y, yaw_degrees, simtime):
if WriteFlag == 0: if WriteFlag == 0:
logger.info("[T:" + str(simtime) + "] " + "Box Invalid (size > 5m)") logger.info("[T:" + str(simtime) + "] " + "Box Invalid (size > 5m)")
else: else:
safedist = SafeDist rospy.loginfo("Safedist: " + str(SafeDist))
rospy.loginfo("Safedist: " + str(safedist))
if WriteFlag == 0: if WriteFlag == 0:
logger.info("Safedist.: " + str(safedist)) logger.info("Safedist.: " + str(SafeDist))
xR = l_x + size * math.cos(math.radians(yaw_degrees)) xR = l_x + size * math.cos(math.radians(yaw_degrees))
yL = l_y + size * math.sin(math.radians(yaw_degrees)) yL = l_y + size * math.sin(math.radians(yaw_degrees))
...@@ -250,7 +249,7 @@ def boxkdetection(size, cordlist, l_x, l_y, yaw_degrees, simtime): ...@@ -250,7 +249,7 @@ def boxkdetection(size, cordlist, l_x, l_y, yaw_degrees, simtime):
if WriteFlag == 0: if WriteFlag == 0:
logger.info("[T:" + str(simtime) + "] " + "Dist. To nearest Bot Collision point: " + str(temp)) logger.info("[T:" + str(simtime) + "] " + "Dist. To nearest Bot Collision point: " + str(temp))
rospy.loginfo("Dist to collision point: " + str(temp)) rospy.loginfo("Dist to collision point: " + str(temp))
if temp < safedist: if temp < SafeDist:
rospy.loginfo("Collision!") rospy.loginfo("Collision!")
if WriteFlag == 0: if WriteFlag == 0:
logger.info("[T:" + str(simtime) + "] " + "Collision!") logger.info("[T:" + str(simtime) + "] " + "Collision!")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment