Lua Scripting for FRC Robots
LuaBot enables you to program FRC robots using LuaJIT, providing full access to WPILib's HAL, command-based framework, and simulation capabilities.
Add the LuaBot vendordep to your robot project:
Vendor Dependency URL:
https://maven.luabot.org/LuaBot.json
Ctrl+Shift+P (or Cmd+Shift+P on macOS)local class = require('luabot.class')
local TimedRobot = require('wpi.frc.TimedRobot')
local XboxController = require('wpi.frc.XboxController')
local MyRobot = class (TimedRobot)
function MyRobot:robotInit()
self.controller = XboxController.new(0)
end
function MyRobot:teleopPeriodic()
local speed = self.controller:getLeftY()
-- Drive code here
end
return MyRobot