Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Semesterprojekt Modulbasiertes Testen
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Trappe
Semesterprojekt Modulbasiertes Testen
Commits
b5f93230
Commit
b5f93230
authored
5 years ago
by
Daniel Christoph
Browse files
Options
Downloads
Patches
Plain Diff
Replace location_monitor_node.py
parent
bc976266
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sim/location_monitor/scripts/location_monitor_node.py
+8
-6
8 additions, 6 deletions
src/sim/location_monitor/scripts/location_monitor_node.py
with
8 additions
and
6 deletions
src/sim/location_monitor/scripts/location_monitor_node.py
+
8
−
6
View file @
b5f93230
...
@@ -158,13 +158,13 @@ def objectWithRadiusDetection(radius, cordlist, l_x, l_y, simtime):
...
@@ -158,13 +158,13 @@ def objectWithRadiusDetection(radius, cordlist, l_x, l_y, simtime):
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
))
logger
.
info
(
"
Safedist.:
"
+
str
(
safedist
))
lenght
=
len
(
cordlist
)
-
1
lenght
=
len
(
cordlist
)
-
1
rospy
.
loginfo
(
"
Distance:
"
+
str
(
distance
(
cordlist
[
0
],
cordlist
[
1
],
l_x
,
l_y
)))
rospy
.
loginfo
(
"
Distance:
"
+
str
(
distance
(
cordlist
[
0
],
cordlist
[
1
],
l_x
,
l_y
)))
#Zenterpunkt
dist
=
distance
(
cordlist
[
0
],
cordlist
[
1
],
l_x
,
l_y
)
logger
.
info
(
"
[T:
"
+
simtime
+
"
]
"
+
"
Dist. To Bot Center:
"
+
str
(
dist
))
for
i
in
range
(
lenght
):
for
i
in
range
(
lenght
):
dist
=
distance
(
cordlist
[
i
],
cordlist
[
i
+
1
],
l_x
,
l_y
)
dist
=
distance
(
cordlist
[
i
],
cordlist
[
i
+
1
],
l_x
,
l_y
)
if
WriteFlag
==
0
:
logger
.
info
(
"
Safedist.:
"
+
str
(
safedist
))
logger
.
info
(
"
[T:
"
+
simtime
+
"
]
"
+
"
Dist. To Collision Point:
"
+
str
(
dist
))
if
dist
<
safedist
:
if
dist
<
safedist
:
rospy
.
loginfo
(
"
Collision!
"
)
rospy
.
loginfo
(
"
Collision!
"
)
if
WriteFlag
==
0
:
if
WriteFlag
==
0
:
...
@@ -209,8 +209,8 @@ def boxkdetection(size, cordlist, l_x, l_y, yaw_degrees, simtime):
...
@@ -209,8 +209,8 @@ def boxkdetection(size, cordlist, l_x, l_y, yaw_degrees, simtime):
dynY
=
l_y
+
dis
*
math
.
sin
(
math
.
radians
(
angle1
))
dynY
=
l_y
+
dis
*
math
.
sin
(
math
.
radians
(
angle1
))
distult
=
distance
(
cordlist
[
i
],
cordlist
[
i
+
1
],
dynX
,
dynY
)
distult
=
distance
(
cordlist
[
i
],
cordlist
[
i
+
1
],
dynX
,
dynY
)
if
WriteFlag
==
0
:
if
WriteFlag
==
0
and
i
==
0
:
logger
.
info
(
"
[T:
"
+
str
(
simtime
)
+
"
]
"
+
"
Dist
to collision point
:
"
+
str
(
distult
))
logger
.
info
(
"
[T:
"
+
str
(
simtime
)
+
"
]
"
+
"
Dist
. To Bot Center
:
"
+
str
(
distult
))
rospy
.
loginfo
(
"
Dist to collision point:
"
+
str
(
distult
))
rospy
.
loginfo
(
"
Dist to collision point:
"
+
str
(
distult
))
if
distult
<
safedist
:
if
distult
<
safedist
:
rospy
.
loginfo
(
"
Collision!
"
)
rospy
.
loginfo
(
"
Collision!
"
)
...
@@ -270,6 +270,8 @@ def callback(msg):
...
@@ -270,6 +270,8 @@ def callback(msg):
cordlist
.
append
(
botx
+
BotSides
*
math
.
cos
(
math
.
radians
(
yawBot
-
BotSideRad
)))
cordlist
.
append
(
botx
+
BotSides
*
math
.
cos
(
math
.
radians
(
yawBot
-
BotSideRad
)))
cordlist
.
append
(
boty
+
BotSides
*
math
.
sin
(
math
.
radians
(
yawBot
-
BotSideRad
)))
cordlist
.
append
(
boty
+
BotSides
*
math
.
sin
(
math
.
radians
(
yawBot
-
BotSideRad
)))
detect
.
show_gazebo_models
(
cordlist
)
detect
.
show_gazebo_models
(
cordlist
)
gc
.
collect
()
gc
.
collect
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment