Hello @RoboDaniel
Usually, it is not the code by itself that take too much space but the serial buffers.
You should look at this wiki page and reduce the size of the buffers as explained in the section 3.2 ros.h.
You need to modify the NodeHandle_
template parameters with something like:
NodeHandle_<ArduinoHardware, 10, 15, 128, 256>
Adjusting the values according to your needs.