first push on supporting ROS2 Dashing and IDL 4.2

This commit is contained in:
TSC21
2019-09-09 12:39:39 +01:00
committed by Nuno Marques
parent f885d2274a
commit 278d2fd21f
12 changed files with 152 additions and 54 deletions

View File

@@ -92,7 +92,11 @@ void RtpsTopics::publish(uint8_t topic_ID, char data_buffer[], size_t len)
@[for topic in send_topics]@
case @(rtps_message_id(ids, topic)): // @(topic)
{
@[ if ros2_distro == "ardent" or ros2_distro == "bouncy" or ros2_distro == "crystal" and float(fastrtps_version) < 1.9]@
@(topic)_ st;
@[ else]@
@(topic) st;
@[ end if]@
eprosima::fastcdr::FastBuffer cdrbuffer(data_buffer, len);
eprosima::fastcdr::Cdr cdr_des(cdrbuffer);
st.deserialize(cdr_des);
@@ -145,7 +149,11 @@ bool RtpsTopics::getMsg(const uint8_t topic_ID, eprosima::fastcdr::Cdr &scdr)
case @(rtps_message_id(ids, topic)): // @(topic)
if (_@(topic)_sub.hasMsg())
{
@[ if ros2_distro == "ardent" or ros2_distro == "bouncy" or ros2_distro == "crystal" and float(fastrtps_version) < 1.9]@
@(topic)_ msg = _@(topic)_sub.getMsg();
@[ else]@
@(topic) msg = _@(topic)_sub.getMsg();
@[ end if]@
msg.serialize(scdr);
ret = true;
}