Add time of flight controller firmware

The tof controller uses 2 lidar sensors to estimate the center of the held cone
in the end effector and communicates it back to the roborio over pwm so that
we can compensate.

This change also vendors in ST's library for the VL53L1X and adds a
platform specific i2c implementation for the raspberry pi pico.

Signed-off-by: Ravago Jones <ravagojones@gmail.com>
Change-Id: Id05c3b539df9c5a1ee4591e0abaf0a07df85674a
diff --git a/y2023/tof_controller/CMakeLists.txt b/y2023/tof_controller/CMakeLists.txt
new file mode 100644
index 0000000..58db271
--- /dev/null
+++ b/y2023/tof_controller/CMakeLists.txt
@@ -0,0 +1,50 @@
+
+cmake_minimum_required(VERSION 3.13)
+
+# initialize the SDK based on PICO_SDK_PATH
+# note: this must happen before project()
+
+#set(PICO_SDK_FETCH_FROM_GIT 1)
+set(PICO_SDK_PATH ../../../third_party/pico-sdk)
+set(PICO_TOOLCHAIN_PATH ../../external/gcc_arm_none_eabi/bin)
+
+include(../../third_party/pico-sdk/external/pico_sdk_import.cmake)
+
+project(tof_controller)
+
+# the root of the repository
+include_directories(../../)
+
+# initialize the Raspberry Pi Pico SDK
+pico_sdk_init()
+
+set(CMAKE_CXX_STANDARD 17)
+
+# rest of your project
+
+include_directories(../../external/vl53l1x_ultra_lite_driver_api)
+add_library(VL53L1X
+        ../../external/vl53l1x_ultra_lite_driver_api/platform/vl53l1_platform.h
+        ../../external/vl53l1x_ultra_lite_driver_api/platform/vl53l1_platform.c
+        ../../external/vl53l1x_ultra_lite_driver_api/platform/vl53l1_types.h
+        ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_api.c
+        ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_api.h
+        ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_calibration.h
+        ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_calibration.c)
+
+add_executable(tof_controller
+				tof_controller.cc
+				)
+
+# pull in common dependencies
+target_link_libraries(tof_controller VL53L1X)
+target_link_libraries(VL53L1X pico_stdlib hardware_i2c hardware_pwm)
+target_link_libraries(tof_controller pico_stdlib hardware_i2c)
+
+# enable usb output, disable uart output
+pico_enable_stdio_usb(tof_controller 1)
+pico_enable_stdio_uart(tof_controller 0)
+
+# create map/bin/hex/uf2 file etc.
+pico_add_extra_outputs(tof_controller)
+