ROS navigation stack on Jetson Nano: very slow control loop frequency
Hi all, I have been trying to setup the navigation stack on a custom differential drive robot for the past few weeks. I have followed religiously Automatic Addison's great tutorial for setting up the navigation stack: https://automaticaddison.com/how-to-set-up-the-ros-navigation-stack-on-a-robot/
The issue I am currently running into is that the control loop frequency is much lower than what is expected. It says: [ WARN] [1683928811.344312721]: Control loop missed its desired rate of 20.0000Hz... the loop actually took 6.0599 seconds A a full log can be found here: https://pastebin.com/6bV9k6km
I am on ROS melodic on Ubuntu 18.04 with Jetpack 4.6 on a Jetson Nano 4GB. From the tutorial I have seen, it should be plenty enough to run the navigation stack at decent frequencies.
What I have tried: - Increasing the transform tolerance - Decreasing the controller frequency
My local planner and costmaps configurations are defined here: https://github.com/nguyen-v/goombot_jetson/tree/master/src/goombot/navstack_pub/param
My launch file is defined here: https://github.com/nguyen-v/goombot_jetson/blob/master/src/goombot/navstack_pub/launch/goombot.launch
I am running the navigation stack on a map created with hector_slam with a resolution of 2048x2048, 0.05m/pix
I have also noticed that all 4 cores of the CPU are at 90-100% when running the navigation stack. Closing rviz after publishing a goal makes it go down to around 60%, but the control loop still takes around 4s which is way too much.
How can I speed up the simulation? I really don't understand why the control loop would take so long
Asked by blu on 2023-05-12 17:31:25 UTC
Comments
quick comment: make sure you've built your ROS install with compiler optimisations enabled. Something like
--cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
added to yourcatkin_make
orcatkin build
invocations would do that.Asked by gvdhoorn on 2023-05-13 02:42:52 UTC
Are you also running gazebo on the nano in addition to ros and rviz? The nano is too weak for that to ever work well.
Asked by Mike Scheutzow on 2023-05-13 07:16:51 UTC
No, I'm not running gazebo. I just kind of managed to solve the problem by decreasing the map resolution from the default 2048x2048 resolution generated by hector slam to a resolution of 256x256. Now I can get a control loop rate of around 10-15 Hz which is much better. It also helps to run jetson_clocks when starting the jetson too.
Asked by blu on 2023-05-13 08:24:40 UTC
I suggest you make this comment the answer. Then click the checkmark in the gray circle.
Asked by Mike Scheutzow on 2023-05-14 08:29:04 UTC