OmniDrones
OmniDrones copied to clipboard
[Refactor] Better controller interface.
The current implementation of controllers as Transform
, though a good abstraction on top of MDPs, can be somehow inflexible in many cases. We would like to
- Make controllers as choices of action spaces.
- Manage controllers and parameters for different drone models through a registry/factory.
It would be something like:
from omni_drones.control import Controller
class MultirotorBase(RobotBase):
def __init__(.self, cfg):
...
self.controller = Controller.make(self, cfg)
self.action_spec = ... # define action_spec accordingly
def apply_action(self, actions):
actions = self.controller(self.state, actions)
...
This way, we will be able to use substeps:
class SomeEnv(IsaacEnv):
...
def _step(self, tensordict: TensorDictBase):
actions = tensordict[("agents", "action")]
for substep in range(self.substeps):
self.drone.apply_action(actions)
self.sim.step(...)
...