mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 09:26:25 +08:00
microRTPS: templates: fix support for ROS2 Dashing
This commit is contained in:
@@ -19,6 +19,9 @@ from px_generate_uorb_topic_files import MsgScope # this is in Tools/
|
||||
|
||||
send_topics = [(alias[idx] if alias[idx] else s.short_name) for idx, s in enumerate(spec) if scope[idx] == MsgScope.SEND]
|
||||
recv_topics = [(alias[idx] if alias[idx] else s.short_name) for idx, s in enumerate(spec) if scope[idx] == MsgScope.RECEIVE]
|
||||
package = package[0]
|
||||
fastrtpsgen_version = fastrtpsgen_version[0]
|
||||
ros2_distro = ros2_distro[0].decode("utf-8")
|
||||
}@
|
||||
/****************************************************************************
|
||||
*
|
||||
@@ -92,15 +95,15 @@ 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 1.5 <= fastrtpsgen_version[0] <= 1.7]@
|
||||
@[ if ros2_distro[0]]@
|
||||
@(package[0])::msg::dds_::@(topic)_ st;
|
||||
@[ if 1.5 <= fastrtpsgen_version <= 1.7]@
|
||||
@[ if ros2_distro]@
|
||||
@(package)::msg::dds_::@(topic)_ st;
|
||||
@[ else]@
|
||||
@(topic)_ st;
|
||||
@[ end if]@
|
||||
@[ else]@
|
||||
@[ if ros2_distro[0]]@
|
||||
@(package[0])::msg::@(topic) st;
|
||||
@[ if ros2_distro]@
|
||||
@(package)::msg::@(topic) st;
|
||||
@[ else]@
|
||||
@(topic) st;
|
||||
@[ end if]@
|
||||
@@ -157,15 +160,15 @@ bool RtpsTopics::getMsg(const uint8_t topic_ID, eprosima::fastcdr::Cdr &scdr)
|
||||
case @(rtps_message_id(ids, topic)): // @(topic)
|
||||
if (_@(topic)_sub.hasMsg())
|
||||
{
|
||||
@[ if 1.5 <= fastrtpsgen_version[0] <= 1.7]@
|
||||
@[ if ros2_distro[0]]@
|
||||
@(package[0])::msg::dds_::@(topic)_ msg = _@(topic)_sub.getMsg();
|
||||
@[ if 1.5 <= fastrtpsgen_version <= 1.7]@
|
||||
@[ if ros2_distro]@
|
||||
@(package)::msg::dds_::@(topic)_ msg = _@(topic)_sub.getMsg();
|
||||
@[ else]@
|
||||
@(topic)_ msg = _@(topic)_sub.getMsg();
|
||||
@[ end if]@
|
||||
@[ else]@
|
||||
@[ if ros2_distro[0]]@
|
||||
@(package[0])::msg::@(topic) msg = _@(topic)_sub.getMsg();
|
||||
@[ if ros2_distro]@
|
||||
@(package)::msg::@(topic) msg = _@(topic)_sub.getMsg();
|
||||
@[ else]@
|
||||
@(topic) msg = _@(topic)_sub.getMsg();
|
||||
@[ end if]@
|
||||
|
||||
Reference in New Issue
Block a user