Easy Navigation
Loading...
Searching...
No Matches
RealTime.hpp
Go to the documentation of this file.
1// Copyright 2026 Intelligent Robotics Lab
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
17
18#ifndef EASYNAV_SYSTEM__REALTIME_HPP_
19#define EASYNAV_SYSTEM__REALTIME_HPP_
20
21#include <string>
22
23namespace easynav
24{
25
27constexpr int kRealTimePriority = 80;
28
31std::string set_real_time_priority(int priority);
32
35std::string check_real_time_priority(int priority);
36
40std::string lock_memory();
41
44std::string check_memory_lock();
45
46} // namespace easynav
47
48#endif // EASYNAV_SYSTEM__REALTIME_HPP_
Definition CircularBuffer.hpp:24
std::string check_memory_lock()
Whether lock_memory() is allowed (RLIMIT_MEMLOCK unlimited), without locking.
Definition RealTime.cpp:55
constexpr int kRealTimePriority
SCHED_FIFO priority of EasyNav's real-time cycle.
Definition RealTime.hpp:27
std::string lock_memory()
Locks the process memory, current and future, so the RT cycle never page-faults.
Definition RealTime.cpp:69
std::string check_real_time_priority(int priority)
Whether a thread of this process can get SCHED_FIFO priority, tried on a temporary thread.
Definition RealTime.cpp:47
std::string set_real_time_priority(int priority)
Gives the calling thread SCHED_FIFO priority.
Definition RealTime.cpp:34