Deprecated issue in electric regarding one of scan member functions
I have a line of code that has deprecated issue in electric and I would like to know what is its better substitute.
Issue:
=> scan.set_ranges_size((int)(90/0.25));
[Warning:‘void sensor_msgs::LaserScan_<containerallocator>::set_ranges_size(uint32_t) [with ContainerAllocator = std::allocator<void>]’ is deprecated (declared at /opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include/ sensor_msgs/LaserScan.h:85)]
P/S: Waiting for @joq's answer for he has done it already. This post is a refactor one.