From the series: Mission on Mars Robot Challenge
Olivier Dufour, MathWorks
Overview of the initial algorithm that team members are asked to optimize in the Mission on Mars Robot Challenge.
Hello, my name is Olivier from MathWorks. This video was recorded in the context of the 2016 Mission on Mars Robot Challenge and I will give you an overview of the current algorithm you will have to improve for the competition.
In the model, we will focus on InputProcessing subsystem which contains the robot control algorithm, and more precisely, Brain chart where all decisions are taken.
Let's start the simulation to follow the algorithm.
The default state "Explore" controls the robot in Speed mode: the variable Mode is set to SPEED meaning that we will set the robot speed in cm/s and angular speed in deg/s. If no obstacle is detected, the robot will move forward with a speed of 50 cm/s (and no rotation). There are also 2 types of obstacle detection. Obstacle avoidance means that there is an obstacle in front of the robot, so the robot stops (speed = 0) and an angular velocity of 30 deg/s is applied until obstacle avoidance is accomplished. Obstacle correction means that there is an obstacle on one side of the robot, in this case the robot slows down (speed = 30 cm/s) and an angular speed of 50 deg/s is applied. You can see that angular speed is calculated using "correction sign", this variable give the information about the preferred side to turn according to obstacle position.
Robot stays in Explore state as long as no site is detected by the camera. When site distance is different from 0, meaning that the camera is detecting something, current state changes to TargetInView where site distance and angle is calculated based on camera information (Distance and Bearing variables). In this mode, robot speed is reduced and angle speed is set accordingly to camera data. There are 2 possibilities to go out from this TargetInView state: either site is out of view so robot comes back to Explore state or the distance to target is lower than 35 cm and GoToTarget becomes the current state.
When distance becomes too small (under 35 cm in this case), the camera is no more able to see the site. The command mode is changed to DISTANCE and use the last calculated values for distance and angle to reach the site.
Finally, the remaining distance calculated by the robot is used to identify when the target is reached and to switch to "Wait for scoring" state where all robot movements are stopped. After 3 seconds, the robot goes back to Explore state.
This is the end of this short introduction to the robot algorithm, I hope that it will help you to have a better understanding about how the robot works. Feel free to add/remove/modify elements on this existing base and take advantage of simulation to build a robust and efficient algorithm.