From: Walter Fetter Lages Date: Wed, 9 Sep 2026 04:25:44 +0000 (-0300) Subject: Remove change to real-time scheduler (moved to controller manager). X-Git-Url: http://git.ece.ufrgs.br/?a=commitdiff_plain;h=b65cad9b1430787322da22ed223f9f786c6baa0e;p=pid_plus_gravity_controller.git Remove change to real-time scheduler (moved to controller manager). --- diff --git a/include/pid_plus_gravity_controller/pid_plus_gravity_controller.hpp b/include/pid_plus_gravity_controller/pid_plus_gravity_controller.hpp index eba2e1d..c61223e 100644 --- a/include/pid_plus_gravity_controller/pid_plus_gravity_controller.hpp +++ b/include/pid_plus_gravity_controller/pid_plus_gravity_controller.hpp @@ -55,8 +55,6 @@ namespace pid_plus_gravity_controller std::vector> pid_; - int priority_; - realtime_tools::RealtimeBuffer> referencePoint_; void commandCB(const trajectory_msgs::msg::JointTrajectoryPoint::SharedPtr referencePoint); diff --git a/src/pid_plus_gravity_controller.cpp b/src/pid_plus_gravity_controller.cpp index 1db6478..158f500 100644 --- a/src/pid_plus_gravity_controller.cpp +++ b/src/pid_plus_gravity_controller.cpp @@ -19,8 +19,6 @@ *******************************************************************************/ -#include - #include #include #include @@ -47,8 +45,6 @@ namespace pid_plus_gravity_controller auto_declare("gravity.x",0.0); auto_declare("gravity.y",0.0); auto_declare("gravity.z",-9.8); - - auto_declare("priority",sched_get_priority_max(SCHED_FIFO)); } catch(const std::exception &e) { @@ -136,9 +132,6 @@ namespace pid_plus_gravity_controller return controller_interface::CallbackReturn::ERROR; } - if(!get_node()->get_parameter("priority",priority_)) - RCLCPP_WARN(get_node()->get_logger(),"No 'priority' configured for controller. Using highest possible priority."); - return controller_interface::CallbackReturn::SUCCESS; } @@ -169,14 +162,6 @@ namespace pid_plus_gravity_controller for(unsigned int i=0;i < nJoints_;i++) q_(i)=state_interfaces_[i].get_optional().value_or(q_(i)); qr_=q_; - - struct sched_param param; - param.sched_priority=priority_; - if(sched_setscheduler(0,SCHED_FIFO,¶m) == -1) - RCLCPP_WARN(get_node()->get_logger(),"Failed to set real-time scheduler."); - else if(mlockall(MCL_CURRENT|MCL_FUTURE) == -1) - RCLCPP_WARN(get_node()->get_logger(),"Failed to lock memory."); - return controller_interface::CallbackReturn::SUCCESS; }