diff --git a/rb_ws/src/buggy/launch/sim_2d_single.xml b/rb_ws/src/buggy/launch/sim_2d_single.xml index e0b58465..0aed958d 100755 --- a/rb_ws/src/buggy/launch/sim_2d_single.xml +++ b/rb_ws/src/buggy/launch/sim_2d_single.xml @@ -1,6 +1,9 @@ + + + \ No newline at end of file diff --git a/rb_ws/src/buggy/scripts/simulator/engine.py b/rb_ws/src/buggy/scripts/simulator/engine.py new file mode 100644 index 00000000..f91efda6 --- /dev/null +++ b/rb_ws/src/buggy/scripts/simulator/engine.py @@ -0,0 +1,27 @@ +#! /usr/bin/env python3 +import sys +import time +import rclpy +from rclpy.node import Node + +class Simulator(Node): + # simulator constants: + + def __init__(self): + if (self.get_namespace() == "SC"): + self.buggy_name = "SC" + if (self.get_namespace() == "NAND"): + self.buggy_name = "NAND" + + if __name__ == "__main__": + rclpy.init() + sim = Simulator() + rclpy.spin(sim) + + # publish initial position, then sleep + # so that auton stack has time to initialize + # before buggy moves + time.sleep(15.0) + sim.loop() + + diff --git a/rb_ws/src/buggy/setup.py b/rb_ws/src/buggy/setup.py index 4373639f..b8edf928 100644 --- a/rb_ws/src/buggy/setup.py +++ b/rb_ws/src/buggy/setup.py @@ -25,6 +25,8 @@ entry_points={ 'console_scripts': [ 'hello_world = buggy.hello_world:main' + 'sim-single = buggy.engine:main' + ], }, )