Skip to content

Commit

Permalink
Make sure the header also has a frame_id.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette committed Sep 26, 2022
1 parent 199ef66 commit 929ad82
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ struct HasHeader : public std::false_type {};

/**
* True if the message has a field named 'header' with a subfield named 'stamp' of
* type builtin_interfaces::msg::Time
* type builtin_interfaces::msg::Time, along with a subfield named 'frame_id' of type std::string
* @tparam M
*/
template<typename M>
struct HasHeader<M, typename std::enable_if<std::is_same<builtin_interfaces::msg::Time,
decltype(M().header.stamp)>::value>::type>: public std::true_type {};
decltype(M().header.stamp)>::value &&
std::is_same<std::string, decltype(M().header.frame_id)>::value>::type>: public std::true_type {};

/**
* Return a boolean flag indicating the timestamp is not set
Expand Down

0 comments on commit 929ad82

Please sign in to comment.