From ca11c95773c5fe5b7b38b43e955b07829fc15a30 Mon Sep 17 00:00:00 2001 From: JoyceZhu2486 Date: Wed, 13 Nov 2024 14:58:33 -0500 Subject: [PATCH] Co-authored-by: aislinny --- rb_ws/src/buggy/buggy/simulator/velocity_ui.py | 2 +- rb_ws/src/buggy/buggy/simulator/velocity_updater.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rb_ws/src/buggy/buggy/simulator/velocity_ui.py b/rb_ws/src/buggy/buggy/simulator/velocity_ui.py index 30704393..4bc845e0 100644 --- a/rb_ws/src/buggy/buggy/simulator/velocity_ui.py +++ b/rb_ws/src/buggy/buggy/simulator/velocity_ui.py @@ -30,7 +30,7 @@ def __init__(self, init_vel: float, buggy_name: str): # ROS2 timer for stepping # 0.01 is equivalent to 100Hz (100 times per second) - self.create_timer(0.01, self.step) + self.create_timer(0.01, self.step) def step(self): # Sets the velocity of the buggy to the current scale value diff --git a/rb_ws/src/buggy/buggy/simulator/velocity_updater.py b/rb_ws/src/buggy/buggy/simulator/velocity_updater.py index 4bc628bb..6cc90f3a 100644 --- a/rb_ws/src/buggy/buggy/simulator/velocity_updater.py +++ b/rb_ws/src/buggy/buggy/simulator/velocity_updater.py @@ -1,17 +1,18 @@ #! /usr/bin/env python3 import sys import math +import threading import rclpy from rclpy.node import Node from controller_2d import Controller from geometry_msgs.msg import Pose from geometry_msgs.msg import Point -import threading class VelocityUpdater(Node): RATE = 100 # Bubbles for updating acceleration based on position # represented as 4-tuples: (x-pos, y-pos, radius, acceleration) + # 'list[tuple[float,float,float,float]]' # need further update such as more data or import data from certain files CHECKPOINTS = [ (589701, 4477160, 20, 0.5)