If you are a Coventry student that is interested in joining the FSAI team then this repo is intended to supply you with the tools you need to get our attention.
Easiest way to get on the team is to show us what you've got. Do something with these files and then show us what you've come up with. For example:
- Computer vision - cone recogition
- Performance boost - faster controller code
- Simulation - improved simulated environments
- Control code - get the vehicle driving round the tracks
- Motion planning - racing lines etc
- ROS - the real vehicle runs is controlled by a ROS system but this has a steep learning curve, probably best to join the team first
This project contains example worlds and controllers for the FSAI vehicle. These files are structured so that they can be used either directly within Webots or as a ROS package.
These files were tested and working with Webots 2020b Revision 1.
This repo contains a number of basic simulated worlds representing the FSAI competition events:
- acceleration.wbt
- endurance.wbt
- fig8.wbt
- training_data.wbt - Containing a modified vehicle to aid in the generation of training data for ML models.
The project contains two example webots controllers for use with the acceleration world.
- example (python)
- examplecpp (c++)
Simulating worlds is a computationally expensive process. There are trade offs to be made between accuracy and time.
If you are having difficulty running the simulations you can try setting the following:
- Increase value of
basicTimeStep
attribute ofWorldInfo
. - Set
bodyShell
attribute ofCoventryVehicle
toFALSE
.
To increase the accuracy of your simulations, for example if you are getting inconsistent results between simulations.
- Decrease value of
basicTimeStep
attribute ofWorldInfo
. - Set
optimalThreadCount
to 1 inWorldInfo
- Enable
synchronization
inCoventryVehicle
Read the Webots documentation for a full examplation of these options.
Both controllers function in the same way, this is a relatively poor controller design that is unlikely to function correctly in the real world. It only functions in the simulation due to the minimalist nature of the simulated worlds and unrealistically high quality sensor data that is generated. They are, however, useful examples for getting started.
-
The contollers function buy getting the depth image from the Zedcam mounted on the vehicle.
-
The pixels of the depth image are checked to identify the edge of objects. For a given pixel (x,y) is seen as the edge of an object if the distance to the pixel (x,y-1) is at least 0.5 meters further than the distance to pixel (x,y). The assumption is that these pixels all represent points of cones in the environment.
-
The x, y and z coordinates of the edge pixels in the real world (local coordinated frame), are calculated. The example controllers include code to visualise these points within Webots from a top down viewpoint.
-
The coordinates of the points on the left and right hand side of the vehicle are averaged seperately.
-
A point half way between the left and right averages is used as the position to steer towards.
This repo is structured so that it can be used within a catkin workspace. Example ROS nodes have been provided that operate according the the same design detailed above. However, the controller has been split into two nodes so as to allow for better visualisation of the data.
- example_see (which identifies the edge pixels and calculates coordiates)
- example_steer (which calculates the left and right averages and the steering angle)
If getting started in ROS you would be better off using this repository which contains this repo as a submodule but also includes additional ROS files showing how to run the project.
When using ROS you also need to remember to change the Webots controller to ros_automobile
and (at a minimum) controller arg --name=fsai
.