mlpy.environments.nao.Webots

class mlpy.environments.nao.Webots(port=12345, agents=None)[source]

Bases: mlpy.environments.Environment

Simulated environment using the Webots simulator.

The Webots environment works in conjunction with a controller specified for a supervisor. A sample controller can be found in webots/controllers/serverc. This controller listens on port 12345 for the following events:

request reset
Requests an environment reset from the controller.
check goal
Requests from the controller a check whether a goal was scored or not. The result of that check is send back to the client.
Parameters:

port : int, optional

The port the controller listens to. If using the environment in conjunction with controller serverc the port number is 12345. Default is 12345.

agents : Agent or list[Agent], optional

A list of agents that act in the environment.

Notes

When requested to reset, the environment will request to reset the simulated environment in Webots from the controller. It is also possible to check if a goal was scored by calling the function check_data with the argument ‘check goal’. This sends a request to the controller to check if a goal was scored.

Attention

The Webots environment class requires the NAOqi API from Aldebaran be installed on your machine. A separate license is required for the API.

Attributes

mid The module’s unique identifier.

Methods

add_agents(agent) Add an agent to the environment.
check_data(value) Request to check for data.
enter(t) Enter the environment and all agents.
exit() Exit the environment and all agents.
get_agent(mid) Return the agent specified by the id.
is_complete() Checks if the environment has completed.
load(filename) Load the state of the module from file.
reset(t, **kwargs) Reset the environment and all agents.
save(filename) Save the current state of the module to file.
update(dt) Update the environment and all agents.