diff --git a/rb_ws/src/buggy/buggy/simulator/velocity_ui.py b/rb_ws/src/buggy/buggy/simulator/velocity_ui.py index 4bc845e0..6fc3112b 100644 --- a/rb_ws/src/buggy/buggy/simulator/velocity_ui.py +++ b/rb_ws/src/buggy/buggy/simulator/velocity_ui.py @@ -52,15 +52,11 @@ def main(args=None): init_vel = float(sys.argv[1]) buggy_name = sys.argv[2] - vel_ui = VelocityUI(init_vel, buggy_name) + velocity_ui = VelocityUI(init_vel, buggy_name) - try: - rclpy.spin(vel_ui) - except KeyboardInterrupt: - print("Shutting down velocity UI") - finally: - vel_ui.destroy_node() - rclpy.shutdown() + rclpy.spin(velocity_ui) + velocity_ui.destroy_node() + rclpy.shutdown() if __name__ == "__main__": main() \ No newline at end of file diff --git a/rb_ws/src/buggy/buggy/simulator/velocity_updater.py b/rb_ws/src/buggy/buggy/simulator/velocity_updater.py index 6cc90f3a..ed63a02d 100644 --- a/rb_ws/src/buggy/buggy/simulator/velocity_updater.py +++ b/rb_ws/src/buggy/buggy/simulator/velocity_updater.py @@ -15,7 +15,7 @@ class VelocityUpdater(Node): # '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) + (589701, 4477160, 20, 5) ] def __init__(self, init_vel: float, buggy_name: str): @@ -76,15 +76,11 @@ def main(args=None): init_vel = float(sys.argv[1]) buggy_name = sys.argv[2] - vel_updater = VelocityUpdater(init_vel, buggy_name) + velocity_updater = VelocityUpdater(init_vel, buggy_name) - try: - rclpy.spin(vel_updater) - except KeyboardInterrupt: - print("Shutting down velocity updater") - finally: - vel_updater.destroy_node() - rclpy.shutdown() + rclpy.spin(velocity_updater) + velocity_updater.destroy_node() + rclpy.shutdown() if __name__ == "__main__": main() \ No newline at end of file diff --git a/rb_ws/src/buggy/launch/sim_2d_single_velocity.xml b/rb_ws/src/buggy/launch/sim_2d_single_velocity.xml new file mode 100644 index 00000000..c64491b6 --- /dev/null +++ b/rb_ws/src/buggy/launch/sim_2d_single_velocity.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/rb_ws/src/buggy/setup.py b/rb_ws/src/buggy/setup.py index 42318d08..444cf4c7 100644 --- a/rb_ws/src/buggy/setup.py +++ b/rb_ws/src/buggy/setup.py @@ -26,6 +26,8 @@ 'console_scripts': [ 'hello_world = buggy.hello_world:main', 'sim_single = buggy.simulator.engine:main', + 'sim_velocity_ui = buggy.similator.velocity_ui:main', + 'sim_velocity_updater = buggy.similator.velocity_updater:main', 'watchdog = buggy.watchdog.watchdog_node:main' ], },