-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ros2_control_node.cpp real time problem #808
Comments
I find that update() causes a large time delay (like 2ms, even bigger, the cycle time is 1ms). |
Hi @yeyanlei, the way you are measuring time could cause jitter, since you are using "print" functions on each run. Do you get output that Preempt Kernel is used? It should be automatically recognized in the master version. Also, what controllers are you running? We would need your exact system setup to know what could cause the issue. This mean, which hardware drivers are used, which controllers and in which configuration. |
@destogl I have located this problem, latency occurs in update (), controller_manager.cpp, update() function(). I post printed time series. Large time delay will occur in t2-t1 (like400us). using controller is joint_trajectory_controller. Preept Kernel is used. The timing of read() and write() functions can be guaranteed. this is code from controller_manager.cpp auto t1 = rclcpp::Clock().now(); for (auto loaded_controller : rt_controller_list)
} auto t2 = rclcpp::Clock().now(); if (duaration_t2_t1.nanoseconds()>100000) |
@destogl joint_trajectory_controller(arm_controller) generates a large delay. |
@destogl At present, the problem has been preliminarily solved. I directly use joint_ trajectory_ The controller source file, obviously reduces the robot jitter. I suspect that “sudo apt install ros humble joint trajectory controller” has some problems. |
Using sudo apt install ros-humble-joint-trajectory-controller, sometimes the program execution time is 2000-3000us. using source file joint-trajectory-controller master, sometimes the program execution time less than 500us. |
Ok, great! Yes, we did some improvements recently, and they are not yet synced to the humble release. Glad that you solved the problem. I'll close this. You are welcome to reopen is needed. |
Describe the bug
There are is a problem about ros2_control, i found that the ROS_Control_node would suddenly jitter (like 3ms), the set period is 1ms. The system environment is ubuntu 22.04, ros2 humble, kernel 5.15.55-rt with Preempt_rt patch. Fifo mode, priority is 90. i have posted serveral pictures. system max jitter is less than 50us.
print result
[ros2_control_node-1] ==============================measured_period.nanoseconds ===========6116648
[ros2_control_node-1] ==============================measured_period.nanoseconds ===========89013
[ros2_control_node-1] ==============================measured_period.nanoseconds ===========26079
To Reproduce
Steps to reproduce the behavior:
while (rclcpp::ok())
{
// calculate measured period
auto const current_time = cm->now();
auto const measured_period = current_time - previous_time;
previous_time = current_time;
rcl_duration_value_t base_time=1000000;
if (base_time-measured_period.nanoseconds()>50000 || base_time-measured_period.nanoseconds()<-50000)
{
std::cout<<"==============================measured_period.nanoseconds ==========="<<measured_period.nanoseconds()<<std::endl;
}
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
OS: [ubuntu 22.04]
Version [humble]
kernel Linux c 5.15.55-rt48 Import ros2_control #1 SMP PREEMPT_RT
Additional context
Add any other context about the problem here, especially include any modifications to ros2_control that relate to this issue.
ros2_control_node.txt
The text was updated successfully, but these errors were encountered: