ros2_control - rolling
|
Classes | |
class | AsyncFunctionHandler |
Class to handle asynchronous function calls. AsyncFunctionHandler is a class that allows the user to have a asynchronous call to the parsed method and be able to set some thread specific parameters. More... | |
class | RealtimeBoxBase |
class | RealtimeBuffer |
class | RealtimeClock |
class | RealtimePublisher |
class | RealtimeServerGoalHandle |
Typedefs | |
template<typename T , typename mutex_type = std::mutex> | |
using | RealtimeBoxBestEffort = RealtimeBoxBase< T, mutex_type > |
template<typename T > | |
using | RealtimeBoxStandard = RealtimeBoxBase< T, std::mutex > |
template<typename T > | |
using | RealtimeBoxRecursive = RealtimeBoxBase< T, std::recursive_mutex > |
template<typename T > | |
using | RealtimeBox = RealtimeBoxStandard< T > |
template<class MessageT > | |
using | RealtimePublisherSharedPtr = std::shared_ptr< RealtimePublisher< MessageT > > |
Functions | |
bool | has_realtime_kernel () |
bool | configure_sched_fifo (int priority) |
bool | lock_memory (std::string &message) |
std::pair< bool, std::string > | lock_memory () |
std::pair< bool, std::string > | set_thread_affinity (NATIVE_THREAD_HANDLE thread, const std::vector< int > &cores) |
std::pair< bool, std::string > | set_thread_affinity (NATIVE_THREAD_HANDLE thread, int core) |
std::pair< bool, std::string > | set_thread_affinity (std::thread &thread, int core) |
std::pair< bool, std::string > | set_current_thread_affinity (int core) |
std::pair< bool, std::string > | set_current_thread_affinity (const std::vector< int > &cores) |
int64_t | get_number_of_available_processors () |
Variables | |
template<typename T > | |
constexpr auto | is_ptr_or_smart_ptr = rcpputils::is_pointer<T>::value |
bool realtime_tools::configure_sched_fifo | ( | int | priority | ) |
Configure SCHED_FIFO thread priority for the thread that calls this function
[in] | priority | the priority of this thread from 0-99 |
int64_t realtime_tools::get_number_of_available_processors | ( | ) |
Method to get the amount of available cpu cores https://man7.org/linux/man-pages/man3/sysconf.3.html https://stackoverflow.com/a/150971
bool realtime_tools::has_realtime_kernel | ( | ) |
Detect if realtime kernel is present.
std::pair< bool, std::string > realtime_tools::lock_memory | ( | ) |
Locks the memory pages of the calling thread to prevent page faults. By calling this method, the programs locks all pages mapped into the address space of the calling process and future mappings. This means that the kernel will not swap out the pages to disk i.e., the pages are guaranteed to stay in RAM until later unlocked - which is important for realtime applications.
[out] | message | a message describing the result of the operation |
bool realtime_tools::lock_memory | ( | std::string & | message | ) |
Locks the memory pages of the calling thread to prevent page faults. By calling this method, the programs locks all pages mapped into the address space of the calling process and future mappings. This means that the kernel will not swap out the pages to disk i.e., the pages are guaranteed to stay in RAM until later unlocked - which is important for realtime applications.
[out] | message | a message describing the result of the operation |
std::pair< bool, std::string > realtime_tools::set_current_thread_affinity | ( | const std::vector< int > & | cores | ) |
Configure the current thread affinity - Tell the scheduler to prefer a certain set of cores for the current thread.
[in] | core | the cpu numbers of the core. If an empty vector is passed, the affinity is reset to the default. |
std::pair< bool, std::string > realtime_tools::set_current_thread_affinity | ( | int | core | ) |
Configure the current thread affinity - Tell the scheduler to prefer a certain core for the current thread.
[in] | core | the cpu number of the core. If a negative number is passed, the affinity is reset to the default. |
std::pair< bool, std::string > realtime_tools::set_thread_affinity | ( | NATIVE_THREAD_HANDLE | thread, |
const std::vector< int > & | cores | ||
) |
Configure the caller thread affinity - Tell the scheduler to prefer a certain set of cores for the given thread handle.
[in] | thread | the thread handle of the thread |
[in] | core | the cpu numbers of the core. If an empty vector is passed, the affinity is reset to the default. |
std::pair< bool, std::string > realtime_tools::set_thread_affinity | ( | NATIVE_THREAD_HANDLE | thread, |
int | core | ||
) |
Configure the caller thread affinity - Tell the scheduler to prefer a certain core for the given thread handle.
[in] | thread | the thread handle of the thread |
[in] | core | the cpu number of the core. If a negative number is passed, the affinity is reset to the default. |
std::pair< bool, std::string > realtime_tools::set_thread_affinity | ( | std::thread & | thread, |
int | core | ||
) |
Configure the caller thread affinity - Tell the scheduler to prefer a certain core for the given thread.
[in] | thread | the reference of the thread |
[in] | core | the cpu number of the core. If a negative number is passed, the affinity is reset to the default. |