[Feature] Actions detached from physics and allow any number of actions #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New features
agent.action.u(which before corresponed toagent.state.force) are now detached from the physics. Dynamics will read actions and write intoagent.state.forceandagent.state.torque. This allows users to play around with action sizes and new dynamics more flexibly.Agent(dynamics=Holonomic())is the default). There are many available (Holonomic,HolonomicWithRotation,DiffDrive,KinematicBicycle)Agent(action_size=3). But you have to provide at least the minimum number of actions required by the dynamics(dynamics.needed_action_size). The dynamics will use the firstdynamics.needed_action_sizeactions and the rest can be used for other user needsagent.action_sizeaction. By default the holonomic agent has 2 actions: force_x (with 3 options stay,decrement,increment) and force_y (with 3 options stay,decrement,increment). Holonomic agent with rotations have 3 actions, with the additional one controlling torque (with the 3 options stay, decrement, increment). And so on for other dynamics....u_range,u_multiplierandu_noise. These can either be a scalar or a list. In case of a list, the list must have lengthagent.action_sizeBC-BREAKING Changes
u_rot_range,u_rot_multiplierin favor of a more generalu_range,u_multiplierandu_noisewhich can be a list (one elem per action )Multidiscrete([action_1_size, action_2_size]), now there is a spaceDIscrete(action_1_size * action_2_size). It is still possible to ask MultiDIscrete action spaces by settingvmas.make_env(multidiscrete_actions=True)FIxes #51
Fixes #75
cc @Jianye-Xu @Zartris