Template Function grid_map::matrixEigenCopyToMultiArrayMessage

Function Documentation

template<typename EigenType_, typename MultiArrayMessageType_>
bool grid_map::matrixEigenCopyToMultiArrayMessage(const EigenType_ &e, MultiArrayMessageType_ &m)

Copies an Eigen matrix into a ROS MultiArray message. Both column- and row-major matrices are allowed, and the type will be marked in the layout labels.

Template Parameters:
  • MultiArrayMessageType_ – a std_msgs::xxxMultiArray message (e.g. std_msgs::Float32MultiArray).

  • EigenType_ – an Eigen matrix with matching Scalar type as that of the multi-array message.

Parameters:
  • e[in] the Eigen matrix to be converted.

  • m[out] the ROS message to which the data will be copied.

Returns:

true if successful.