After some experimentation, it appears that the size of the hex file does not directly correspond to the amount of code that is actually uploaded to the robot controller. The hex file containing the default code has a size of 25 KB, while the hex file with the CORDIC library included (I believe
this is the library in question) has a size of 48 KB. Even though this hex file is larger than the PIC's 32 KB flash memory, it still uploads and executes on my RC without any problem.
So it seems therefore the size of the hex file containing the code is not an accurate measure of how much flash space the code will take up on the RC.
cibressus53, I think your problem lies somewhere else than in the size of your code.