Skip to content

Commit

Permalink
add the realtime_tools lock_memory method to prevent page faults
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed Oct 30, 2024
1 parent b0da4a1 commit ce5be80
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controller_manager/src/ros2_control_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ int main(int argc, char ** argv)
auto cm = std::make_shared<controller_manager::ControllerManager>(
executor, manager_node_name, "", cm_node_options);

std::string message;
if (!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());

std::thread cm_thread(
Expand Down

0 comments on commit ce5be80

Please sign in to comment.