As far as I understand, Message::set_string is a tool to fill string fields in messages. I tried using it to fill vendor_name and model_name in CAMERA_INFORMATION, and it looks like it's supposed to be done like this:
mavlink::common::msg::CAMERA_INFORMATION resp_msg{};
mavlink::set_string(resp_msg.vendor_name, std::string("Vendor Name"));
mavlink::set_string(resp_msg.model_name, std::string("Model Name"));
However, it does not work, because vendor_name and model_name in CAMERA_INFORMATION are both of type std::array<unsigned char, 32>&, while set_string needs its first argument to be std::array<char, _N> &a (i.e. unsigned char vs. char).
Shouldn't set_string accept std::array<unsigned char, _N> as well?
As far as I understand,
Message::set_stringis a tool to fill string fields in messages. I tried using it to fillvendor_nameandmodel_nameinCAMERA_INFORMATION, and it looks like it's supposed to be done like this:However, it does not work, because
vendor_nameandmodel_nameinCAMERA_INFORMATIONare both of typestd::array<unsigned char, 32>&, whileset_stringneeds its first argument to bestd::array<char, _N> &a(i.e.unsigned charvs.char).Shouldn't
set_stringacceptstd::array<unsigned char, _N>as well?