34 int main (
int argc,
char **argv)
42 ros::param::param<bool>(
"~realtime", realtime,
false);
44 ros::param::param<double>(
"~period", period, 0.0071);
58 struct sched_param param;
59 memset(¶m, 0,
sizeof(param));
60 int policy = SCHED_FIFO;
61 param.sched_priority = sched_get_priority_max(policy);
63 ROS_WARN(
"Setting up Realtime scheduler");
64 if (sched_setscheduler(0, policy, ¶m) < 0) {
65 ROS_ERROR(
"sched_setscheduler: %s", strerror(errno));
66 ROS_ERROR(
"Please check you are using PREEMPT_RT kernel and set /etc/security/limits.conf");
69 if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0)
71 ROS_ERROR(
"mlockall: %s", strerror(errno));
void diagnose(diagnostic_updater::DiagnosticStatusWrapper &stat)
void setHardwareID(const std::string &hwid)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void add(const std::string &name, TaskFunction f)
int main(int argc, char **argv)
Main function.
void update(const ros::Time &time, const ros::Duration &period, bool reset_controllers=false)
ros::Duration getPeriod()