Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

long maneuvers https://github.com/commaai/openpilot/issues/26778 #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ntegan1
Copy link
Owner

@ntegan1 ntegan1 commented Dec 13, 2022

newish notes/ideas

maybe add options for constant accel control and constant velocity control, and a blend of both

good idea would probably be to filll a long_plan with speeds, times, accels from maneuver
speeds, accels, jerks
what do do about jerks

looks like jerks dont quite matter.
start with basic accels as derivative of speed graph
reset LoC at beginning

oldish notes

TODO: this is just for velocity.

but i used to set cruisestate speed to 0 and such, it was pretty responsive.

maybe start out with that and add acceleration stuff later

because right now, responsiveness to maneuver change in velocity is at the mercy of chill mode planning? (e2e is happy to keep barreling down at 60mph after you set speed to 10mph)

need to feeed desired vel directly into pid controller or somethign.
?closer to joystick code
?maybe in longcontrol.py vtarget upper lower stuff instead of long planner

@ntegan1
Copy link
Owner Author

ntegan1 commented Dec 13, 2022

comma@tici:/data/openpilot/tools$ ./joystick/maneuver/__init__.py 
{'name': 'first test maneuver', 'duration': 14, 'should_interpolate': False, 'velocity_unit': 'mph', 'points': [[0, 0], [5, 10], [8, 10], [12, 2], [14, 0]]}
plot points[(0,0),(5,10),(8,10),(12,2),(14,0)]

image

Comment on lines +58 to +63
def set_finished(self):
self.maneuvering = False
self.maneuver = None
def request_maneuver_start(self, maneuver):
self.maneuver = maneuver
self.maneuvering = True
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code

def available_maneuver_files():
all_files = os.listdir(maneuvers_directory)
files = [f for f in all_files if f[f.rfind(".")+1:] == "json"]
return files
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead

return bool(buf[0])
def maneuver_num(self):
return buf[1]
def maneuver_request(self, maneuver_num):
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe allow requesting diff maneuver during another one

def update(self, vcruise):
should_start_maneuver = not self.maneuvering and self.mem.maneuver_requested()
if not self.maneuvering and not should_start_maneuver:
return vcruise
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save manuver number and restart the thing if changes

@ntegan1
Copy link
Owner Author

ntegan1 commented Dec 16, 2022

testing some of the a target stuff on opsetspeed branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants