Skip to content

Commit

Permalink
Issue #3: Cleans up code for the ado vehicle filter
Browse files Browse the repository at this point in the history
- Removes the excess variable creation for colors and moves the values into the ColorRGBA constructor.
- Updates the formatting of the file to match the PEP-8 standard.
  • Loading branch information
exoticDFT committed Sep 25, 2020
1 parent b1c63b4 commit 914793b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions script/game_ado_vehicle_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def relevant_filter(pos_x, pos_y, yaw, object):
# Object is in the circle, but not relevant to ego location
return False, 0, 0


def relevant_filter_entrance(pos_x, pos_y, object):
'''
Determines if the object is trying to enter the circle and relevant
Expand Down Expand Up @@ -278,6 +279,7 @@ def relevant_filter_entrance(pos_x, pos_y, object):

return False


if self.ego_ready and self.nearby_ready:
self.ego_odom_pub.publish(self.ego_odom)

Expand Down Expand Up @@ -325,11 +327,7 @@ def relevant_filter_entrance(pos_x, pos_y, object):
behind_closest_obj = obj

# Visualization of all relevant objects
color_relevant = ColorRGBA()
color_relevant.r = 0
color_relevant.g = 0
color_relevant.b = 1
color_relevant.a = 0.5
color_relevant = ColorRGBA(0.0, 0.0, 1.0, 0.5)
self.viz_cars(
relevant_msg.objects,
header,
Expand Down Expand Up @@ -369,11 +367,7 @@ def relevant_filter_entrance(pos_x, pos_y, object):
self.opp_odom_pub.publish(ado_odom)

# Visualization of current opponent
color_opp = ColorRGBA()
color_opp.r = 1
color_opp.g = 0
color_opp.b = 0
color_opp.a = 1
color_opp = ColorRGBA(1.0, 0.0, 0.0, 1.0)
self.viz_cars([ado_object], header, color_opp, self.ado_marker_pub)


Expand Down

0 comments on commit 914793b

Please sign in to comment.