Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrhm committed Sep 15, 2024
1 parent d537146 commit 7c6adc9
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 37 deletions.
16 changes: 2 additions & 14 deletions scripts/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,11 @@ def __init__(self, state_machine_instance, *args, **kwargs):
self.viz = Node("Visualizer")

self.viz.create_subscription(
StateMachineStructure,
STRUCTURE_TOPIC,
self.state_machine.container_structure_callback,
1
StateMachineStructure, STRUCTURE_TOPIC, self.state_machine.container_structure_callback, 1
)

self.viz.create_subscription(
StateMachineStateUpdate,
STATUS_TOPIC,
self.state_machine.container_status_callback,
1
StateMachineStateUpdate, STATUS_TOPIC, self.state_machine.container_status_callback, 1
)

def paintEvent(self, event):
Expand Down Expand Up @@ -144,20 +138,14 @@ def main():
signal.signal(signal.SIGINT, signal.SIG_DFL)
state_machine = StateMachine()

<<<<<<< HEAD
print("Node Created...")

print("Subscriptions Created...")

=======

print("Node Created...")


print("Subscriptions Created...")


>>>>>>> nav_fixes
app = QApplication([]) # type: ignore
g = GUI(state_machine)
g.show()
Expand Down
37 changes: 18 additions & 19 deletions starter_project/autonomy/launch/starter_project.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,21 @@ def generate_launch_description():
condition=LaunchConfigurationEquals("rviz", "true"),
)

return LaunchDescription([
launch_include_sim,
rviz_node,

# ==========
# Perception
# ==========
perception_node,

# ===========
# Navigation
# ===========
navigation_node,

# ============
# Localization
# ============
localization_node
])
return LaunchDescription(
[
launch_include_sim,
rviz_node,
# ==========
# Perception
# ==========
perception_node,
# ===========
# Navigation
# ===========
navigation_node,
# ============
# Localization
# ============
localization_node,
]
)
1 change: 1 addition & 0 deletions starter_project/autonomy/src/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def spherical_to_cartesian(spherical_coord: np.ndarray, reference_coord: np.ndar
"""
# TODO


def main():
# initialize the node
rclpy.init()
Expand Down
4 changes: 3 additions & 1 deletion starter_project/autonomy/src/navigation/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

import sys
import os
sys.path.append(os.getcwd() + '/starter_project/autonomy/src')

sys.path.append(os.getcwd() + "/starter_project/autonomy/src")
from util.SE3 import SE3
from visualization_msgs.msg import Marker

Expand All @@ -35,6 +36,7 @@ def send_drive_stop(self):
# TODO: tell the rover to stop
pass


@dataclass
class Environment:
"""
Expand Down
3 changes: 2 additions & 1 deletion starter_project/autonomy/src/navigation/drive_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from state_machine.state import State
from tag_seek import TagSeekState


class DriveState(State):
def on_enter(self, context) -> None:
pass
Expand All @@ -21,7 +22,7 @@ def on_loop(self, context) -> State:
# (HINT: use get_drive_command(), with completion_thresh set to 0.7 and turn_in_place_thresh set to 0.2)

# TODO: if we are finished getting to the target, go to TagSeekState

# TODO: send the drive command to the rover

# TODO: tell state machine to stay in the DriveState by returning self
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __init__(self, ctx: Context):

self.create_timer(1 / 60, self.state_machine.update)


def main():
try:
# TODO: init a node called "navigation"
Expand Down
6 changes: 4 additions & 2 deletions starter_project/autonomy/src/navigation/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from context import Context


class DoneState(State):
def on_enter(self, context) -> None:
pass
Expand All @@ -18,7 +19,8 @@ def on_loop(self, context) -> State:
cmd_vel = Twist()
context.rover.send_drive_command(cmd_vel)
return self



class FailState(State):
def on_enter(self, context) -> None:
pass
Expand All @@ -30,4 +32,4 @@ def on_loop(self, context) -> State:
# Stop rover
cmd_vel = Twist()
context.rover.send_drive_command(cmd_vel)
return self
return self

0 comments on commit 7c6adc9

Please sign in to comment.