From 0be6f0c9a6e3e9ee11a3626a21646d821ad4a518 Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Sat, 16 May 2020 15:33:33 -0400 Subject: [PATCH 1/2] Updating library versions --- build.gradle | 4 ++-- snobot_sim/build.gradle | 2 -- .../HalCallbacks/ThirdPartyCanCallbacks.cpp | 18 ++++++++++++------ .../CtreWrappers/CtreManager.cpp | 5 +++++ .../CtreWrappers/CtreManager.h | 1 + snobot_sim_gui/build.gradle | 2 -- snobot_sim_java/build.gradle | 2 -- 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 3bbe38a5..78a617cc 100644 --- a/build.gradle +++ b/build.gradle @@ -63,13 +63,13 @@ ext.getCtreVersion = { return '5.17.2' } ext.getCtreSimVersion = { - return getCtreVersion() + "_V0_RC" + return getCtreVersion() + "_V1" } ext.getRevRoboticsVersion = { return '1.5.0' } ext.getRevRoboticsSimVersion = { - return getRevRoboticsVersion() + "_V1" + return getRevRoboticsVersion() + "_V2" } ext.getNavxVersion = { return '3.1.403' diff --git a/snobot_sim/build.gradle b/snobot_sim/build.gradle index 5e8307c6..ee1efed1 100644 --- a/snobot_sim/build.gradle +++ b/snobot_sim/build.gradle @@ -53,8 +53,6 @@ dependencies { testRuntime 'edu.wpi.first.cscore:cscore-jni:' + getCsCoreVersion() + ':' + getCurrentOsArch() testRuntime 'edu.wpi.first.thirdparty.frc2020.opencv:opencv-java:' + getWpilibOpencvVersion() testRuntime 'edu.wpi.first.thirdparty.frc2020.opencv:opencv-jni:' + getWpilibOpencvVersion() + ':' + getCurrentOsArch() - testRuntime 'com.snobot.simulator:ctre_sim_override:' + getCtreSimVersion() + ':' + getCurrentOsArch() - testRuntime 'com.snobot.simulator:rev_simulator:' + getRevRoboticsSimVersion() + ':' + getCurrentOsArch() } nativeUtils { diff --git a/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp b/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp index 16763d4b..3523387f 100644 --- a/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp +++ b/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp @@ -2,10 +2,10 @@ #include "SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.h" #undef EXPORT_ -#include "CtreSimMocks/MockHooks.h" +#include "CtreSimUtils/MockHooks.h" #undef EXPORT_ -#include "RevSimMocks/MockHooks.h" +#include "RevSimUtils/MockHooks.h" #include "SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.h" #include "SnobotSim/SimulatorComponents/RevWrappers/RevManager.h" @@ -30,19 +30,25 @@ void InitializeThirdPartyCanCallbacks() int length) { gCtreManager.handleMotorControllerMessage(name, messageId, buffer, length); }); - SnobotSim::SetPigeonCallback([](const char* name, + SnobotSim::SetPigeonIMUCallback([](const char* name, uint32_t messageId, uint8_t* buffer, int length) { gCtreManager.handlePigeonMessage(name, messageId, buffer, length); }); - SnobotSim::SetCanifierCallback([](const char* name, + SnobotSim::SetCANifierCallback([](const char* name, uint32_t messageId, uint8_t* buffer, int length) { gCtreManager.handleCanifierMessage(name, messageId, buffer, length); }); - SnobotSim::SetBuffTrajPiontStreamCallback([](const char* name, + SnobotSim::SetCANCoderCallback([](const char* name, + uint32_t messageId, + uint8_t* buffer, + int length) { + gCtreManager.handleCanCoderMessage(name, messageId, buffer, length); + }); + SnobotSim::SetBuffTrajPointStreamCallback([](const char* name, uint32_t messageId, uint8_t* buffer, int length) { @@ -52,7 +58,7 @@ void InitializeThirdPartyCanCallbacks() ////////////////////////////// // REV ////////////////////////////// - SnobotSim::SetSparkMaxDriverCallback([](const char* name, + SnobotSim::SetCANSparkMaxDriverCallback([](const char* name, uint32_t messageId, uint8_t* buffer, int length) { diff --git a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp index c649913c..c0a49535 100644 --- a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp +++ b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp @@ -505,6 +505,11 @@ void CtreManager::handleCanifierMessage(const std::string& aCallback, int aCanPo SNOBOT_LOG(SnobotLogging::LOG_LEVEL_CRITICAL, "Getting Canifier Message " << aCallback << " on port " << aCanPort << "(" << aLength << " bytes)"); } +void CtreManager::handleCanCoderMessage(const std::string& aCallback, int aCanPort, uint8_t* aBuffer, int aLength) +{ + SNOBOT_LOG(SnobotLogging::LOG_LEVEL_CRITICAL, "Getting CanCoder Message " << aCallback << " on port " << aCanPort << "(" << aLength << " bytes)"); +} + void CtreManager::handleBuffTrajPointStreamMessage(const std::string& aCallback, int aCanPort, uint8_t* aBuffer, int aLength) { SNOBOT_LOG(SnobotLogging::LOG_LEVEL_CRITICAL, "Getting Trajectory Point Message " << aCallback << " on port " << aCanPort << "(" << aLength << " bytes)"); diff --git a/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.h b/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.h index 0bd3075c..6fd72d65 100644 --- a/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.h +++ b/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.h @@ -15,6 +15,7 @@ class CtreManager void handleMotorControllerMessage(const std::string& aCallback, int aCanPort, uint8_t* aBuffer, int aLength); void handlePigeonMessage(const std::string& aCallback, int aCanPort, uint8_t* aBuffer, int aLength); void handleCanifierMessage(const std::string& aCallback, int aCanPort, uint8_t* aBuffer, int aLength); + void handleCanCoderMessage(const std::string& aCallback, int aCanPort, uint8_t* aBuffer, int aLength); void handleBuffTrajPointStreamMessage(const std::string& aCallback, int aCanPort, uint8_t* aBuffer, int aLength); std::shared_ptr createPigeon(int aPort); diff --git a/snobot_sim_gui/build.gradle b/snobot_sim_gui/build.gradle index 2c0af3e5..ecdd0fba 100644 --- a/snobot_sim_gui/build.gradle +++ b/snobot_sim_gui/build.gradle @@ -65,8 +65,6 @@ dependencies { testCompile 'org.junit.jupiter:junit-jupiter-api:5.5.2' testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.5.1' testRuntime 'org.junit.platform:junit-platform-launcher:1.5.1' - runtime 'com.snobot.simulator:ctre_sim_override:' + getCtreSimVersion() + ':' + getCurrentOsArch() - runtime 'com.snobot.simulator:rev_simulator:' + getRevRoboticsSimVersion() + ':' + getCurrentOsArch() } eclipse.classpath.file { diff --git a/snobot_sim_java/build.gradle b/snobot_sim_java/build.gradle index beaa6f88..4628cfd3 100644 --- a/snobot_sim_java/build.gradle +++ b/snobot_sim_java/build.gradle @@ -29,8 +29,6 @@ dependencies { compile project(":snobot_sim_utilities") compile 'com.snobot.simulator:ctre_sim_override:' + getCtreSimVersion() compile 'com.snobot.simulator:rev_simulator:' + getRevRoboticsSimVersion() - testRuntime 'com.snobot.simulator:ctre_sim_override:' + getCtreSimVersion() + ':' + getCurrentOsArch() - testRuntime 'com.snobot.simulator:rev_simulator:' + getRevRoboticsSimVersion() + ':' + getCurrentOsArch() testCompile 'org.junit.jupiter:junit-jupiter-api:5.5.2' testCompile 'org.junit.jupiter:junit-jupiter-params:5.5.1' From 22eb4ac81ccb146871c15a77907f051f8ce4bc74 Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Sun, 17 May 2020 01:19:10 -0400 Subject: [PATCH 2/2] Fixing azure, running formatter --- azure-pipelines.yml | 324 +++++++++--------- .../HalCallbacks/ThirdPartyCanCallbacks.cpp | 18 +- .../SnobotSim/Logging/SnobotCoutLogger.cpp | 1 - .../CtreWrappers/CtreManager.cpp | 8 +- .../CtreWrappers/CtrePigeonImuSim.cpp | 1 - .../RevWrappers/RevManager.cpp | 8 +- .../AdxWrappers/BaseAdxAccelWrapper.h | 1 - 7 files changed, 173 insertions(+), 188 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0ff3c61b..480991a6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,8 +5,8 @@ resources: containers: - - container: wpilib2019 - image: wpilib/roborio-cross-ubuntu:2019-18.04 + - container: wpilib2020 + image: wpilib/roborio-cross-ubuntu:2020-18.04 - container: ubuntu18 image: ubuntu:18.04 options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro" @@ -42,178 +42,166 @@ stages: # displayName: 'Check wpiformat Output' - - job: Linux - pool: - vmImage: 'Ubuntu 16.04' - - container: wpilib2019 - - steps: - - task: Gradle@2 - inputs: - workingDirectory: '' - gradleWrapperFile: 'gradlew' - gradleOptions: '-Xmx3072m' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - tasks: 'build publish -x :snobot_sim_gui:test' - options: '-PciBuild --info' - # checkStyleRunAnalysis: true - # pmdRunAnalysis: true - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: maven repo' - inputs: - PathtoPublish: 'build/maven_repo' - ArtifactName: 'LinuxMaven' - - - job: Windows_64_Bit - pool: - vmImage: 'vs2017-win2016' - steps: - - powershell: | - mkdir build - $ProgressPreference = 'SilentlyContinue' - wget "https://download.java.net/java/ga/jdk11/openjdk-11_windows-x64_bin.zip" -O "build\jdk.zip" - displayName: 'Download JDK' - - task: JavaToolInstaller@0 - inputs: - jdkSourceOption: localDirectory - jdkFile: 'build/jdk.zip' - jdkDestinationDirectory: 'build/jdkinst' - jdkArchitectureOption: x64 - - task: Gradle@2 - inputs: - workingDirectory: '' - gradleWrapperFile: 'gradlew' - gradleOptions: '-Xmx3072m' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - tasks: 'build publish' - options: '-PciBuild -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000' - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: maven repo' - inputs: - PathtoPublish: 'build/maven_repo' - ArtifactName: 'Win64Maven' - - - - job: Windows_32_Bit - pool: - vmImage: 'vs2017-win2016' - steps: - - powershell: | - mkdir build - $ProgressPreference = 'SilentlyContinue' - wget "https://github.com/wpilibsuite/frc-openjdk-windows/releases/download/v11.0.0u28-1/jdk-x86-11.0.0u28-1.zip" -O "build\jdk.zip" - displayName: 'Download JDK' - - task: JavaToolInstaller@0 - inputs: - jdkSourceOption: localDirectory - jdkFile: 'build/jdk.zip' - jdkDestinationDirectory: 'build/jdkinst' - jdkArchitectureOption: x86 - - task: Gradle@2 - inputs: - workingDirectory: '' - gradleWrapperFile: 'gradlew' - gradleOptions: '-Xmx1024m' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - tasks: 'build publish' - options: '-PciBuild -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000 --info' - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: maven repo' - inputs: - PathtoPublish: 'build/maven_repo' - ArtifactName: 'Win32Maven' - - - job: Mac - pool: - vmImage: 'macOS-10.14' - steps: - - script: | - mkdir build - wget "https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz" -O "build/jdk.tar.gz" - sudo tar xvzf build/jdk.tar.gz -C /Library/Java/JavaVirtualMachines/ - export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/ - displayName: 'Setup JDK' - - task: Gradle@2 - inputs: - workingDirectory: '' - gradleWrapperFile: 'gradlew' - gradleOptions: '-Xmx3072m' - javaHomeOption: 'path' - jdkDirectory: '/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/' - publishJUnitResults: true - testResultsFiles: '**/TEST-*.xml' - tasks: 'build publish' - options: '-PciBuild -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000 --info' - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: maven repo' - inputs: - PathtoPublish: 'build/maven_repo' - ArtifactName: 'OSXMaven' - - - job: PrepareMaven - pool: - vmImage: 'ubuntu-16.04' - steps: - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Linux Artifacts' - inputs: - artifactName: 'LinuxMaven' - downloadPath: $(System.DefaultWorkingDirectory)/linux - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Windows 32 Artifacts' - inputs: - artifactName: 'Win32Maven' - downloadPath: $(System.DefaultWorkingDirectory)/win32 - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Windows 64 Artifacts' - inputs: - artifactName: 'Win64Maven' - downloadPath: $(System.DefaultWorkingDirectory)/win64 - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifacts' - inputs: - artifactName: 'OSXMaven' - downloadPath: $(System.DefaultWorkingDirectory)/mac - - - powershell: | - Copy-Item $(System.DefaultWorkingDirectory)/win32/Win32Maven/com $(System.DefaultWorkingDirectory)/output/com -recurse -force -verbose - Copy-Item $(System.DefaultWorkingDirectory)/win64/Win64Maven/* $(System.DefaultWorkingDirectory)/output -recurse -force -verbose - Copy-Item $(System.DefaultWorkingDirectory)/mac/OSXMaven/* $(System.DefaultWorkingDirectory)/output -recurse -force -verbose - Copy-Item $(System.DefaultWorkingDirectory)/linux/LinuxMaven/* $(System.DefaultWorkingDirectory)/output -recurse -force -verbose - - #- task: PythonScript@0 - # displayName: 'Create Combined Native Jar' - # inputs: - # scriptPath: ci_tools/create_all.py - # arguments: "--start_dir=$(System.DefaultWorkingDirectory)/output" - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Combined Artifacts' - inputs: - PathtoPublish: $(System.DefaultWorkingDirectory)/output - ArtifactName: 'SnobotSimFullMaven' - - dependsOn: [ Windows_64_Bit, Windows_32_Bit, Mac, Linux ] - condition: succeeded() + - job: Linux + pool: + vmImage: 'Ubuntu 16.04' + + container: wpilib2020 + + steps: + - task: Gradle@2 + inputs: + workingDirectory: '' + gradleWrapperFile: 'gradlew' + gradleOptions: '-Xmx3072m' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + tasks: 'build publish' + options: '-PciBuild' + # checkStyleRunAnalysis: true + # pmdRunAnalysis: true + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: maven repo' + inputs: + PathtoPublish: 'build/maven_repo' + ArtifactName: 'LinuxMaven' + + - job: Windows_64_Bit + pool: + vmImage: 'windows-2019' + steps: + - task: Gradle@2 + inputs: + workingDirectory: '' + gradleWrapperFile: 'gradlew' + gradleOptions: '-Xmx3072m' + jdkVersionOption: '1.11' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + tasks: 'build publish' + options: '-PciBuild -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: maven repo' + inputs: + PathtoPublish: 'build/maven_repo' + ArtifactName: 'Win64Maven' + + + - job: Windows_32_Bit + pool: + vmImage: 'vs2017-win2016' + steps: + - powershell: | + mkdir build + $ProgressPreference = 'SilentlyContinue' + wget "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x86-32_windows_hotspot_11.0.4_11.zip" -O "build\jdk.zip" + displayName: 'Download JDK' + - task: JavaToolInstaller@0 + inputs: + versionSpec: '11' + jdkSourceOption: localDirectory + jdkFile: 'build/jdk.zip' + jdkDestinationDirectory: 'build/jdkinst' + jdkArchitectureOption: x86 + - task: Gradle@2 + inputs: + workingDirectory: '' + gradleWrapperFile: 'gradlew' + gradleOptions: '-Xmx1024m' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + tasks: 'build publish' + options: '-PciBuild -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: maven repo' + inputs: + PathtoPublish: 'build/maven_repo' + ArtifactName: 'Win32Maven' + + - job: Mac + pool: + vmImage: 'macOS-10.14' + steps: + - script: | + mkdir build + export JAVA_HOME=`/usr/libexec/java_home -v 11` + displayName: 'Setup JDK' + - task: Gradle@2 + inputs: + workingDirectory: '' + gradleWrapperFile: 'gradlew' + gradleOptions: '-Xmx3072m' + jdkVersionOption: '1.11' + publishJUnitResults: true + testResultsFiles: '**/TEST-*.xml' + tasks: 'build publish' + options: '-PciBuild -Dhttp.socketTimeout=60000 -Dhttp.connectionTimeout=60000' + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: maven repo' + inputs: + PathtoPublish: 'build/maven_repo' + ArtifactName: 'OSXMaven' + + - job: PrepareMaven + pool: + vmImage: 'ubuntu-16.04' + steps: + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Linux Artifacts' + inputs: + artifactName: 'LinuxMaven' + downloadPath: $(System.DefaultWorkingDirectory)/linux + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Windows 32 Artifacts' + inputs: + artifactName: 'Win32Maven' + downloadPath: $(System.DefaultWorkingDirectory)/win32 + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Windows 64 Artifacts' + inputs: + artifactName: 'Win64Maven' + downloadPath: $(System.DefaultWorkingDirectory)/win64 + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifacts' + inputs: + artifactName: 'OSXMaven' + downloadPath: $(System.DefaultWorkingDirectory)/mac + + - powershell: | + Copy-Item $(System.DefaultWorkingDirectory)/win32/Win32Maven/com $(System.DefaultWorkingDirectory)/output/com -recurse -force -verbose + Copy-Item $(System.DefaultWorkingDirectory)/win64/Win64Maven/* $(System.DefaultWorkingDirectory)/output -recurse -force -verbose + Copy-Item $(System.DefaultWorkingDirectory)/mac/OSXMaven/* $(System.DefaultWorkingDirectory)/output -recurse -force -verbose + Copy-Item $(System.DefaultWorkingDirectory)/linux/LinuxMaven/* $(System.DefaultWorkingDirectory)/output -recurse -force -verbose + + #- task: PythonScript@0 + # displayName: 'Create Combined Native Jar' + # inputs: + # scriptPath: ci_tools/create_all.py + # arguments: "--start_dir=$(System.DefaultWorkingDirectory)/output" + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Combined Artifacts' + inputs: + PathtoPublish: $(System.DefaultWorkingDirectory)/output + ArtifactName: 'SnobotSimFullMaven' + + dependsOn: [ Windows_64_Bit, Windows_32_Bit, Mac, Linux ] + condition: succeeded() #- stage: Release # jobs: # - job: Test # pool: # vmImage: 'Ubuntu 16.04' -# + # steps: # - task: DownloadBuildArtifacts@0 # displayName: 'Download Build Artifacts' diff --git a/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp b/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp index 3523387f..636df810 100644 --- a/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp +++ b/snobot_sim/src/main/native/cpp/SnobotSim/HalCallbacks/ThirdPartyCanCallbacks.cpp @@ -31,9 +31,9 @@ void InitializeThirdPartyCanCallbacks() gCtreManager.handleMotorControllerMessage(name, messageId, buffer, length); }); SnobotSim::SetPigeonIMUCallback([](const char* name, - uint32_t messageId, - uint8_t* buffer, - int length) { + uint32_t messageId, + uint8_t* buffer, + int length) { gCtreManager.handlePigeonMessage(name, messageId, buffer, length); }); SnobotSim::SetCANifierCallback([](const char* name, @@ -43,9 +43,9 @@ void InitializeThirdPartyCanCallbacks() gCtreManager.handleCanifierMessage(name, messageId, buffer, length); }); SnobotSim::SetCANCoderCallback([](const char* name, - uint32_t messageId, - uint8_t* buffer, - int length) { + uint32_t messageId, + uint8_t* buffer, + int length) { gCtreManager.handleCanCoderMessage(name, messageId, buffer, length); }); SnobotSim::SetBuffTrajPointStreamCallback([](const char* name, @@ -59,9 +59,9 @@ void InitializeThirdPartyCanCallbacks() // REV ////////////////////////////// SnobotSim::SetCANSparkMaxDriverCallback([](const char* name, - uint32_t messageId, - uint8_t* buffer, - int length) { + uint32_t messageId, + uint8_t* buffer, + int length) { gReveManager.handleMessage(name, messageId, buffer, length); }); } diff --git a/snobot_sim/src/main/native/cpp/SnobotSim/Logging/SnobotCoutLogger.cpp b/snobot_sim/src/main/native/cpp/SnobotSim/Logging/SnobotCoutLogger.cpp index d075925e..8227a1f5 100644 --- a/snobot_sim/src/main/native/cpp/SnobotSim/Logging/SnobotCoutLogger.cpp +++ b/snobot_sim/src/main/native/cpp/SnobotSim/Logging/SnobotCoutLogger.cpp @@ -66,7 +66,6 @@ std::map gColorLookup = { { LOG_LEVEL_NONE, "\033[1;31m" }, }; - void StartColor(std::ostream& stream, LogLevel aLogLevel) { stream << gColorLookup[aLogLevel]; diff --git a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp index c0a49535..b730ea0f 100644 --- a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp +++ b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.cpp @@ -1,14 +1,14 @@ #include "SnobotSim/SimulatorComponents/CtreWrappers/CtreManager.h" +#include + #include "SnobotSim/GetSensorActuatorHelper.h" #include "SnobotSim/Logging/SnobotLogger.h" #include "SnobotSim/ModuleWrapper/Factories/FactoryContainer.h" #include "SnobotSim/SimulatorComponents/CtreWrappers/CtreTalonSRXSpeedControllerSim.h" #include "SnobotSim/SimulatorComponents/SmartSC/CanIdOffset.h" -#include - namespace { std::shared_ptr getMotorControllerWrapper(int aCanPort) @@ -27,7 +27,7 @@ template Type Extract(uint8_t* buffer, size_t& aBufferPos) { Type output; - memcpy(&output, &buffer[aBufferPos], sizeof(Type)); + std::memcpy(&output, &buffer[aBufferPos], sizeof(Type)); aBufferPos += sizeof(Type); return output; @@ -36,7 +36,7 @@ Type Extract(uint8_t* buffer, size_t& aBufferPos) template void Write(uint8_t* buffer, size_t& aBufferPos, const Type& value) { - memcpy(&buffer[aBufferPos], &value, sizeof(Type)); + std::memcpy(&buffer[aBufferPos], &value, sizeof(Type)); aBufferPos += sizeof(Type); } diff --git a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtrePigeonImuSim.cpp b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtrePigeonImuSim.cpp index 3219b7e2..0ca02808 100644 --- a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtrePigeonImuSim.cpp +++ b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/CtreWrappers/CtrePigeonImuSim.cpp @@ -6,7 +6,6 @@ namespace { - class PigeonGyroWrapper : public AModuleWrapper, public IGyroWrapper { public: diff --git a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/RevWrappers/RevManager.cpp b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/RevWrappers/RevManager.cpp index f0a308b9..c853a4fc 100644 --- a/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/RevWrappers/RevManager.cpp +++ b/snobot_sim/src/main/native/cpp/SnobotSim/SimulatorComponents/RevWrappers/RevManager.cpp @@ -1,14 +1,14 @@ #include "SnobotSim/SimulatorComponents/RevWrappers/RevManager.h" +#include + #include "SnobotSim/GetSensorActuatorHelper.h" #include "SnobotSim/Logging/SnobotLogger.h" #include "SnobotSim/ModuleWrapper/Factories/FactoryContainer.h" #include "SnobotSim/SimulatorComponents/RevWrappers/RevSpeedControllerSimWrapper.h" #include "SnobotSim/SimulatorComponents/SmartSC/CanIdOffset.h" -#include - namespace { @@ -16,7 +16,7 @@ template Type Extract(uint8_t* buffer, size_t& aBufferPos) { Type output; - memcpy(&output, &buffer[aBufferPos], sizeof(Type)); + std::memcpy(&output, &buffer[aBufferPos], sizeof(Type)); aBufferPos += sizeof(Type); return output; @@ -25,7 +25,7 @@ Type Extract(uint8_t* buffer, size_t& aBufferPos) template void Write(uint8_t* buffer, size_t& aBufferPos, const Type& value) { - memcpy(&buffer[aBufferPos], &value, sizeof(Type)); + std::memcpy(&buffer[aBufferPos], &value, sizeof(Type)); aBufferPos += sizeof(Type); } diff --git a/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/AdxWrappers/BaseAdxAccelWrapper.h b/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/AdxWrappers/BaseAdxAccelWrapper.h index 7f6af955..c46497f2 100644 --- a/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/AdxWrappers/BaseAdxAccelWrapper.h +++ b/snobot_sim/src/main/native/include/SnobotSim/SimulatorComponents/AdxWrappers/BaseAdxAccelWrapper.h @@ -20,7 +20,6 @@ class BaseAdxAccelWrapper virtual ~BaseAdxAccelWrapper(); protected: - class AccelerometerWrapper : public AModuleWrapper, public IAccelerometerWrapper { public: