Robots and the world


class robot.RealBot(pose, color=0)

This type of robots implements communication with a real-world robot.

Although this is a SimObject, it doesn’t move by itself. Use set_pose() to move the robot.


Stops the robot, saving the state


Restarts the robot from the saved state


Initiate communication with the real robot and get state info back.

class robot.Robot(pose, color=0)[source]

The robot is a SimObject that implements drawing and information functions to interface with supervisor.

This class is not intended to be subclassed in user code. Use one of the provided subclasses instead: SimBot for emulated robots or RealBot for physical robots.


Draw the sensors that this robot has


Return the robot information structure, including sensor readings and shape information


Set drive inputs in the format needed by this robot

class robot.SimBot(pose, color=0)

The robot defined by this class is a simulated robot, and implements its own motion in move().

To implement a new type of robot, subclass SimBot and implement get_info() and get_external_sensors().

To make your robot move, implement move().

To make you robot controllable, implement set_inputs().

If your robot has sensors that can be drawn in the view, implement draw_sensors().


Get the external sensors of the robot as a list. This function is used to update the sensor readings in proximity sensors.


Move the robot for a time interval dt.

Interaction between the robot and the supervisor

The simulator can run with any robot and any supervisor, as long as they implement the necessary methods in the Robot and Supervisor base classes. However, not any supervisor can work with any robot. Specifically, the supervisor has to correctly use the output of robot.Robot.get_info() and supply the correct input to robot.Robot.set_inputs().

When the simulation is run, the supervisor does not have a direct access to the robot. All the information that the supervisor can get, is the output of get_info(). It is important when implementing a robot to put all the necessary information about the robot into this structure. This includes the sensor readings and the geometry of the robot.

The only way that the supervisor can influence the robot, is through the set_inputs() method. The supervisor has to produce the correct output from its execute() method. This output will be fed to the robot at the end of the cycle.


class sensor.Sensor[source]

Base superclass for sensor objects

classmethod add_gauss_noise(value, sigma)[source]

Returns the value with an added normal noise

The return value is normally distributed around value with a standard deviation sigma

class sensor.MountedSensor(pose, parent)[source]

A sensor that moves together with its parent object.

The sensor is assumed to be attached to parent at pose in local coordinates.


Get the pose of the sensor in the parent (robot) coordinates.

class sensor.ProximitySensor(pose, robot, geometry)[source]

Create a proximity sensor mounted on robot at pose. The geometry is a (rmin, rmax, angle) tuple.


Return the envelope of the sensor


Returns the distance to the value using sensor calculations


Returns the distance instance


Returns the reading value


updates all the distances from the reading


draws the sensor simobject


Gets the distance to another simobject returns distance in meters or None if not in contact

Table Of Contents

Previous topic


Next topic

Supervisor/Controller system

This Page