uwgraphics / relaxed_ik

RelaxedIK Solver
MIT License
175 stars 50 forks source link

change weights for objectives dynamically #10

Closed furushchev closed 5 years ago

furushchev commented 5 years ago

Hello, I tried this cool library and have a question. The weights for each objectives are now statically set here: https://github.com/uwgraphics/relaxed_ik/blob/master/src/RelaxedIK/GROOVE_RelaxedIK/relaxedIK_vars.py#L32

Can we change these parameters dynamically or do I have to restart the node with new parameters when we want to change them?

Thank you very much in advance!

djrakita commented 5 years ago

Thanks for the question! Yes, these values are able to be changed dynamically. In fact, this is a trick that we used in order to change the relative importance of certain terms on the fly in prior work (http://pages.cs.wisc.edu/~rakita/wp-content/uploads/2017/12/hri17-preprint.pdf)

The key to doing this well is to make sure that the dynamically changing term weights are varying SMOOTHLY. For example, changing a weight from 1.0 to 0.0 on subsequent updates probably won't work very well, but smoothly transitioning from 1.0 to 0.0 over a sequence of updates will be more effective. In the future, we'd like to incorporate these features into the code to be used automatically; however, for the time being, it's relatively straight forward to change the weights manually to match anybody's respective applications.

furushchev commented 5 years ago

@djrakita Thank you very much for rapid answer and tricks to work it good. I'm now trying the behavior and I'll report the question if it raises!