Skip to content

Commit

Permalink
fix: static code check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-lei authored and glopezdiest committed Sep 6, 2023
1 parent 081c245 commit 252b3c8
Show file tree
Hide file tree
Showing 68 changed files with 23,841 additions and 3,163 deletions.
2 changes: 1 addition & 1 deletion srunner/autoagents/npc_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def sensors(self):
return sensors

def run_step(self, input_data, timestamp):
#Execute one step of navigation.
# Execute one step of navigation.
if not self._agent:

# Search for the ego actor
Expand Down
28 changes: 18 additions & 10 deletions srunner/metrics/tools/osc2_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"""

import fnmatch

from srunner.metrics.tools.osc2_trace_parser import Osc2TraceParser


class Osc2Log(object): # pylint: disable=too-many-public-methods
"""
Utility class to query the log.
Expand All @@ -29,13 +31,13 @@ def __init__(self, recorder):
# Parse the information
parser = Osc2TraceParser(recorder)
self._simulation, self._actors, self._frames = parser.parse_recorder_info()

def get_simulation(self):
return self._simulation

def get_actors(self):
return self._actors

def get_frames(self):
return self._frames

Expand All @@ -57,7 +59,7 @@ def get_actor_collisions(self, actor_id):
actor_collisions.update({i: collisions[actor_id]})

return actor_collisions

def get_collisions(self, frame):
return self._frames[frame]["events"]["collisions"]

Expand Down Expand Up @@ -180,7 +182,6 @@ def get_actor_alive_frames(self, actor_id):
"""

if actor_id in self._actors:

actor_info = self._actors[actor_id]
first_frame = actor_info["created"]
if "destroyed" in actor_info:
Expand All @@ -207,7 +208,6 @@ def _get_actor_state(self, actor_id, state, frame):

# Check if the actor exists
if actor_id in frame_state:

# Check if the state exists
if state not in frame_state[actor_id]:
return None
Expand Down Expand Up @@ -275,7 +275,9 @@ def get_all_actor_transforms(self, actor_id, first_frame=None, last_frame=None):
"""
Returns a list with all the transforms of the actor at the frame interval.
"""
return self._get_all_actor_states(actor_id, "transform", first_frame, last_frame)
return self._get_all_actor_states(
actor_id, "transform", first_frame, last_frame
)

def get_actor_transforms_at_frame(self, frame, actor_list=None):
"""
Expand Down Expand Up @@ -311,11 +313,15 @@ def get_actor_angular_velocity(self, actor_id, frame):
"""
return self._get_actor_state(actor_id, "angular_velocity", frame)

def get_all_actor_angular_velocities(self, actor_id, first_frame=None, last_frame=None):
def get_all_actor_angular_velocities(
self, actor_id, first_frame=None, last_frame=None
):
"""
Returns a list with all the angular velocities of the actor at the frame interval.
"""
return self._get_all_actor_states(actor_id, "angular_velocity", first_frame, last_frame)
return self._get_all_actor_states(
actor_id, "angular_velocity", first_frame, last_frame
)

def get_actor_angular_velocities_at_frame(self, frame, actor_list=None):
"""
Expand All @@ -335,7 +341,9 @@ def get_all_actor_accelerations(self, actor_id, first_frame=None, last_frame=Non
"""
Returns a list with all the accelerations of the actor at the frame interval.
"""
return self._get_all_actor_states(actor_id, "acceleration", first_frame, last_frame)
return self._get_all_actor_states(
actor_id, "acceleration", first_frame, last_frame
)

def get_actor_accelerations_at_frame(self, frame, actor_list=None):
"""
Expand Down
Loading

0 comments on commit 252b3c8

Please sign in to comment.