If, right after pursuing all All those guidelines, you still have issues with RAM and CPU, then probably it’s simply because your application is basically too hefty, plus a Raspberry Pi is not the appropriate Instrument for the occupation. In this instance, you may want to have a look at https://robotarm95061.blogminds.com/the-smart-trick-of-service-robot-that-nobody-is-discussing-24678527