-
Notifications
You must be signed in to change notification settings - Fork 1
Robot
This is the central class which manages and uses all the other components of the robot. The parameters are defined in config.py
This abstracted driving function is only called locally by the other functions with better names. It accelerates and decelerates to make driving more natural. Do not call directly!
This abstracted driving function is only called locally by the other functions with better names. It sets the speed immediately. Do not call directly!
Sets the new speed immediately. Doesn't change the driving mode of the robot. :param s: the speed you want to set.
Sets the new speed and accelerates and decelerates. Doesn't change the driving mode of the robot. :param s: the speed you want to set.
Sets the direction of the robot. True means forward. :param f: True for forwards and False for backwards.
Spin right indefinitely.
Spin left indefinitely.
This turns the robot to the right without it spinning on the spot. Each call makes the turn steeper.
This turns the robot to the right without it spinning on the spot. Each call makes the turn steeper.
With Meccanum wheels the robot goes sideways to the left.
With Meccanum wheels the robot goes sideways to the right.
This turns the robot right or left. Is mostly used by the remote control. :param turn: positive or negative value. Higher values mean steeper turn.
Lets the robot go straight on. Usually called when a turn shall end.
This spins until the distance to an obstacle is greater than the given parameter distance. :param distance: The distance
Toggle turn for the given duration. With each call the opposite direction(clockwise / anti-clockwise) is used. :param d: The duration for the turn in milliseconds.
Randomly turn for the given duration. :param d: The duration for the turn in milliseconds.
Stop the robot slowly by deceleration.
Stop the robot immediately.
If implemented this method is called when the IR-sensor has detected a change. Fill in your code accordingly.
Get the distance from the ultrasonic sensor.
If implemented, turn the servo motor with the ultrasonic sensor to the given angle. :param a: The angle that is to be set.
This returns the angle of the ultrasonic sensor where it measured the smallest distance
This returns the angle of the ultrasonic sensor where it measured the longest distance