Skip to main content

The Simulated Robot

The simulator contains a pre-built robot model that can be controlled using the sbot library. The robot is a differential drive robot with a camera and a variety of sensors.

Simulated Robot

Attached Boards

The robot has a number of boards attached to it that can be interacted with using the sbot library. These boards include:

  • Power Board (serial number: PWR)
  • Motor Board (serial number: MOT)
    • The left wheel is connected to motor 0.
    • The right wheel is connected to motor 1.
  • Servo Board (serial number: SERVO)
    • No servos are attached to the simulated robot.
  • Arduino Board (serial number: Arduino1)
    • The attached sensors are covered in the Sensors section.
  • Camera (serial number: Camera)
  • LED Board - equivalent to the Brain Board on the real robot (serial number: LED)

Attached Sensors

info

The simulated sensors are not perfectly accurate and have artificial noise included to more closely reflect reality.

All sensors are attached to the Arduino board and can be accessed using the Arduino API.

SensorConnected PinDescription
Front Ultrasound SensorTrigger: 2
Echo: 3
Measures distance from the front of the robot
Left Ultrasound SensorTrigger: 4
Echo: 5
Measures distance from the left of the robot
Right Ultrasound SensorTrigger: 6
Echo: 7
Measures distance from the right of the robot
Back Ultrasound SensorTrigger: 8
Echo: 9
Measures distance from the back of the robot
Front Left Microswitch10Detects if the front left of the robot has bumped into something
Front Right Microswitch11Detects if the front right of the robot has bumped into something
Rear Left Microswitch12Detects if the rear left of the robot has bumped into something
Rear Right Microswitch13Detects if the rear right of the robot has bumped into something
Left Reflectance SensorA0Measures the reflectance of the surface under the left side of the robot
Center Reflectance SensorA1Measures the reflectance of the surface under the center of the robot
Right Reflectance SensorA2Measures the reflectance of the surface under the right side of the robot

Ultrasound Sensors

These are the simulated version of ultrasound sensors.

They return the distance to the nearest object in front of the sensor in a narrow cone of view. Objects beyond 4 meters are not detected.

The robot has four ultrasound sensors attached to it, one on each side of the robot. They can all be accessed using the Arduino API's ultrasound interface.

info

Since these sensors rely on echoes being reflected back from objects, if the angle of incidence between the sensor's pulse and the contacted surface exceeds 22.5 degrees then the sensor will be unable to detect the object.

These appear as a blue board with two silver cylinders on the robot model. The returned distance is measured from the blue board in the direction of the silver cylinders.

Ultrasound Sensors

Reflectance Sensors

Across the bottom of the robot, there are three reflectance sensors that can detect differences in the colour of the surface under the robot. This is achieved by returning the relative red content of the surface directly below the sensor.

The measured values can then be read using the Analog Input interface. This is returned as a voltage between 0 and 5 volts, with lower values indicating a darker surface.

These appear as blue rectangles on the robot model.

Reflectance Sensors

Microswitches

On the front and back of the robot, there are microswitches that can detect if the robot has bumped into something. These appear as red cuboids on the robot model.

The attached pin will read True if the cuboid has intersected with any other object in the simulation.

LEDs

LEDs

The three rectangles on the back of the robot can have their colours set using the Pi LEDs interface.