Skip to content

Commit

Permalink
minihawk
Browse files Browse the repository at this point in the history
  • Loading branch information
lyg1597 committed Dec 9, 2024
1 parent bb3d17f commit b2d9568
Show file tree
Hide file tree
Showing 75 changed files with 45,999 additions and 25,949 deletions.
1,599 changes: 799 additions & 800 deletions minihawk/Scenario-01/extracted_1/_minihawk_pose.csv

Large diffs are not rendered by default.

2,409 changes: 1,204 additions & 1,205 deletions minihawk/Scenario-01/extracted_1/_target_pose.csv

Large diffs are not rendered by default.

1,576 changes: 800 additions & 776 deletions minihawk/Scenario-01/extracted_10/_minihawk_pose.csv

Large diffs are not rendered by default.

2,379 changes: 1,205 additions & 1,174 deletions minihawk/Scenario-01/extracted_10/_target_pose.csv

Large diffs are not rendered by default.

1,452 changes: 842 additions & 610 deletions minihawk/Scenario-01/extracted_11/_minihawk_pose.csv

Large diffs are not rendered by default.

2,223 changes: 1,256 additions & 967 deletions minihawk/Scenario-01/extracted_11/_target_pose.csv

Large diffs are not rendered by default.

1,698 changes: 856 additions & 842 deletions minihawk/Scenario-01/extracted_2/_minihawk_pose.csv

Large diffs are not rendered by default.

2,530 changes: 1,274 additions & 1,256 deletions minihawk/Scenario-01/extracted_2/_target_pose.csv

Large diffs are not rendered by default.

1,334 changes: 667 additions & 667 deletions minihawk/Scenario-01/extracted_9/_minihawk_pose.csv

Large diffs are not rendered by default.

2,073 changes: 1,036 additions & 1,037 deletions minihawk/Scenario-01/extracted_9/_target_pose.csv

Large diffs are not rendered by default.

1,639 changes: 777 additions & 862 deletions minihawk/Scenario-02/extracted_10/_minihawk_pose.csv

Large diffs are not rendered by default.

2,455 changes: 1,174 additions & 1,281 deletions minihawk/Scenario-02/extracted_10/_target_pose.csv

Large diffs are not rendered by default.

1,707 changes: 862 additions & 845 deletions minihawk/Scenario-02/extracted_11/_minihawk_pose.csv

Large diffs are not rendered by default.

2,540 changes: 1,281 additions & 1,259 deletions minihawk/Scenario-02/extracted_11/_target_pose.csv

Large diffs are not rendered by default.

846 changes: 846 additions & 0 deletions minihawk/Scenario-02/extracted_12/_minihawk_pose.csv

Large diffs are not rendered by default.

1,260 changes: 1,260 additions & 0 deletions minihawk/Scenario-02/extracted_12/_target_pose.csv

Large diffs are not rendered by default.

868 changes: 0 additions & 868 deletions minihawk/Scenario-02/extracted_4/_minihawk_pose.csv

This file was deleted.

1,288 changes: 0 additions & 1,288 deletions minihawk/Scenario-02/extracted_4/_target_pose.csv

This file was deleted.

1,706 changes: 867 additions & 839 deletions minihawk/Scenario-02/extracted_5/_minihawk_pose.csv

Large diffs are not rendered by default.

2,540 changes: 1,287 additions & 1,253 deletions minihawk/Scenario-02/extracted_5/_target_pose.csv

Large diffs are not rendered by default.

1,616 changes: 839 additions & 777 deletions minihawk/Scenario-02/extracted_6/_minihawk_pose.csv

Large diffs are not rendered by default.

2,429 changes: 1,253 additions & 1,176 deletions minihawk/Scenario-02/extracted_6/_target_pose.csv

Large diffs are not rendered by default.

1,621 changes: 777 additions & 844 deletions minihawk/Scenario-02/extracted_7/_minihawk_pose.csv

Large diffs are not rendered by default.

2,433 changes: 1,176 additions & 1,257 deletions minihawk/Scenario-02/extracted_7/_target_pose.csv

