Memory allocation for ros2 messages

asked 2021-03-08 06:19:35 -0500

BhanuKiran.Chaluvadi gravatar image


When ever we do something like this

auto message = std_msgs::msg::Float32();

Is the memory is allocated in heap or stack ?

If its heap, is it better in this simple publisher example to create a local message object rather than allocating memory on heap in every timer call back ?


edit retag flag offensive close merge delete