CTRE Phoenix 6 C++ 26.70.0-alpha-2
Loading...
Searching...
No Matches
ctre::phoenix::platform Namespace Reference

Namespaces

namespace  can

Enumerations

enum  DeviceType { kDeviceTypeListInitializer }
 Enumeration of all supported device types. More...

Functions

static void SleepUs (int timeUs)
std::chrono::steady_clock::duration CurrentTimeRaw ()
 The raw current time source.
template<typename DURATION = std::chrono::microseconds>
static auto CurrentTime ()
 Returns the current time of the system, converted to the given duration.
template<typename DURATION = std::chrono::microseconds>
static auto MonotonicTime ()
 Returns the monotonic time of the system, converted to the given duration.
CTREXPORT void ReportError (bool isError, int32_t errorCode, std::string_view details, std::string_view location, std::string_view stackTrace)
CTREXPORT std::string GetStackTrace (int offset)
 Get a stack trace, ignoring the first "offset" symbols.
CTREXPORT int32_t SimCreate (DeviceType type, int id)
CTREXPORT int32_t SimDestroy (DeviceType type, int id)
CTREXPORT int32_t SimDestroyAll ()
CTREXPORT int32_t SimSetPhysicsInput (DeviceType type, int id, std::string_view physicsType, double value)
CTREXPORT int32_t SimGetPhysicsValue (DeviceType type, int id, std::string_view physicsType, double &value)
CTREXPORT int32_t SimGetLastError (DeviceType type, int id)
CTREXPORT int32_t ReplayLoadFile (char const *filepath)
CTREXPORT void ReplayCloseFile ()
CTREXPORT bool ReplayIsFileLoaded ()
CTREXPORT int32_t ReplayPlay ()
CTREXPORT int32_t ReplayPause ()
CTREXPORT int32_t ReplayStop ()
CTREXPORT bool ReplayIsRunning (uint16_t timeoutMs)
CTREXPORT bool ReplayIsFinished ()
CTREXPORT void ReplaySetSpeed (double speed)
CTREXPORT int32_t ReplayStepTiming (double stepTimeSeconds)
CTREXPORT int32_t ReportCANDevice (std::string_view model, uint32_t id, std::string_view canbus)
CTREXPORT int32_t ReportAPIUsage (std::string_view name, std::string_view data="")
CTREXPORT void EnableConsoleUTF8Output ()
 Enables UTF-8 console output.

Enumeration Type Documentation

◆ DeviceType

Enumeration of all supported device types.

Enumerator
kDeviceTypeListInitializer 

Function Documentation

◆ CurrentTime()

template<typename DURATION = std::chrono::microseconds>
auto ctre::phoenix::platform::CurrentTime ( )
inlinestatic

Returns the current time of the system, converted to the given duration.

The default duration is in microseconds.

This time source is typically continuous and monotonic. However, it may be overridden in simulation to use a non-monotonic, non-continuous source.

◆ CurrentTimeRaw()

std::chrono::steady_clock::duration ctre::phoenix::platform::CurrentTimeRaw ( )

The raw current time source.

◆ EnableConsoleUTF8Output()

CTREXPORT void ctre::phoenix::platform::EnableConsoleUTF8Output ( )

Enables UTF-8 console output.

◆ GetStackTrace()

CTREXPORT std::string ctre::phoenix::platform::GetStackTrace ( int offset)

Get a stack trace, ignoring the first "offset" symbols.

Parameters
offsetThe number of symbols at the top of the stack to ignore

◆ MonotonicTime()

template<typename DURATION = std::chrono::microseconds>
auto ctre::phoenix::platform::MonotonicTime ( )
inlinestatic

Returns the monotonic time of the system, converted to the given duration.

The default duration is in microseconds.

This time source is guaranteed to be continuous and monotonic.

◆ ReplayCloseFile()

CTREXPORT void ctre::phoenix::platform::ReplayCloseFile ( )

◆ ReplayIsFileLoaded()

CTREXPORT bool ctre::phoenix::platform::ReplayIsFileLoaded ( )

◆ ReplayIsFinished()

CTREXPORT bool ctre::phoenix::platform::ReplayIsFinished ( )

◆ ReplayIsRunning()

CTREXPORT bool ctre::phoenix::platform::ReplayIsRunning ( uint16_t timeoutMs)

◆ ReplayLoadFile()

CTREXPORT int32_t ctre::phoenix::platform::ReplayLoadFile ( char const * filepath)

◆ ReplayPause()

CTREXPORT int32_t ctre::phoenix::platform::ReplayPause ( )

◆ ReplayPlay()

CTREXPORT int32_t ctre::phoenix::platform::ReplayPlay ( )

◆ ReplaySetSpeed()

CTREXPORT void ctre::phoenix::platform::ReplaySetSpeed ( double speed)

◆ ReplayStepTiming()

CTREXPORT int32_t ctre::phoenix::platform::ReplayStepTiming ( double stepTimeSeconds)

◆ ReplayStop()

CTREXPORT int32_t ctre::phoenix::platform::ReplayStop ( )

◆ ReportAPIUsage()

CTREXPORT int32_t ctre::phoenix::platform::ReportAPIUsage ( std::string_view name,
std::string_view data = "" )

◆ ReportCANDevice()

CTREXPORT int32_t ctre::phoenix::platform::ReportCANDevice ( std::string_view model,
uint32_t id,
std::string_view canbus )

◆ ReportError()

CTREXPORT void ctre::phoenix::platform::ReportError ( bool isError,
int32_t errorCode,
std::string_view details,
std::string_view location,
std::string_view stackTrace )

◆ SimCreate()

CTREXPORT int32_t ctre::phoenix::platform::SimCreate ( DeviceType type,
int id )

◆ SimDestroy()

CTREXPORT int32_t ctre::phoenix::platform::SimDestroy ( DeviceType type,
int id )

◆ SimDestroyAll()

CTREXPORT int32_t ctre::phoenix::platform::SimDestroyAll ( )

◆ SimGetLastError()

CTREXPORT int32_t ctre::phoenix::platform::SimGetLastError ( DeviceType type,
int id )

◆ SimGetPhysicsValue()

CTREXPORT int32_t ctre::phoenix::platform::SimGetPhysicsValue ( DeviceType type,
int id,
std::string_view physicsType,
double & value )

◆ SimSetPhysicsInput()

CTREXPORT int32_t ctre::phoenix::platform::SimSetPhysicsInput ( DeviceType type,
int id,
std::string_view physicsType,
double value )

◆ SleepUs()

void ctre::phoenix::platform::SleepUs ( int timeUs)
inlinestatic
Parameters
timeUsHow long to yield current thread in microseconds (us). If platform cannot honor us resolution, round up to nearest value that platform can honor.