-
Notifications
You must be signed in to change notification settings - Fork 43
Update solver.py #14
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
base: master
Are you sure you want to change the base?
Update solver.py #14
Conversation
multi-timestep collision avoidance and storing the value function at every timestep
buinm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Ken,
Thank you for making the changes, these changes will be very useful for us going forward. There are just some comments over some of your changes, please let have a look at them and let me know if there are anything concerning you.
|
|
||
|
|
||
| # saving value function at each timestep | ||
| if grid.dims == 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be shorter to do the following:
valfuns = np.zeros(np.insert(tuple(grid.pts_each_dim), grid.dims, len(tau)))
valfuns[..., -1 ] = V_0.asnumpy()
| if "TargetSetMode" in compMethod: | ||
| if compMethod["TargetSetMode"] == "max": | ||
| tmp_val = np.maximum(V_0.asnumpy(), constraint) | ||
| tmp_val = np.maximum(V_0.asnumpy(), -constraint_i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to keep it as constraint. The negate operation on the constraint value array should just be done by users before passing in the variables to HJSolver function call
| t_minh= hcl.asarray(np.array((tNow, tau[i]))) | ||
| # taking obstacle at each timestep | ||
| if "TargetSetMode" in compMethod and constraint_dim > grid.dims: | ||
| constraint_i = constraint[...,i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a bit too many indentations for the constraint_i = constraint[...,i]
multi-timestep collision avoidance and storing the value function at every timestep