Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
TiaSinghania committed Feb 5, 2024
1 parent 27df437 commit 931c7a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion rb_ws/src/buggy/scripts/2d_sim/controller_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ def set_velocity(self, vel: float):
rate = rospy.Rate(5)
i = 0
while not rospy.is_shutdown():
controller.set_velocity(15)
rate.sleep()

9 changes: 4 additions & 5 deletions rb_ws/src/buggy/scripts/2d_sim/velocity_ui.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#! /usr/bin/env python3
import numpy as np
import rospy
import sys
from controller_2d import Controller
from std_msgs.msg import Float64
import threading
import math
import tkinter as tk
import keyboard

class VelocityUI:

Expand All @@ -34,10 +30,13 @@ def __init__(self, init_vel: float, buggy_name: str):


def step(self):
"""sets velocity of buggy to the current scale value
called once every tick
"""
self.root.update_idletasks()
self.root.update()
'''Update velocity of buggy'''
self.buggy_vel = self.scale.get()/10
self.buggy_vel = self.scale.get()/10 # so we can set velocity with 0.1 precision
self.controller.set_velocity(self.buggy_vel)


Expand Down
3 changes: 2 additions & 1 deletion rb_ws/src/buggy/scripts/auton/autonsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def __init__(self, trajectory, controller, brake_controller, buggy_name, is_sim)
rospy.Subscriber(buggy_name + "/nav/odom", Odometry, self.update_msg)


rospy.Subscriber("nav/odom", Odometry, self.update_msg)
rospy.Subscriber(buggy_name + "nav/odom", Odometry, self.update_msg)

self.covariance_warning_publisher = rospy.Publisher(
buggy_name + "/debug/is_high_covariance", Bool, queue_size=1
)
Expand Down

0 comments on commit 931c7a8

Please sign in to comment.