Skip to content

Commit

Permalink
fix: setting realtime priority
Browse files Browse the repository at this point in the history
  • Loading branch information
gomezgu authored and BarisYazici committed Sep 26, 2024
1 parent d1f503b commit cb3e517
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/active_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
// Use of this source code is governed by the Apache-2.0 license, see LICENSE

#include <franka/active_control.h>
#include <franka/control_tools.h>
#include <franka/control_types.h>
#include <iostream>

#include <franka/exception.h>
#include <franka/robot.h>
#include <research_interface/robot/rbk_types.h>

#include "robot_impl.h"

namespace franka {
Expand All @@ -16,7 +19,12 @@ ActiveControl::ActiveControl(std::shared_ptr<Robot::Impl> robot_impl,
: robot_impl(std::move(robot_impl)),
motion_id(motion_id),
control_lock(std::move(control_lock)),
control_finished(false) {}
control_finished(false) {
std::string warning_message;
if (!setCurrentThreadToHighestSchedulerPriority(&warning_message)) {
std::cout << "libfranka [WARNING]: " << warning_message << std::endl;
}
}

ActiveControl::~ActiveControl() {
if (!control_finished) {
Expand Down

0 comments on commit cb3e517

Please sign in to comment.