osrf / ros2_serial_example

70 stars 15 forks source link

Split the generated file into multiple compliation units #12

Closed clalancette closed 5 years ago

clalancette commented 5 years ago

Currently the code generation for the individual messages all compile into a single header file (ros2_topics.hpp), which is then included into the main program. The problem is that for large number of message types, this single header file can grow quite large and eat up lots of RAM during compilation. In one test, I compiled all of ROS2 std_msgs into the application, and it took ~1.8GB of RAM during compilation. That's clearly too much.

One way to alleviate this would be to make each message its own compilation unit, and then have some kind of "registration" with a table so we can look it up later. That should significantly cut down on the RAM needed for each compilation unit.

clalancette commented 5 years ago

This was done in https://github.com/osrf/ros2_serial_example/pull/15, so closing.