Large diffs are not rendered by default.

1,661 changes: 844 additions & 817 deletions minihawk/Scenario-02/extracted_8/_minihawk_pose.csv

Large diffs are not rendered by default.

2,483 changes: 1,257 additions & 1,226 deletions minihawk/Scenario-02/extracted_8/_target_pose.csv

Large diffs are not rendered by default.

1,594 changes: 817 additions & 777 deletions minihawk/Scenario-02/extracted_9/_minihawk_pose.csv

Large diffs are not rendered by default.

2,400 changes: 1,226 additions & 1,174 deletions minihawk/Scenario-02/extracted_9/_target_pose.csv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

203 changes: 203 additions & 0 deletions minihawk/Scenario-03_Route-Behind-GUAM_Detected-Pads/vnv_scitech.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
# Global
loglevel: DEBUG # One of ["TRACE", "DEBUG", "INFO", "SUCCESS", "WARNING", "ERROR", "CRITICAL"]

# The topics recorded are defined in sim_control/script/node_recorder.py
# Final rosbag is in utils/tmp
record_rosbag: true
record_persistent: true

# Simulation modes
# simple: run the simulator and let it run until user stops it via ctrl+c
# integer value: run simulator for value number of iterations
simulation_mode: 6

landing_threshold: 3.5 # in meters

# Order of services here is also the order in which services are started
services:
carla:
include: services/carla.yml
env_sim:
include: services/env_sim.yml
# jaxguam:
# include: services/jaxguam.yml
minihawk:
include: services/minihawk.yml
ground_station:
include: services/ground_station.yml
yolov5:
include: services/yolov5.yml
sim_control:
include: services/sim_control.yml
# verifiable_od:
# include: services/verifiable_od.yml


# Test
map: Town02_Opt
spectator_follows_ego_vehicle: False

# Vehicle
ego_vehicle:
reference_topic: /target/pose
planner_topic: /target/waypoint
perception_vel_topic: /controller_node/vel_cmd
perception_control_topic: /controller_node/tgt_box_rcvd
# planner_topic: /controller_node/vel_cmd
planner:
type: a_star # One of ["simple", "a_star"]
distance_threshold: 3.5 # distance threshold to the current waypoint
speed_threshold: 1.0 # minimum speed required when moving between intermediate points
speed_check_time: 0.5 # time period in s to check the speed
# include: ego_vehicle/jaxguam.yml
include: ego_vehicle/minihawk.yml
debug: false
location:
x: -84
y: 75
z: 75
# x: -80
# y: 75
# z: 75
velocity:
x: 0
y: 0
z: 0

# Adversarial objects
adv_objects:
enabled: True # One of ["True", "False"]
objects:
- pose:
type: absolute # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
location:
x: -80
y: 75
z: 60
rotation:
roll: 0
pitch: 0
yaw: 0
velocity:
x: 0
y: 0
z: 0
model: uli_cora
# - pose:
# type: absolute # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
# location:
# x: -73
# y: 75
# z: 65
# rotation:
# roll: 0
# pitch: 0
# yaw: 0
# velocity:
# x: 0
# y: 0
# z: 0
# model: uli_cora
# - pose:
# type: relative # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
# location:
# x: -20
# y: -20
# z: 0
# rotation:
# roll: 0
# pitch: 0
# yaw: 180
# velocity:
# x: 0
# y: 0
# z: 0
# model: uli_cora
# - pose:
# type: relative # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
# location:
# x: -10
# y: -10
# z: -40
# rotation:
# roll: 0
# pitch: 0
# yaw: 180
# velocity:
# x: 0
# y: 0
# z: 0
# model: vehicle.bmw.grandtourer
# - pose:
# type: relative # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
# location:
# x: -4
# y: -28
# z: -45
# rotation:
# roll: 0
# pitch: 0
# yaw: 90
# velocity:
# x: 0
# y: 3
# z: 0
# model: vehicle.dodge.charger_police
# - pose:
# type: relative # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
# location:
# x: 7
# y: 7
# z: -25
# rotation:
# roll: 0
# pitch: 0
# yaw: 0
# velocity:
# x: 0
# y: 0
# z: 0
# model: vehicle.nissan.patrol
# - pose:
# type: relative # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
# location:
# x: -8
# y: 12
# z: -17
# rotation:
# roll: 0
# pitch: 0
# yaw: 0
# velocity:
# x: 0
# y: 0
# z: 0
# model: vehicle.tesla.cybertruck
# - pose:
# type: relative # One of ["absolute", "relative"]. If "relative", then relative to the starting pose of the ego vehicle.
# location:
# x: -20
# y: 15
# z: -34
# rotation:
# roll: 0
# pitch: 0
# yaw: 0
# velocity:
# x: 0
# y: 0
# z: 0
# model: vehicle.mercedes.sprinter

