Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelovuo committed Nov 19, 2024
1 parent 1ca403c commit 620702e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/messages/submessages/elements/inline_qos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ impl InlineQos {
.parameters
.iter()
// We look for two PIDs, because there is some unclarity about which one should be used.
.find(|p| p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY
|| p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY_CUSTOM );
.find(|p| {
p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY
|| p.parameter_id == ParameterId::PID_RELATED_SAMPLE_IDENTITY_CUSTOM
});

let endianness = match representation_id {
RepresentationIdentifier::PL_CDR_LE => Endianness::LittleEndian,
Expand Down
12 changes: 6 additions & 6 deletions src/rtps/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ impl MessageBuilder {
// If we are sending related sample identity, then insert that.
if let Some(si) = cache_change.write_options.related_sample_identity() {
let related_sample_identity_serialized = si.write_to_vec_with_ctx(endianness).unwrap();
// Insert two parameters, because we are not sure which one is the correct parameter id.
// Or what the receiver thinks is correct. This behaviour was observed from
// eProsima FastDDS on 2024-11-18.
// Insert two parameters, because we are not sure which one is the correct
// parameter id. Or what the receiver thinks is correct. This behaviour
// was observed from eProsima FastDDS on 2024-11-18.
param_list.push(Parameter {
parameter_id: ParameterId::PID_RELATED_SAMPLE_IDENTITY,
value: related_sample_identity_serialized.clone(),
Expand Down Expand Up @@ -360,9 +360,9 @@ impl MessageBuilder {
// If we are sending related sample identity, then insert that.
if let Some(si) = cache_change.write_options.related_sample_identity() {
let related_sample_identity_serialized = si.write_to_vec_with_ctx(endianness).unwrap();
// Insert two parameters, because we are not sure which one is the correct parameter id.
// Or what the receiver thinks is correct. This behaviour was observed from
// eProsima FastDDS on 2024-11-18.
// Insert two parameters, because we are not sure which one is the correct
// parameter id. Or what the receiver thinks is correct. This behaviour
// was observed from eProsima FastDDS on 2024-11-18.
param_list.push(Parameter {
parameter_id: ParameterId::PID_RELATED_SAMPLE_IDENTITY,
value: related_sample_identity_serialized.clone(),
Expand Down
13 changes: 7 additions & 6 deletions src/structure/parameter_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ impl ParameterId {
// https://github.com/eProsima/Fast-DDS/commit/359eeaadd0ff0216aa1968a8ea34b5092c4f346e
// They changed PID_RELATED_SAMPLE_IDENTITY from 0x800f to 0x0083.
//
// PID 0x800f is still supported in FastDDS, and it is called PID_CUSTOM_RELATED_SAMPLE_IDENTITY, which
// naming we will copy, so that future debugging is less confusing. Now FastDDS sends
// both of these PIDs in Inline QoS, if it needs to send related_sample_identity. This seems like
// PID 0x800f is still supported in FastDDS, and it is called
// PID_CUSTOM_RELATED_SAMPLE_IDENTITY, which naming we will copy, so that
// future debugging is less confusing. Now FastDDS sends both of these PIDs in
// Inline QoS, if it needs to send related_sample_identity. This seems like
// a good idea for backward compatibility.
//
// The receive behaviour of FastDDS is somewhat unclear. They recognize both versions on receive,
// but receiveing related_sample_identity does not work correctly with PID=0x800f in
// ROS 2 Jazzy.
// The receive behaviour of FastDDS is somewhat unclear. They recognize both
// versions on receive, but receiveing related_sample_identity does not work
// correctly with PID=0x800f in ROS 2 Jazzy.
pub const PID_RELATED_SAMPLE_IDENTITY: Self = Self { value: 0x0083 };
pub const PID_RELATED_SAMPLE_IDENTITY_CUSTOM: Self = Self { value: 0x800f };

Expand Down

0 comments on commit 620702e

Please sign in to comment.