Skip to content

Commit

Permalink
Fix hardcoded rmw_gid_t length
Browse files Browse the repository at this point in the history
  • Loading branch information
nnmm committed Mar 29, 2023
1 parent 6939a8a commit 589edd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions rclrs/src/rcl_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
#include <rmw/types.h>
#include <rosidl_typesupport_introspection_c/field_types.h>
#include <rosidl_typesupport_introspection_c/message_introspection.h>

const size_t RMW_GID_SIZE = RMW_GID_STORAGE_SIZE;
4 changes: 2 additions & 2 deletions rclrs/src/subscription/message_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::rcl_bindings::*;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PublisherGid {
/// Bytes identifying a publisher in the RMW implementation.
pub data: [u8; 24],
pub data: [u8; RMW_GID_SIZE],
/// A string containing the RMW implementation's name.
///
/// The `data` member only uniquely identifies the publisher within
Expand Down Expand Up @@ -145,7 +145,7 @@ mod tests {
publication_sequence_number: 0,
reception_sequence_number: 0,
publisher_gid: rmw_gid_t {
data: [0; 24],
data: [0; RMW_GID_SIZE],
implementation_identifier: std::ptr::null(),
},
from_intra_process: false,
Expand Down

0 comments on commit 589edd8

Please sign in to comment.