Skip to content

Commit

Permalink
more pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackack committed Feb 3, 2024
1 parent a83de9f commit ba8305f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
9 changes: 4 additions & 5 deletions rb_ws/src/buggy/scripts/auton/autonsystem.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/usr/bin/env python3

import argparse
import cProfile
from threading import Lock

import rospy
import sys

# ROS Message Imports
from std_msgs.msg import Float32, Float64, Bool
from nav_msgs.msg import Odometry

import numpy as np
from threading import Lock

from trajectory import Trajectory
from world import World
Expand All @@ -21,9 +23,6 @@
from path_planner import PathPlanner
from pose import Pose

import argparse
import cProfile

class AutonSystem:
"""
Top-level class for the RoboBuggy autonomous system
Expand Down
2 changes: 0 additions & 2 deletions rb_ws/src/buggy/scripts/auton/controller.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from abc import ABC, abstractmethod

import numpy as np
from trajectory import Trajectory
from pose import Pose
import rospy
from sensor_msgs.msg import NavSatFix
from world import World

Expand Down
3 changes: 0 additions & 3 deletions rb_ws/src/buggy/scripts/auton/path_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
import rospy
from sensor_msgs.msg import NavSatFix
from std_msgs.msg import Float64
from geometry_msgs.msg import Pose as ROSPose
from pose import Pose

from occupancy_grid.grid_manager import OccupancyGrid
from path_projection import Projector
from trajectory import Trajectory
from world import World
import copy


LOOKAHEAD_TIME = 2.0 #s
RESOLUTION = 30 #samples/s
Expand Down
10 changes: 6 additions & 4 deletions rb_ws/src/buggy/scripts/auton/path_projection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import numpy as np
from pose import Pose
import time

class Projector:
"""
Expand All @@ -22,10 +22,12 @@ def project(self, pose: Pose, command: float, v: float, delta_t: float, resoluti
resolution (int): Number of points to output per second
Returns:
list: 2D List with shape ((time * resolutions), (2)), where the ith row is [utm_e, utm_n] at ith prediction
list: 2D List with shape ((time * resolutions), (2)),
where the ith row is [utm_e, utm_n] at ith prediction
"""

# t_0 = time.perf_counter_ns()

dtheta = v * np.tan(np.deg2rad(command)) / self.wheelbase
ts = 1/resolution
t = np.arange(0, delta_t, ts)
Expand All @@ -45,9 +47,9 @@ def project(self, pose: Pose, command: float, v: float, delta_t: float, resoluti
y = pose.y + t * v * np.sin(theta)

output = np.vstack((x, y)).T
t_1 = time.perf_counter_ns()

# t_1 = time.perf_counter_ns()
# print("time per point (us):", (t_1 - t_0)/(1000 * resolution * delta_t))

return output

def project_discrete(self, pose: Pose, command: float, v: float, time: float, resolution: int, sim_rate: int) -> list:
Expand Down
2 changes: 0 additions & 2 deletions rb_ws/src/buggy/scripts/auton/stanley_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from abc import ABC, abstractmethod

import numpy as np

import rospy
Expand Down
3 changes: 2 additions & 1 deletion rb_ws/src/buggy/scripts/auton/trajectory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import numpy as np
import json
import matplotlib.pyplot as plt
import uuid
import numpy as np

from scipy.interpolate import Akima1DInterpolator, CubicSpline

from world import World
Expand Down

0 comments on commit ba8305f

Please sign in to comment.