diff --git a/controller_manager/src/ros2_control_node.cpp b/controller_manager/src/ros2_control_node.cpp index 58eb6ac98f..c3d5d88f83 100644 --- a/controller_manager/src/ros2_control_node.cpp +++ b/controller_manager/src/ros2_control_node.cpp @@ -53,6 +53,12 @@ int main(int argc, char ** argv) RCLCPP_WARN( cm->get_logger(), "Unable to set the CPU affinity : '%s'", affinity_result.second.c_str()); } + + const bool lock_memory = cm->get_parameter_or("lock_memory", true); + std::string message; + if (lock_memory && !realtime_tools::lock_memory(message)) + { + RCLCPP_WARN(cm->get_logger(), "Unable to lock the memory : '%s'", message.c_str()); } RCLCPP_INFO(cm->get_logger(), "update rate is %d Hz", cm->get_update_rate()); diff --git a/doc/release_notes.rst b/doc/release_notes.rst index a63a11c20b..86e6f5f3d3 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -17,9 +17,7 @@ controller_manager ****************** * The ``ros2_control_node`` node now accepts the ``thread_priority`` parameter to set the scheduler priority of the controller_manager's RT thread (`#1820 `_). -<<<<<<< HEAD * Added support for the wildcard entries for the controller configuration files (`#1724 `_). -======= * The ``ros2_control_node`` node has a new ``lock_memory`` parameter to lock memory at startup to physical RAM in order to avoid page faults (`#1822 `_). * The ``ros2_control_node`` node has a new ``cpu_affinity`` parameter to bind the process to a specific CPU core. By default, this is not enabled. (`#1852 `_). @@ -89,4 +87,4 @@ ros2controlcli .. code-block:: bash ros2 control --ros-args -r __ns:= ->>>>>>> 98f0795 ([ros2_control_node] Add option to set the CPU affinity (#1852)) +