Here is a reveal and explanation of Vex U team WPI1’s completely autonomous robot that we competed at worlds with. We did about as well as we had hoped, winning one match and being competitive in around five others. Thanks to all the people that came up to our pits asking questions or taking a picture with us after a match. I was happy to see that people are interested in advanced programming and liked the idea of a robot driving itself. I can certainly say that I much preferred the robot drive itself, it makes for a much more relaxed match!
We have made all of the code public and put it into an organization on GitHub: https://github.com/Team-Optimistic
There are five repos, four of them (robot_driver, goat_lidar_merging, motion_path_creator, and xv_11_laser_driver) run on our Raspberry Pi and the other one (Team-Optimistic) runs on our Cortex. Here is a short explanation of what each one does:
Team_Optimistic
This is the only one that runs on the Cortex. We are using the latest RobotC with my library BCI. This code handles communications with the raspi, closed-loop control for all the motors, navigating to points specified in the field frame, and picking up objects at points in the field frame.
robot_driver
This is the main ROS node running on the raspi. Its primary job is to handle comms with the cortex, but it also publishes ROS messages to the EKF node and our other nodes.
goat_lidar_merging
This node (GOAT) collects LIDAR messages from XV and runs a PCL clustering algorithm on that data. It publishes two lists of big and small objects to MPC.
motion_path_creator
This node (MPC) accepts lists of objects from GOAT and our estimated state vector from the EKF and determines the best object(s) to pick up next, then publishes this path to robot_driver.
xv_11_laser_driver
This node (XV) interfaces at a low level with our Neato LIDAR. It accepts incoming packets over a serial connection and constructs them into a ROS LaserScan message which we can transform into different frames.
There is too much code here for me to give a detailed rundown of each function and all the control flow. Please post questions down below, as specific or not as you want and I will try to answer them as best I can.