# Target point
target:
type: absolute # One of ["absolute", "relative"]. Absolute -- absolute in CARLA's global coordinate frame. Relative -- relative to the vehicle's starting location.
x: -80
y: 75
z: 30
# x: -45
# y: 35
# z: 0

optional_features:
include: optional_features/static_obstacles_record.yml
33 changes: 25 additions & 8 deletions minihawk/minihawk_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ def __init__(self, id, code=None, file_name=None, folder_name = './MiniHawk_Obst
output_dir = folder_name
self.traces_list = []
for i, name in enumerate(os.listdir(output_dir)):
if i==1:
continue
if name.startswith('extracted'):
df = pd.read_csv(os.path.join(output_dir, name, './_minihawk_pose.csv'))
self.traces_list.append(df)
self.decision_logic: ControllerIR = ControllerIR.empty()
self.process_traces()
self.internal_counter = 0

def process_traces(self):
min_trace_length = np.inf
Expand Down Expand Up @@ -69,7 +72,10 @@ def process_traces(self):
self.all_traces.append(trace)
self.all_traces = np.array(self.all_traces)

def TC_simulate(self, mode: List[str], initialCondition, time_bound, time_step, track_map: LaneMap = None) -> np.ndarray:
def generate_nominal_trace(self):
self.nominal_trace = np.mean(self.all_traces, axis=0)

def TC_simulate(self, mode: List[str], initialCondition, time_bound, time_step, track_map: LaneMap = None, idx = 0) -> np.ndarray:
'''
# time_bound = float(time_bound)
# number_points = int(np.ceil(time_bound/time_step))
Expand All @@ -87,12 +93,23 @@ def TC_simulate(self, mode: List[str], initialCondition, time_bound, time_step,
'''
# pass
steps = int(time_bound/time_step)
initial_condition = np.array(initialCondition)
all_inits = self.all_traces[:,0,1:]
dists = np.linalg.norm(all_inits - initial_condition, axis=1)
trace_idx = np.argmin(dists)
# init = initialCondition
print(trace_idx, initialCondition, dists)
if idx == 0:
return self.nominal_trace[:steps,:4]
else:
# if self.internal_counter == 0:
# initial_condition = np.array(initialCondition)
# all_inits = self.all_traces[:,0,1:]
# dists = np.linalg.norm(all_inits - initial_condition, axis=1)
# trace_idx = np.argmin(dists)
# init = initialCondition
# print(trace_idx, initialCondition, dists)
# self.nominal_idx = trace_idx
# self.internal_counter += 1
# else:
if idx >= self.all_traces.shape[0]:
idx = idx%self.all_traces.shape[0]
trace_idx = idx
# self.internal_counter += 1

# time_bound = float(time_bound)
# num_points = int(np.ceil(time_bound / time_step))
Expand All @@ -109,7 +126,7 @@ def TC_simulate(self, mode: List[str], initialCondition, time_bound, time_step,
# # init[3] = 0
# trace[i + 1, 0] = time_step * (i + 1)
# trace[i + 1, 1:] = init
return self.all_traces[trace_idx,:steps,:]
return self.all_traces[trace_idx,:steps,:4]

if __name__ == "__main__":
agent = MiniHawkAgent('a')
Loading

0 comments on commit b2d9568

Please sign in to comment.