google-deepmind / lab

A customisable 3D platform for agent-based AI research
Other
7.11k stars 1.37k forks source link

Agent movement only in a plane #70

Closed skruzic closed 6 years ago

skruzic commented 7 years ago

Hi, I'd like to change random agent example to imitate mobile robot, i.e. no jumping, looking up-down and no lateral movement. Is there a way to do it?

Thanks!

ghost commented 7 years ago

If you check the docs, the action vector specifies a different action type at each index (look left/right, look down/up, strafe left/right, move back/forward, fire, jump, crouch).

It seems like you'd want to always supply zeros for indices 1 (look up/down), 2 (lateral movement), and 5 (jump)- probably also 4 (fire, unless you're building a really cool mobile robot) and 6 (crouch, again unless you're building a really interesting mobile robot with that capacity).

In the code for the random agent, you'll see that there's a predefined set of actions (line 36) that contains all the actions that are possible for the random agent. In line 54, the random agent just (randomly) chooses an action from that list.

So from what I can tell from this cursory look, all you'd need to do is modify the ACTIONS dictionary (lines 36-48) to only include the actions you'd want to be possible. Just take out the lines with 'look_up', 'look_down', 'strafe_left', 'strafe_right', 'fire', 'jump', and 'crouch'.

If you want a more sophisticated representation of a mobile robot (i.e., one that doesn't choose its moves randomly), your best bet is to probably just write your own module that uses the DeepMind Lab Python API to perform whatever actions you need.

tkoeppe commented 6 years ago

@knyte's answer sounds good; please reopen if there's anything missing from the response.

tangbohu commented 6 years ago

I wonder how to rotate the robot?