Skip to content
Snippets Groups Projects
Commit 2ce48fb6 authored by chsieh16's avatar chsieh16
Browse files

Fix bug on agbot teacher and config

parent 7fcaf2ba
No related branches found
No related tags found
No related merge requests found
......@@ -123,10 +123,8 @@ class DTreeAgBotStanleyGurobiTeacher(DTreeGurobiTeacherBase):
sin_yaw = m.addVar(name="sinθ", **self.TRIGVAR)
m.addGenConstrSin(old_yaw, sin_yaw)
new_x = old_x + FORWARD_VEL * CYCLE_TIME * cos_yaw
new_y = m.addVar(name="y'", **self.FREEVAR)
m.addConstr(new_x == old_x + FORWARD_VEL * CYCLE_TIME * cos_yaw)
m.addConstr(new_y == old_y + FORWARD_VEL * CYCLE_TIME * sin_yaw)
new_yaw = m.addVar(name="θ'", **self.FREEVAR)
m.addConstr(new_yaw == old_yaw + ang_vel * CYCLE_TIME)
m.update()
......
......@@ -60,7 +60,7 @@ def main(dom: Literal["concat", "diff"], ult_bound: float):
NUM_MAX_ITER = 500
FEATURE_DOMAIN = dom
ULT_BOUND = ult_bound
NORM_ORD = 1
NORM_ORD = 2
teacher = DTreeAgBotStanleyGurobiTeacher(norm_ord=NORM_ORD, ultimate_bound=ULT_BOUND)
part_to_examples = load_examples_from_numpy_array(data_5d, teacher, PARTITION)
......@@ -104,7 +104,16 @@ if __name__ == "__main__":
# NOTE To ensure safety (Stay in corn row),
# ult_bound should be smaller than 33/32 = 1.03125
from dtree_synth_gem_stanley import clean_out_dir
# main("diff", 0.0)
# main("diff", 1.03125)
# clean_out_dir("out-agbot-stability-diff-ult_bound=0.0")
# main("diff", 1.0)
# clean_out_dir("out-agbot-stability-diff-ult_bound=1.0")
# main("concat", 0.0)
main("concat", 1.03125)
# clean_out_dir("out-agbot-stability-concat-ult_bound=0.0")
main("concat", 1.0)
clean_out_dir("out-agbot-stability-concat-ult_bound=1.0")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment