mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Replace /home/lvuser with /home/systemcore (#8002)
This commit is contained in:
@@ -71,7 +71,7 @@ static std::string MakeLogDir(std::string_view dir) {
|
||||
if (!dir.empty()) {
|
||||
return std::string{dir};
|
||||
}
|
||||
#ifdef __FRC_ROBORIO__
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
// prefer a mounted USB drive if one is accessible
|
||||
std::error_code ec;
|
||||
auto s = fs::status("/u", ec);
|
||||
@@ -81,14 +81,9 @@ static std::string MakeLogDir(std::string_view dir) {
|
||||
return "/u/logs";
|
||||
HAL_ReportUsage("DataLogManager", "USB");
|
||||
}
|
||||
if (RobotBase::GetRuntimeType() == kRoboRIO) {
|
||||
FRC_ReportWarning(
|
||||
"DataLogManager: Logging to RoboRIO 1 internal storage is "
|
||||
"not recommended! Plug in a FAT32 formatted flash drive!");
|
||||
}
|
||||
fs::create_directory("/home/lvuser/logs", ec);
|
||||
fs::create_directory("/home/systemcore/logs", ec);
|
||||
HAL_ReportUsage("DataLogManager", "Onboard");
|
||||
return "/home/lvuser/logs";
|
||||
return "/home/systemcore/logs";
|
||||
#else
|
||||
std::string logDir = filesystem::GetOperatingDirectory() + "/logs";
|
||||
std::error_code ec;
|
||||
@@ -312,7 +307,8 @@ void Thread::StopNTLog() {
|
||||
void Thread::StartConsoleLog() {
|
||||
if (!m_consoleLoggerEnabled && RobotBase::IsReal()) {
|
||||
m_consoleLoggerEnabled = true;
|
||||
m_consoleLogger = {"/home/lvuser/FRC_UserProgram.log", m_log, "console"};
|
||||
m_consoleLogger = {"/home/systemcore/FRC_UserProgram.log", m_log,
|
||||
"console"};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ std::string frc::filesystem::GetLaunchDirectory() {
|
||||
|
||||
std::string frc::filesystem::GetOperatingDirectory() {
|
||||
if constexpr (!RobotBase::IsSimulation()) {
|
||||
return "/home/lvuser";
|
||||
return "/home/systemcore";
|
||||
} else {
|
||||
return frc::filesystem::GetLaunchDirectory();
|
||||
}
|
||||
@@ -24,7 +24,7 @@ std::string frc::filesystem::GetOperatingDirectory() {
|
||||
|
||||
std::string frc::filesystem::GetDeployDirectory() {
|
||||
if constexpr (!RobotBase::IsSimulation()) {
|
||||
return "/home/lvuser/deploy";
|
||||
return "/home/systemcore/deploy";
|
||||
} else {
|
||||
return (fs::current_path() / "src" / "main" / "deploy").string();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ static MotorSafetyManager& GetManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
#ifndef __FRC_ROBORIO__
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
namespace frc::impl {
|
||||
void ResetMotorSafety() {
|
||||
auto& manager = GetManager();
|
||||
|
||||
@@ -41,7 +41,7 @@ static Instance& GetInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
#ifndef __FRC_ROBORIO__
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
namespace frc::impl {
|
||||
void ResetPreferencesInstance() {
|
||||
GetInstance() = Instance();
|
||||
|
||||
@@ -41,7 +41,7 @@ static Instance& GetInstance() {
|
||||
return *GetInstanceHolder();
|
||||
}
|
||||
|
||||
#ifndef __FRC_ROBORIO__
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
namespace frc::impl {
|
||||
void ResetSmartDashboardInstance() {
|
||||
std::make_unique<Instance>().swap(GetInstanceHolder());
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "frc/RobotBase.h"
|
||||
|
||||
#ifdef __FRC_ROBORIO__
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
@@ -34,6 +34,8 @@ static_assert(frc::RuntimeType::kRoboRIO2 ==
|
||||
static_cast<frc::RuntimeType>(HAL_Runtime_RoboRIO2));
|
||||
static_assert(frc::RuntimeType::kSimulation ==
|
||||
static_cast<frc::RuntimeType>(HAL_Runtime_Simulation));
|
||||
static_assert(frc::RuntimeType::kSystemCore ==
|
||||
static_cast<frc::RuntimeType>(HAL_Runtime_SystemCore));
|
||||
|
||||
using SetCameraServerSharedFP = void (*)(frc::CameraServerShared*);
|
||||
|
||||
@@ -104,7 +106,7 @@ class WPILibMathShared : public wpi::math::MathShared {
|
||||
} // namespace
|
||||
|
||||
static void SetupCameraServerShared() {
|
||||
#ifdef __FRC_ROBORIO__
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
#ifdef DYNAMIC_CAMERA_SERVER
|
||||
#ifdef DYNAMIC_CAMERA_SERVER_DEBUG
|
||||
auto cameraServerLib = dlopen("libcameraserverd.so", RTLD_NOW);
|
||||
@@ -189,7 +191,7 @@ RobotBase::RobotBase() {
|
||||
// subscribe to "" to force persistent values to propagate to local
|
||||
nt::SubscribeMultiple(inst.GetHandle(), {{std::string_view{}}});
|
||||
if constexpr (!IsSimulation()) {
|
||||
inst.StartServer("/home/lvuser/networktables.json");
|
||||
inst.StartServer("/home/systemcore/networktables.json");
|
||||
} else {
|
||||
inst.StartServer();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace frc {
|
||||
* automatically cleans up old files when disk space is low and renames the file
|
||||
* based either on current date/time or (if available) competition match number.
|
||||
* The data file will be saved to a USB flash drive in a folder named "logs" if
|
||||
* one is attached, or to /home/lvuser/logs otherwise.
|
||||
* one is attached, or to /home/systemcore/logs otherwise.
|
||||
*
|
||||
* Log files are initially named "FRC_TBD_{random}.wpilog" until the DS
|
||||
* connects. After the DS connects, the log file is renamed to
|
||||
|
||||
@@ -19,7 +19,7 @@ std::string GetLaunchDirectory();
|
||||
|
||||
/**
|
||||
* Obtains the operating directory of the program. On the roboRIO, this
|
||||
* is /home/lvuser. In simulation, it is where the simulation was launched
|
||||
* is /home/systemcore. In simulation, it is where the simulation was launched
|
||||
* from (`pwd`).
|
||||
*
|
||||
* @return The result of the operating directory lookup.
|
||||
@@ -29,8 +29,8 @@ std::string GetOperatingDirectory();
|
||||
/**
|
||||
* Obtains the deploy directory of the program, which is the remote location
|
||||
* src/main/deploy is deployed to by default. On the roboRIO, this is
|
||||
* /home/lvuser/deploy. In simulation, it is where the simulation was launched
|
||||
* from, in the subdirectory "src/main/deploy" (`pwd`/src/main/deploy).
|
||||
* /home/systemcore/deploy. In simulation, it is where the simulation was
|
||||
* launched from, in the subdirectory "src/main/deploy" (`pwd`/src/main/deploy).
|
||||
*
|
||||
* @return The result of the operating directory lookup
|
||||
*/
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace frc {
|
||||
int RunHALInitialization();
|
||||
|
||||
namespace impl {
|
||||
#ifndef __FRC_ROBORIO__
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
void ResetMotorSafety();
|
||||
#endif
|
||||
|
||||
@@ -124,7 +124,7 @@ int StartRobot() {
|
||||
impl::RunRobot<Robot>(m, &robot);
|
||||
}
|
||||
|
||||
#ifndef __FRC_ROBORIO__
|
||||
#ifndef __FRC_SYSTEMCORE__
|
||||
frc::impl::ResetMotorSafety();
|
||||
#endif
|
||||
HAL_Shutdown();
|
||||
@@ -235,7 +235,7 @@ class RobotBase {
|
||||
* @return If the robot is running in the real world.
|
||||
*/
|
||||
static constexpr bool IsReal() {
|
||||
#ifdef __FRC_ROBORIO__
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
@@ -248,7 +248,7 @@ class RobotBase {
|
||||
* @return If the robot is running in simulation.
|
||||
*/
|
||||
static constexpr bool IsSimulation() {
|
||||
#ifdef __FRC_ROBORIO__
|
||||
#ifdef __FRC_SYSTEMCORE__
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
|
||||
@@ -14,6 +14,7 @@ enum RuntimeType {
|
||||
/// roboRIO 2.0.
|
||||
kRoboRIO2,
|
||||
/// Simulation runtime.
|
||||
kSimulation
|
||||
kSimulation,
|
||||
kSystemCore
|
||||
};
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user