Function husarion_ugv_utils::ros::MergeHeaders
Defined in File ros_utils.hpp
Function Documentation
-
std_msgs::msg::Header husarion_ugv_utils::ros::MergeHeaders(const std_msgs::msg::Header &header_1, const std_msgs::msg::Header &header_2)
Merges two headers into a single header.
This function takes two headers as input and merges them into a single header. The merged header will have the same frame ID as the input headers. The timestamp of the merged header will be the earliest timestamp between the two input headers.
If the frame IDs of the input headers are different, an exception of type std::runtime_error will be thrown.
- Parameters:
header_1 – The first header to be merged.
header_2 – The second header to be merged.
- Throws:
<tt>std::runtime_error</tt> – If the frame IDs of the input headers are different.
- Returns:
The merged header.