Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
TiaSinghania committed Aug 16, 2024
1 parent d975cf1 commit d8d2301
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
9 changes: 3 additions & 6 deletions rb_ws/src/buggy/paths/rosbag_to_pose_csv.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#! /usr/bin/env python3
import rosbag
import argparse
import uuid
import json
import csv
import rosbag
from tf.transformations import euler_from_quaternion

def main():
Expand All @@ -26,7 +24,7 @@ def main():
i = 0

# Loop through bag
for topic, msg, t in bag.read_messages(topics="/nav/odom"):
for _, msg, _ in bag.read_messages(topics="/nav/odom"):
# Skip waypoints
if i % args.subsample != 0:
i += 1
Expand All @@ -38,7 +36,7 @@ def main():
orientation_q = msg.pose.pose.orientation

orientation_list = [orientation_q.x, orientation_q.y, orientation_q.z, orientation_q.w]
(roll, pitch, yaw) = euler_from_quaternion (orientation_list)
(_, _, yaw) = euler_from_quaternion (orientation_list)


waypoints.append([str(lat), str(lon), str(yaw)])
Expand All @@ -49,7 +47,6 @@ def main():
quotechar='|', quoting=csv.QUOTE_MINIMAL)
for row in waypoints:
writer.writerow(row)



if __name__ == "__main__":
Expand Down
6 changes: 2 additions & 4 deletions rb_ws/src/buggy/scripts/auton/brake_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
import rospy
import numpy as np
from controller import Controller

Expand All @@ -24,7 +23,6 @@ def calculate_lateral_accel(linear_speed: float, steering_angle: float) -> float
"""
if (steering_angle == 0.0):
return 0.0

radius_front_wheel = Controller.WHEELBASE / np.sin(np.deg2rad(steering_angle))
radius_rear_wheel = Controller.WHEELBASE / np.tan(np.deg2rad(steering_angle))

Expand All @@ -49,7 +47,7 @@ def compute_braking(self, speed: float, steering_angle: float) -> float:
return self._compute_binary_braking(speed, steering_angle)
else:
return self._compute_modulated_braking(speed, steering_angle)

def _compute_binary_braking(self, speed: float, steering_angle: float) -> float:
"""Binary braking - using lateral acceleration
Expand All @@ -65,7 +63,7 @@ def _compute_binary_braking(self, speed: float, steering_angle: float) -> float:
return 1.0
else:
return 0.0

def _compute_modulated_braking(self, speed: float, steering_angle: float) -> float:
"""Using P controller for braking based on lateral acceleration of buggy. Modulated values
from 0-1
Expand Down
2 changes: 0 additions & 2 deletions rb_ws/src/buggy/scripts/auton/pure_pursuit_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: 1 addition & 2 deletions rb_ws/src/buggy/scripts/validation/log_battery.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# A script to log battery data to a .txt file

import csv
import rospy
from sensor_msgs.msg import BatteryState # Callback function to print the subscribed data on the terminal
import numpy as np
import csv

file = open('battery_data.txt', 'w', newline='')
writer = csv.writer(file)
Expand Down
2 changes: 1 addition & 1 deletion rb_ws/src/buggy/scripts/validation/log_battery_tester.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Script
# Script
import rospy
from sensor_msgs.msg import BatteryState # Callback function to print the subscribed data on the terminal
import numpy as np
Expand Down

0 comments on commit d8d2301

Please sign in to comment.