diff --git a/.github/workflows/pregenerate.yml b/.github/workflows/pregenerate.yml index c10b0bbe42..f7c9648986 100644 --- a/.github/workflows/pregenerate.yml +++ b/.github/workflows/pregenerate.yml @@ -27,6 +27,8 @@ jobs: python-version: 3.9 - name: Install jinja run: python -m pip install jinja2 + - name: Run hal + run: ./hal/generate_usage_reporting.py - name: Run ntcore run: ./ntcore/generate_topics.py - name: Run wpimath diff --git a/docs/build.gradle b/docs/build.gradle index 657198d7c2..c4be119e38 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -226,7 +226,6 @@ task generateJavaDocs(type: Javadoc) { options.addBooleanOption("Xdoclint:html,missing,reference,syntax", true) options.addBooleanOption('html5', true) options.linkSource(true) - dependsOn project(':hal').generateUsageReporting dependsOn project(':wpilibj').generateJavaVersion source project(':apriltag').sourceSets.main.java source project(':cameraserver').sourceSets.main.java diff --git a/hal/CMakeLists.txt b/hal/CMakeLists.txt index 060aeb0ac3..a7d59b6f7d 100644 --- a/hal/CMakeLists.txt +++ b/hal/CMakeLists.txt @@ -3,27 +3,6 @@ project(hal) include(CompileWarnings) include(AddTest) -file(STRINGS src/generate/Instances.txt RAW_INSTANCES) -file(STRINGS src/generate/ResourceType.txt RAW_RESOURCE_TYPES) - -set(usage_reporting_types_cpp "") -set(usage_reporting_instances_cpp "") -set(usage_reporting_types "") -set(usage_reporting_instances "") - -foreach(ITEM ${RAW_INSTANCES}) - list(APPEND usage_reporting_instances_cpp " ${ITEM},") - list(APPEND usage_reporting_instances "\n public static final int ${ITEM};") -endforeach() - -foreach(ITEM ${RAW_RESOURCE_TYPES}) - list(APPEND usage_reporting_types_cpp " ${ITEM},") - list(APPEND usage_reporting_types "\n public static final int ${ITEM};") -endforeach() - -string(REPLACE ";" "\n" usage_reporting_types_cpp "${usage_reporting_types_cpp}") -string(REPLACE ";" "\n" usage_reporting_instances_cpp "${usage_reporting_instances_cpp}") - file( GLOB hal_shared_native_src src/main/native/cpp/*.cpp @@ -46,8 +25,6 @@ else() target_sources(hal PRIVATE ${hal_sim_native_src}) endif() -configure_file(src/generate/FRCUsageReporting.h.in gen/hal/FRCUsageReporting.h) - set_target_properties(hal PROPERTIES OUTPUT_NAME "wpiHal") target_include_directories( @@ -60,7 +37,7 @@ target_include_directories( target_include_directories( hal PUBLIC - $ + $ $ ) target_link_libraries(hal PUBLIC wpiutil) @@ -69,7 +46,7 @@ set_property(TARGET hal PROPERTY FOLDER "libraries") install(TARGETS hal EXPORT hal) install(DIRECTORY src/main/native/include/ DESTINATION "${include_dest}/hal") -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gen/ DESTINATION "${include_dest}/hal") +install(DIRECTORY src/generated/main/native/include/ DESTINATION "${include_dest}/hal") configure_file(hal-config.cmake.in ${WPILIB_BINARY_DIR}/hal-config.cmake) install(FILES ${WPILIB_BINARY_DIR}/hal-config.cmake DESTINATION share/hal) @@ -86,13 +63,12 @@ if(WITH_JAVA) file(GLOB_RECURSE hal_shared_jni_src src/main/native/cpp/jni/*.cpp) - file(GLOB_RECURSE JAVA_SOURCES src/main/java/*.java) + file(GLOB_RECURSE JAVA_SOURCES src/main/java/*.java src/generated/main/java/*.java) set(CMAKE_JNI_TARGET true) add_jar( hal_jar ${JAVA_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/FRCNetComm.java INCLUDE_JARS wpiutil_jar OUTPUT_NAME wpiHal GENERATE_NATIVE_HEADERS hal_jni_headers @@ -125,11 +101,7 @@ endif() if(WITH_JAVA_SOURCE) find_package(Java REQUIRED) include(UseJava) - file( - GLOB HAL_SOURCES - src/main/java/edu/wpi/first/hal/*.java - ${CMAKE_CURRENT_BINARY_DIR}/FRCNetComm.java - ) + file(GLOB HAL_SOURCES src/main/java/edu/wpi/first/hal/*.java src/generated/main/java/*.java) file(GLOB HAL_CAN_SOURCES src/main/java/edu/wpi/first/hal/can/*.java) file(GLOB HAL_SIMULATION_SOURCES src/main/java/edu/wpi/first/hal/simulation/*.java) file(GLOB HAL_UTIL_SOURCES src/main/java/edu/wpi/first/hal/util/*.java) diff --git a/hal/build.gradle b/hal/build.gradle index 03d07a0180..b6937b8fec 100644 --- a/hal/build.gradle +++ b/hal/build.gradle @@ -1,60 +1,9 @@ -def javaResourceFile = file("$buildDir/generated/java/edu/wpi/first/hal/FRCNetComm.java") -def cppResourceFile = file("$buildDir/generated/headers/hal/FRCUsageReporting.h") - -def generateUsageReporting = tasks.register('generateUsageReporting') { - def javaBase = file('src/generate/FRCNetComm.java.in') - def cppBase = file('src/generate/FRCUsageReporting.h.in') - - def instances = file('src/generate/Instances.txt') - def resourceType = file('src/generate/ResourceType.txt') - - inputs.file(javaBase) - inputs.file(cppBase) - inputs.file(instances) - inputs.file(resourceType) - - outputs.file(javaResourceFile) - outputs.file(cppResourceFile) - - doLast { - def instanceTextJava = instances as String[] - def instanceTextCpp = instances as String[] - def resourceTextJava = resourceType as String[] - def resourceTextCpp = resourceType as String[] - - instanceTextJava = instanceTextJava.collect { - " public static final int ${it};" - }.join('\n') - - instanceTextCpp = instanceTextCpp.collect { - " ${it}," - }.join('\n') - - resourceTextJava = resourceTextJava.collect { - " public static final int ${it};" - }.join('\n') - - resourceTextCpp = resourceTextCpp.collect { - " ${it}," - }.join('\n') - - javaResourceFile.text = javaBase.text.replace('${usage_reporting_types}', resourceTextJava).replace('${usage_reporting_instances}', instanceTextJava) - cppResourceFile.text = cppBase.text.replace('${usage_reporting_types_cpp}', resourceTextCpp).replace('${usage_reporting_instances_cpp}', instanceTextCpp) - } -} - ext { addHalDependency = { binary, shared-> - binary.tasks.withType(AbstractNativeSourceCompileTask) { - it.dependsOn generateUsageReporting - } binary.lib project: ':hal', library: 'hal', linkage: shared } addHalJniDependency = { binary-> - binary.tasks.withType(AbstractNativeSourceCompileTask) { - it.dependsOn generateUsageReporting - } binary.lib project: ':hal', library: 'halJNIShared', linkage: 'shared' } @@ -62,16 +11,8 @@ ext { setBaseName = 'wpiHal' devMain = 'edu.wpi.first.hal.DevMain' niLibraries = true - generatedHeaders = "$buildDir/generated/headers" - jniSplitSetup = { - it.tasks.withType(AbstractNativeSourceCompileTask) { - it.dependsOn generateUsageReporting - } - } + generatedHeaders = "src/generated/main/native/include" splitSetup = { - it.tasks.withType(AbstractNativeSourceCompileTask) { - it.dependsOn generateUsageReporting - } if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { it.sources { athenaCpp(CppSourceSet) { @@ -109,11 +50,7 @@ ext { apply from: "${rootDir}/shared/jni/setupBuild.gradle" -sourceSets.main.java.srcDir "${buildDir}/generated/java/" - -compileJava { - dependsOn generateUsageReporting -} +sourceSets.main.java.srcDir "src/generated/main/java/edu/wpi/first/hal/" cppSourcesZip { from('src/main/native/athena') { @@ -126,7 +63,6 @@ cppSourcesZip { } cppHeadersZip { - dependsOn generateUsageReporting from(generatedHeaders) { into '/' } @@ -160,9 +96,6 @@ nativeUtils.exportsConfigs { model { binaries { all { - it.tasks.withType(AbstractNativeSourceCompileTask) { - it.dependsOn generateUsageReporting - } if (!(it instanceof NativeBinarySpec)) return if (it.component.name != 'hal' && it.component.name != 'halBase') return if (it.targetPlatform.name != nativeUtils.wpi.platforms.roborio) return diff --git a/hal/generate_usage_reporting.py b/hal/generate_usage_reporting.py new file mode 100755 index 0000000000..d4b4bb901a --- /dev/null +++ b/hal/generate_usage_reporting.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +# Copyright (c) FIRST and other WPILib contributors. +# Open Source Software; you can modify and/or share it under the terms of +# the WPILib BSD license file in the root directory of this project. +import os + + +def main(): + java_package = "edu/wpi/first/hal" + os.makedirs("hal/src/generated/main/native/include/hal", exist_ok=True) + os.makedirs(f"hal/src/generated/main/java/{java_package}", exist_ok=True) + usage_reporting_types_cpp = "" + usage_reporting_instances_cpp = "" + usage_reporting_types = "" + usage_reporting_instances = "" + with open("hal/src/generate/Instances.txt") as instances: + for instance in instances: + usage_reporting_instances_cpp = f"{usage_reporting_instances_cpp}\n {instance.strip()}," + usage_reporting_instances = f"{usage_reporting_instances}\n public static final int {instance.strip()};" + + with open("hal/src/generate/ResourceType.txt") as resource_types: + for resource_type in resource_types: + usage_reporting_types_cpp = f"{usage_reporting_types_cpp}\n {resource_type.strip()}," + usage_reporting_types = f"{usage_reporting_types}\n public static final int {resource_type.strip()};" + + with open("hal/src/generate/FRCNetComm.java.in") as java_usage_reporting: + contents = java_usage_reporting.read() + contents = contents.replace( + r"${usage_reporting_types}", usage_reporting_types) + if os.path.exists(f"hal/src/generated/main/java/{java_package}/FRCNetComm.java"): + with open(f"hal/src/generated/main/java/{java_package}/FRCNetComm.java", "w") as java_out: + java_out.write(contents.replace( + r"${usage_reporting_instances}", usage_reporting_instances)) + else: + with open(f"hal/src/generated/main/java/{java_package}/FRCNetComm.java", "x") as java_out: + java_out.write(contents.replace( + r"${usage_reporting_instances}", usage_reporting_instances)) + + with open("hal/src/generate/FRCUsageReporting.h.in") as cpp_usage_reporting: + contents = cpp_usage_reporting.read() + contents = contents.replace(r"${usage_reporting_types_cpp}", usage_reporting_types_cpp).replace( + r"${usage_reporting_instances_cpp}", usage_reporting_instances_cpp) + if os.path.exists("hal/src/generated/main/native/include/hal/FRCUsageReporting.h"): + with open("hal/src/generated/main/native/include/hal/FRCUsageReporting.h", "w") as cpp_out: + cpp_out.write(contents) + else: + with open("hal/src/generated/main/native/include/hal/FRCUsageReporting.h", "x") as cpp_out: + cpp_out.write(contents) + + +if __name__ == "__main__": + main() diff --git a/hal/src/generate/FRCNetComm.java.in b/hal/src/generate/FRCNetComm.java.in index 703e0349e5..effd0d2cab 100644 --- a/hal/src/generate/FRCNetComm.java.in +++ b/hal/src/generate/FRCNetComm.java.in @@ -1,6 +1,8 @@ -/* - * Autogenerated file! Do not manually edit this file. - */ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +// THIS FILE WAS AUTO-GENERATED BY ./hal/generate_usage_reporting.py. DO NOT MODIFY package edu.wpi.first.hal; @@ -15,7 +17,6 @@ public class FRCNetComm { public static final class tResourceType { private tResourceType() { } - ${usage_reporting_types} } @@ -26,7 +27,6 @@ ${usage_reporting_types} public static final class tInstances { private tInstances() { } - ${usage_reporting_instances} } } diff --git a/hal/src/generate/FRCUsageReporting.h.in b/hal/src/generate/FRCUsageReporting.h.in index 34330c8c99..03a78f0cbc 100644 --- a/hal/src/generate/FRCUsageReporting.h.in +++ b/hal/src/generate/FRCUsageReporting.h.in @@ -1,3 +1,9 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +// THIS FILE WAS AUTO-GENERATED BY ./hal/generate_usage_reporting.py. DO NOT MODIFY + #pragma once #include diff --git a/hal/src/generated/main/java/edu/wpi/first/hal/FRCNetComm.java b/hal/src/generated/main/java/edu/wpi/first/hal/FRCNetComm.java new file mode 100644 index 0000000000..b950544edb --- /dev/null +++ b/hal/src/generated/main/java/edu/wpi/first/hal/FRCNetComm.java @@ -0,0 +1,186 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +// THIS FILE WAS AUTO-GENERATED BY ./hal/generate_usage_reporting.py. DO NOT MODIFY + +package edu.wpi.first.hal; + +/** + * JNI wrapper for library FRC_NetworkCommunication
. + */ +public class FRCNetComm { + /** + * Resource type from UsageReporting. + */ + @SuppressWarnings("TypeName") + public static final class tResourceType { + private tResourceType() { + } + + public static final int kResourceType_Controller = 0; + public static final int kResourceType_Module = 1; + public static final int kResourceType_Language = 2; + public static final int kResourceType_CANPlugin = 3; + public static final int kResourceType_Accelerometer = 4; + public static final int kResourceType_ADXL345 = 5; + public static final int kResourceType_AnalogChannel = 6; + public static final int kResourceType_AnalogTrigger = 7; + public static final int kResourceType_AnalogTriggerOutput = 8; + public static final int kResourceType_CANJaguar = 9; + public static final int kResourceType_Compressor = 10; + public static final int kResourceType_Counter = 11; + public static final int kResourceType_Dashboard = 12; + public static final int kResourceType_DigitalInput = 13; + public static final int kResourceType_DigitalOutput = 14; + public static final int kResourceType_DriverStationCIO = 15; + public static final int kResourceType_DriverStationEIO = 16; + public static final int kResourceType_DriverStationLCD = 17; + public static final int kResourceType_Encoder = 18; + public static final int kResourceType_GearTooth = 19; + public static final int kResourceType_Gyro = 20; + public static final int kResourceType_I2C = 21; + public static final int kResourceType_Framework = 22; + public static final int kResourceType_Jaguar = 23; + public static final int kResourceType_Joystick = 24; + public static final int kResourceType_Kinect = 25; + public static final int kResourceType_KinectStick = 26; + public static final int kResourceType_PIDController = 27; + public static final int kResourceType_Preferences = 28; + public static final int kResourceType_PWM = 29; + public static final int kResourceType_Relay = 30; + public static final int kResourceType_RobotDrive = 31; + public static final int kResourceType_SerialPort = 32; + public static final int kResourceType_Servo = 33; + public static final int kResourceType_Solenoid = 34; + public static final int kResourceType_SPI = 35; + public static final int kResourceType_Task = 36; + public static final int kResourceType_Ultrasonic = 37; + public static final int kResourceType_Victor = 38; + public static final int kResourceType_Button = 39; + public static final int kResourceType_Command = 40; + public static final int kResourceType_AxisCamera = 41; + public static final int kResourceType_PCVideoServer = 42; + public static final int kResourceType_SmartDashboard = 43; + public static final int kResourceType_Talon = 44; + public static final int kResourceType_HiTechnicColorSensor = 45; + public static final int kResourceType_HiTechnicAccel = 46; + public static final int kResourceType_HiTechnicCompass = 47; + public static final int kResourceType_SRF08 = 48; + public static final int kResourceType_AnalogOutput = 49; + public static final int kResourceType_VictorSP = 50; + public static final int kResourceType_PWMTalonSRX = 51; + public static final int kResourceType_CANTalonSRX = 52; + public static final int kResourceType_ADXL362 = 53; + public static final int kResourceType_ADXRS450 = 54; + public static final int kResourceType_RevSPARK = 55; + public static final int kResourceType_MindsensorsSD540 = 56; + public static final int kResourceType_DigitalGlitchFilter = 57; + public static final int kResourceType_ADIS16448 = 58; + public static final int kResourceType_PDP = 59; + public static final int kResourceType_PCM = 60; + public static final int kResourceType_PigeonIMU = 61; + public static final int kResourceType_NidecBrushless = 62; + public static final int kResourceType_CANifier = 63; + public static final int kResourceType_TalonFX = 64; + public static final int kResourceType_CTRE_future1 = 65; + public static final int kResourceType_CTRE_future2 = 66; + public static final int kResourceType_CTRE_future3 = 67; + public static final int kResourceType_CTRE_future4 = 68; + public static final int kResourceType_CTRE_future5 = 69; + public static final int kResourceType_CTRE_future6 = 70; + public static final int kResourceType_LinearFilter = 71; + public static final int kResourceType_XboxController = 72; + public static final int kResourceType_UsbCamera = 73; + public static final int kResourceType_NavX = 74; + public static final int kResourceType_Pixy = 75; + public static final int kResourceType_Pixy2 = 76; + public static final int kResourceType_ScanseSweep = 77; + public static final int kResourceType_Shuffleboard = 78; + public static final int kResourceType_CAN = 79; + public static final int kResourceType_DigilentDMC60 = 80; + public static final int kResourceType_PWMVictorSPX = 81; + public static final int kResourceType_RevSparkMaxPWM = 82; + public static final int kResourceType_RevSparkMaxCAN = 83; + public static final int kResourceType_ADIS16470 = 84; + public static final int kResourceType_PIDController2 = 85; + public static final int kResourceType_ProfiledPIDController = 86; + public static final int kResourceType_Kinematics = 87; + public static final int kResourceType_Odometry = 88; + public static final int kResourceType_Units = 89; + public static final int kResourceType_TrapezoidProfile = 90; + public static final int kResourceType_DutyCycle = 91; + public static final int kResourceType_AddressableLEDs = 92; + public static final int kResourceType_FusionVenom = 93; + public static final int kResourceType_CTRE_future7 = 94; + public static final int kResourceType_CTRE_future8 = 95; + public static final int kResourceType_CTRE_future9 = 96; + public static final int kResourceType_CTRE_future10 = 97; + public static final int kResourceType_CTRE_future11 = 98; + public static final int kResourceType_CTRE_future12 = 99; + public static final int kResourceType_CTRE_future13 = 100; + public static final int kResourceType_CTRE_future14 = 101; + } + + /** + * Instances from UsageReporting. + */ + @SuppressWarnings("TypeName") + public static final class tInstances { + private tInstances() { + } + + public static final int kLanguage_LabVIEW = 1; + public static final int kLanguage_CPlusPlus = 2; + public static final int kLanguage_Java = 3; + public static final int kLanguage_Python = 4; + public static final int kLanguage_DotNet = 5; + public static final int kLanguage_Kotlin = 6; + public static final int kCANPlugin_BlackJagBridge = 1; + public static final int kCANPlugin_2CAN = 2; + public static final int kFramework_Iterative = 1; + public static final int kFramework_Simple = 2; + public static final int kFramework_CommandControl = 3; + public static final int kFramework_Timed = 4; + public static final int kFramework_ROS = 5; + public static final int kFramework_RobotBuilder = 6; + public static final int kRobotDrive_ArcadeStandard = 1; + public static final int kRobotDrive_ArcadeButtonSpin = 2; + public static final int kRobotDrive_ArcadeRatioCurve = 3; + public static final int kRobotDrive_Tank = 4; + public static final int kRobotDrive_MecanumPolar = 5; + public static final int kRobotDrive_MecanumCartesian = 6; + public static final int kRobotDrive2_DifferentialArcade = 7; + public static final int kRobotDrive2_DifferentialTank = 8; + public static final int kRobotDrive2_DifferentialCurvature = 9; + public static final int kRobotDrive2_MecanumCartesian = 10; + public static final int kRobotDrive2_MecanumPolar = 11; + public static final int kRobotDrive2_KilloughCartesian = 12; + public static final int kRobotDrive2_KilloughPolar = 13; + public static final int kDriverStationCIO_Analog = 1; + public static final int kDriverStationCIO_DigitalIn = 2; + public static final int kDriverStationCIO_DigitalOut = 3; + public static final int kDriverStationEIO_Acceleration = 1; + public static final int kDriverStationEIO_AnalogIn = 2; + public static final int kDriverStationEIO_AnalogOut = 3; + public static final int kDriverStationEIO_Button = 4; + public static final int kDriverStationEIO_LED = 5; + public static final int kDriverStationEIO_DigitalIn = 6; + public static final int kDriverStationEIO_DigitalOut = 7; + public static final int kDriverStationEIO_FixedDigitalOut = 8; + public static final int kDriverStationEIO_PWM = 9; + public static final int kDriverStationEIO_Encoder = 10; + public static final int kDriverStationEIO_TouchSlider = 11; + public static final int kADXL345_SPI = 1; + public static final int kADXL345_I2C = 2; + public static final int kCommand_Scheduler = 1; + public static final int kCommand2_Scheduler = 2; + public static final int kSmartDashboard_Instance = 1; + public static final int kKinematics_DifferentialDrive = 1; + public static final int kKinematics_MecanumDrive = 2; + public static final int kKinematics_SwerveDrive = 3; + public static final int kOdometry_DifferentialDrive = 1; + public static final int kOdometry_MecanumDrive = 2; + public static final int kOdometry_SwerveDrive = 3; + } +} diff --git a/hal/src/generated/main/native/include/hal/FRCUsageReporting.h b/hal/src/generated/main/native/include/hal/FRCUsageReporting.h new file mode 100644 index 0000000000..cf9e890dc1 --- /dev/null +++ b/hal/src/generated/main/native/include/hal/FRCUsageReporting.h @@ -0,0 +1,214 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +// THIS FILE WAS AUTO-GENERATED BY ./hal/generate_usage_reporting.py. DO NOT MODIFY + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// ifdef's definition is to allow for default parameters in C++. +#ifdef __cplusplus +/** + * Reports a hardware usage to the HAL. + * + * @param resource the used resource + * @param instanceNumber the instance of the resource + * @param context a user specified context index + * @param feature a user specified feature string + * @return the index of the added value in NetComm + */ +int64_t HAL_Report(int32_t resource, int32_t instanceNumber, + int32_t context = 0, const char* feature = nullptr); +#else + +/** + * Reports a hardware usage to the HAL. + * + * @param resource the used resource + * @param instanceNumber the instance of the resource + * @param context a user specified context index + * @param feature a user specified feature string + * @return the index of the added value in NetComm + */ +int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context, + const char* feature); +#endif + +#ifdef __cplusplus +} +#endif + +/* + * Autogenerated file! Do not manually edit this file. + */ + +#ifdef __cplusplus +namespace HALUsageReporting { + enum tResourceType : int32_t { + + kResourceType_Controller = 0, + kResourceType_Module = 1, + kResourceType_Language = 2, + kResourceType_CANPlugin = 3, + kResourceType_Accelerometer = 4, + kResourceType_ADXL345 = 5, + kResourceType_AnalogChannel = 6, + kResourceType_AnalogTrigger = 7, + kResourceType_AnalogTriggerOutput = 8, + kResourceType_CANJaguar = 9, + kResourceType_Compressor = 10, + kResourceType_Counter = 11, + kResourceType_Dashboard = 12, + kResourceType_DigitalInput = 13, + kResourceType_DigitalOutput = 14, + kResourceType_DriverStationCIO = 15, + kResourceType_DriverStationEIO = 16, + kResourceType_DriverStationLCD = 17, + kResourceType_Encoder = 18, + kResourceType_GearTooth = 19, + kResourceType_Gyro = 20, + kResourceType_I2C = 21, + kResourceType_Framework = 22, + kResourceType_Jaguar = 23, + kResourceType_Joystick = 24, + kResourceType_Kinect = 25, + kResourceType_KinectStick = 26, + kResourceType_PIDController = 27, + kResourceType_Preferences = 28, + kResourceType_PWM = 29, + kResourceType_Relay = 30, + kResourceType_RobotDrive = 31, + kResourceType_SerialPort = 32, + kResourceType_Servo = 33, + kResourceType_Solenoid = 34, + kResourceType_SPI = 35, + kResourceType_Task = 36, + kResourceType_Ultrasonic = 37, + kResourceType_Victor = 38, + kResourceType_Button = 39, + kResourceType_Command = 40, + kResourceType_AxisCamera = 41, + kResourceType_PCVideoServer = 42, + kResourceType_SmartDashboard = 43, + kResourceType_Talon = 44, + kResourceType_HiTechnicColorSensor = 45, + kResourceType_HiTechnicAccel = 46, + kResourceType_HiTechnicCompass = 47, + kResourceType_SRF08 = 48, + kResourceType_AnalogOutput = 49, + kResourceType_VictorSP = 50, + kResourceType_PWMTalonSRX = 51, + kResourceType_CANTalonSRX = 52, + kResourceType_ADXL362 = 53, + kResourceType_ADXRS450 = 54, + kResourceType_RevSPARK = 55, + kResourceType_MindsensorsSD540 = 56, + kResourceType_DigitalGlitchFilter = 57, + kResourceType_ADIS16448 = 58, + kResourceType_PDP = 59, + kResourceType_PCM = 60, + kResourceType_PigeonIMU = 61, + kResourceType_NidecBrushless = 62, + kResourceType_CANifier = 63, + kResourceType_TalonFX = 64, + kResourceType_CTRE_future1 = 65, + kResourceType_CTRE_future2 = 66, + kResourceType_CTRE_future3 = 67, + kResourceType_CTRE_future4 = 68, + kResourceType_CTRE_future5 = 69, + kResourceType_CTRE_future6 = 70, + kResourceType_LinearFilter = 71, + kResourceType_XboxController = 72, + kResourceType_UsbCamera = 73, + kResourceType_NavX = 74, + kResourceType_Pixy = 75, + kResourceType_Pixy2 = 76, + kResourceType_ScanseSweep = 77, + kResourceType_Shuffleboard = 78, + kResourceType_CAN = 79, + kResourceType_DigilentDMC60 = 80, + kResourceType_PWMVictorSPX = 81, + kResourceType_RevSparkMaxPWM = 82, + kResourceType_RevSparkMaxCAN = 83, + kResourceType_ADIS16470 = 84, + kResourceType_PIDController2 = 85, + kResourceType_ProfiledPIDController = 86, + kResourceType_Kinematics = 87, + kResourceType_Odometry = 88, + kResourceType_Units = 89, + kResourceType_TrapezoidProfile = 90, + kResourceType_DutyCycle = 91, + kResourceType_AddressableLEDs = 92, + kResourceType_FusionVenom = 93, + kResourceType_CTRE_future7 = 94, + kResourceType_CTRE_future8 = 95, + kResourceType_CTRE_future9 = 96, + kResourceType_CTRE_future10 = 97, + kResourceType_CTRE_future11 = 98, + kResourceType_CTRE_future12 = 99, + kResourceType_CTRE_future13 = 100, + kResourceType_CTRE_future14 = 101, + }; + enum tInstances : int32_t { + + kLanguage_LabVIEW = 1, + kLanguage_CPlusPlus = 2, + kLanguage_Java = 3, + kLanguage_Python = 4, + kLanguage_DotNet = 5, + kLanguage_Kotlin = 6, + kCANPlugin_BlackJagBridge = 1, + kCANPlugin_2CAN = 2, + kFramework_Iterative = 1, + kFramework_Simple = 2, + kFramework_CommandControl = 3, + kFramework_Timed = 4, + kFramework_ROS = 5, + kFramework_RobotBuilder = 6, + kRobotDrive_ArcadeStandard = 1, + kRobotDrive_ArcadeButtonSpin = 2, + kRobotDrive_ArcadeRatioCurve = 3, + kRobotDrive_Tank = 4, + kRobotDrive_MecanumPolar = 5, + kRobotDrive_MecanumCartesian = 6, + kRobotDrive2_DifferentialArcade = 7, + kRobotDrive2_DifferentialTank = 8, + kRobotDrive2_DifferentialCurvature = 9, + kRobotDrive2_MecanumCartesian = 10, + kRobotDrive2_MecanumPolar = 11, + kRobotDrive2_KilloughCartesian = 12, + kRobotDrive2_KilloughPolar = 13, + kDriverStationCIO_Analog = 1, + kDriverStationCIO_DigitalIn = 2, + kDriverStationCIO_DigitalOut = 3, + kDriverStationEIO_Acceleration = 1, + kDriverStationEIO_AnalogIn = 2, + kDriverStationEIO_AnalogOut = 3, + kDriverStationEIO_Button = 4, + kDriverStationEIO_LED = 5, + kDriverStationEIO_DigitalIn = 6, + kDriverStationEIO_DigitalOut = 7, + kDriverStationEIO_FixedDigitalOut = 8, + kDriverStationEIO_PWM = 9, + kDriverStationEIO_Encoder = 10, + kDriverStationEIO_TouchSlider = 11, + kADXL345_SPI = 1, + kADXL345_I2C = 2, + kCommand_Scheduler = 1, + kCommand2_Scheduler = 2, + kSmartDashboard_Instance = 1, + kKinematics_DifferentialDrive = 1, + kKinematics_MecanumDrive = 2, + kKinematics_SwerveDrive = 3, + kOdometry_DifferentialDrive = 1, + kOdometry_MecanumDrive = 2, + kOdometry_SwerveDrive = 3, + }; +} +#endif diff --git a/simulation/halsim_socketcan b/simulation/halsim_socketcan new file mode 160000 index 0000000000..dfc84b70d4 --- /dev/null +++ b/simulation/halsim_socketcan @@ -0,0 +1 @@ +Subproject commit dfc84b70d4655ca37429047032a498ba4a4f2670