forked from CMU-Robotics-Club/RoboBuggy2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ebbd5c
commit 79879a8
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
<launch> | ||
<node pkg="foxglove_bridge" exec="foxglove_bridge" name="foxglove" namespace="SC"/> | ||
<node pkg="buggy" exec="hello_world" name="hello_world" namespace="SC"/> | ||
<node pkg="buggy" exec="sim-single" name="SC-sim-single" namespace="SC"/> | ||
<node pkg="buggy" exec="sim-single" name="NAND-sim-single" namespace="NAND"/> | ||
|
||
<!-- <node name="foxglove" pkg="foxglove_bridge" type="foxglove_bridge" /> --> | ||
<!-- <node name="hello_world" pkg="buggy" type="hello_world" /> --> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters