Skip to content

Conversation

@kensukenk
Copy link

multi-timestep collision avoidance and storing the value function at every timestep

multi-timestep collision avoidance and storing the value function at every timestep
Copy link
Collaborator

@buinm buinm left a 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:
Copy link
Collaborator

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)
Copy link
Collaborator

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]
Copy link
Collaborator

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants