You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eprosima::fastrtps::types::DynamicData_ptr data = dit->second;
SampleInfo info;
if (reader->take_next_sample(data.get(), &info) == ReturnCode_t::RETCODE_OK)
{
if (info.instance_state == ALIVE_INSTANCE_STATE)
{
eprosima::fastrtps::types::DynamicType_ptr type = subscriber_->readers_[reader];
this->n_samples++;
std::cout << "Received data of type " << type->get_name() << std::endl;
// eprosima::fastrtps::types::DynamicDataHelper::print(data);
}
}
Through DataReader Dynamic Topic type and DynamicData can be derived. Use eprosima::fastrtps::types::DynamicDataHelper can print data. In the soure code of eprosima::fastrtps::types::DynamicDataHelper is easily to parse the DynamicData since its a friend class of class eprosima::fastrtps::types::DynamicData. How to parse the DynamicData by myself without friend class?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Through DataReader Dynamic Topic type and DynamicData can be derived. Use
eprosima::fastrtps::types::DynamicDataHelper
can print data. In the soure code ofeprosima::fastrtps::types::DynamicDataHelper
is easily to parse the DynamicData since its a friend class of classeprosima::fastrtps::types::DynamicData
. How to parse the DynamicData by myself without friend class?Beta Was this translation helpful? Give feedback.
All reactions