genmsg_ruby.py script generates a buggy deserialisation code for arrays. For example, when deserialising PositionWithCovariances, the message should contain Covariance array which is float[36]. Instead, the array contains only one number, the rest 35 elements are nils. This behavior is caused by line 716 in genmsg_ruby.py which generates "end_point += 8" (line 116 in PoseWithCovariance.rb). Instead of "8" it should generate the size of float[36] which is 36*8. Therefore, I suggest to write line 716 of genmsg_ruby.py in this way:
yield "end_point += ROS::Struct::calc_size('%s')"%convert_to_ruby_pattern(pattern)
instead of
yield "end_point += %s"%struct.calcsize('%s'%convert_to_ruby_pattern(pattern))
genmsg_ruby.py script generates a buggy deserialisation code for arrays. For example, when deserialising PositionWithCovariances, the message should contain Covariance array which is float[36]. Instead, the array contains only one number, the rest 35 elements are nils. This behavior is caused by line 716 in genmsg_ruby.py which generates "end_point += 8" (line 116 in PoseWithCovariance.rb). Instead of "8" it should generate the size of float[36] which is 36*8. Therefore, I suggest to write line 716 of genmsg_ruby.py in this way: yield "end_point += ROS::Struct::calc_size('%s')"%convert_to_ruby_pattern(pattern) instead of yield "end_point += %s"%struct.calcsize('%s'%convert_to_ruby_pattern(pattern))