gazebosim / gz-msgs

Messages for Gazebo robot simulation.
https://gazebosim.org
Apache License 2.0
22 stars 47 forks source link

msgs9 and msgs10 are not compatible #449

Closed ceccocats closed 4 months ago

ceccocats commented 5 months ago

I can communicate beetween two different version of gz-msgs and gz-transport but updates on message version 10 break compatibility for no reason.

Example:

Version9

message IMU
{
  /// \brief Optional header data
  Header header                = 1;

  string entity_name           = 2;
  Quaternion orientation       = 3;
  Vector3d angular_velocity    = 4;
  Vector3d linear_acceleration = 5;
}

Version10

message IMU
{
  /// \brief Optional header data
  Header header                          = 1;

  string entity_name                     = 2;

  Quaternion orientation                 = 3;
  /// Row major about x, y, z
  Float_V orientation_covariance         = 4;

  Vector3d angular_velocity              = 5;
  /// Row major about x, y, z
  Float_V angular_velocity_covariance    = 6;

  Vector3d linear_acceleration           = 7;
  /// Row major about x, y, z
  Float_V linear_acceleration_covariance = 8;
}

There is no reason to re-enumerate fields of proto, it should have been like this:

message IMU
{
  /// \brief Optional header data
  Header header                = 1;

  string entity_name           = 2;
  Quaternion orientation       = 3;
  Vector3d angular_velocity    = 4;
  Vector3d linear_acceleration = 5;
  Float_V orientation_covariance         = 6;
  Float_V angular_velocity_covariance    = 7;
  Float_V linear_acceleration_covariance = 8;
}

There is any specific reason why its like that?

azeey commented 5 months ago

It was probably done to keep similar fields grouped together. In hind sight, we should have added those new fields without changing the existing field positions. At this point, changing it in gz-msgs10 would break ABI, so I would not be in favor of that.