-
Notifications
You must be signed in to change notification settings - Fork 6
ROS Bot API Documentation
Print the value to the dashboard console, should be used in place of python default print. Can be used for debugging purposes, does not have the default attributes of the python print function
Parameters:
-
value(str): String to be printed, any other datatype must be typecasted to str. Incase of other datatypes, it will be typecasted by default, resulting in unexpected print outputs
Warning
print() tty outputs will not be visible on the dashboard console, and script will not be executed if print is used
Sets the speed of the motors.
Parameters:
-
right_speed(int): Speed of the right motor, between -100 and 100. -
left_speed(int): Speed of the left motor, between -100 and 100.
Returns:
-
bool: True if the speed is set successfully, False otherwise.
Description
- Negative speed for reverse motion
- Zero for stop
- Positive speed for forward motion
Gets the current speed of the motors.
Returns:
-
right_speed(int): Speed of the right motor, between -100 and 100. -
left_speed(int): Speed of the left motor, between -100 and 100.
Description
- Negative speed for reverse motion
- Zero for stop
- Positive speed for forward motion
Gets the distance to the obstacle using the IR sensor.
Returns:
-
distance(float): Distance to the nearest obstacle in cm.
Gets the color values of the sensor array.
Returns:
-
color([bool, bool, bool, bool, bool]): Ground color, where True represents white and False represents black.
Starts the encoder pulse counting.
Caution
Calling this function twice will reset the counter.
Returns:
-
bool: Success or failure of starting the encoder pulse counting.
Warning
Count reliable until
Stops the encoder pulse counting and resets the counter value.
Returns:
-
bool: Success or failure of stopping the encoder pulse counting.
Gets the encoder pulse count.
Returns:
-
count(int): Encoder pulse count.
Warning
Count reliable until
User code must ping the host once every 10 seconds to reset the watchdog. User program will be terminated when the watchdog resets on reaching 10 seconds.
Warning
Your program has to keep calling this function repteadly in a loop in between your code & logic to ensure it's running, once every ~8 seconds, to ensure program doesn't terminate due to minor delay in function calls.