-
Notifications
You must be signed in to change notification settings - Fork 112
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
Interface for Environment and Control #37
Comments
Comment by tp5uiuc It would be good if figure out the Controller interface here. For the Environments, you can take a look at Elastica++, we have a collision-detection system that handles friction for example. |
Would the Also, are you still planning to implement this feature? If yes, what time frame are you expecting? |
I will make a first proposal / attempt for the
class CustomController(BaseController):
def __init__(self, systems: Dict[str, SystemType], step_skip: int, *args, **kwargs):
super().__init__(systems=systems, step_skip=step_skip, *args, **kwargs)
def apply_forces(self, systems: Dict[str, SystemType], time: float):
for system_name, system in systems.items():
system.external_forces += np.ones(shape=system.external_forces.shape)
def apply_torques(self, systems: Dict[str, SystemType], time: float):
for system_name, system in systems.items():
system.external_torques += np.ones(shape=system.external_torques.shape) where simulator.control(CustomController, systems={"rod1": rod1, "rod2": rod2, "cylinder1": cylinder1}, step_skip=1000) The controller can be run at a lower frequency (e.g. bigger |
Hi @mstoelzle Currently we don't have man power to pursue this issue, but it is something we wanted to have in We faced the same issues before some other project, where we were coupling Method you suggested can also be included in |
@armantekinalp Thank you for your answer and for your referral to the RL project. In case I decide to implement this functionality, I will try to merge it back to Small correction for the desired control syntax to get it more in line with the usual simulator.control(
systems={"rod1": rod1, "rod2": rod2, "cylinder1": cylinder1}
).using(CustomController, step_skip=1000) |
@mstoelzle sounds good. Let me know if you need anything. |
Issue by skim0119
Sunday Dec 12, 2021 at 19:05 GMT
Originally opened as https://github.com/GazzolaLab/elastica-python/issues/86
From @tp5uiuc
I'm porting only the
Environment
andController
interfaces here, as the rest are already in-place. An additional reason is that its not quite clear what needs to go into theEnvironment
(slender-body theory is one, friction is another...), and what the interface for aController
is going to be.This is a WIP, so feel free to propose any changes as you see fit. Things yet to do:
Environment
mixin interface : add environment effects (fluids, friction etc, needs PR from some other branch, I'll only provide the interface)Environment
Controller
mixin interface : interface for attaching arbitrary controllers (once again needs a different PR)Controller
It'll be nice to eventually have a time-varying environment, itself governed by an independent system (say, governed by a PDE). The example I have in mind is a chemical source placed at some position in the free-space—it releases chemical concentration based on some simple diffusion law. We can make our arms "sense" this concentration.
The text was updated successfully, but these errors were encountered: