google-deepmind / dm_robotics

Libraries, tools and tasks created and used at DeepMind Robotics.
Apache License 2.0
332 stars 32 forks source link

Direct Velocity or Position Control #8

Closed ava6969 closed 2 years ago

ava6969 commented 2 years ago

iS IT POSSIBLE TO BYPASS THE CARTESIAN CONTROLLER AND CONTROL IN JOINT SPACE DIRECTLY.

shacklestone commented 2 years ago

Yes.

Environments typically start with joint control, Cartesian control is added on top of that.

For example, in RGB stacking, we start with a joint velocity controller, then a 6-DoF cartesian controller is made that delegates to the joint controller, finally, a 4-DoF cartesian controller is created that delegates to the 6-DoF cartesian controller.

The 4-DoF controller is exposed to the agent by setting it as the arm_effector in the StandardRobot initializer.

If you want to change your action space, change this effector. You could use a joint velocity controller or create your own effector (E.g. a PD based position controller) the api is mainly action_spec (input names and ranges) and set_control which decides how actions are interpreted,

shacklestone commented 2 years ago

Also note, you can use create your own ActionSpace if you want to change actions without using an effector. But since the choice between cartesian vs joint space control is made by effector choice (for RGB stacking) that would be the place to start for that task.

ActionSpaces are widely employed for things like casting actions to be of the same type, clipping or limiting action values, changing the control frame and others

ava6969 commented 2 years ago

wow, beautiful interface, what do you advice with respect to reducing the substeps. if i use the direct velocity control. i don't expect to have to need 100 substeps, as must suite i used in the past works well even for 4 substeps.

ava6969 commented 2 years ago

wow, beautiful interface, what do you advice with respect to reducing the substeps. if i use the direct velocity control. i don't expect to have to need 100 substeps, as must suite i used in the past works well even for 4 substeps.

@shacklestone

josechenf commented 2 years ago

Sorry, could you elaborate what you mean by substeps? Do you mean the control rate?

ava6969 commented 2 years ago

yes so adjusting the control timeteps and physics timesteps. if i adjust it to reduce the substeos. so to make CONTROL_TIMESTEPS/PHYSICS_TIMESTEP smaller.

josechenf commented 2 years ago

Here is what you can achieve:

ava6969 commented 2 years ago

Thank you