mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 06:43:34 +08:00
micrortps bridge: clean templates; add backwards compatibility; add ROS2 compatibility
This commit is contained in:
@@ -23,7 +23,7 @@ recv_topics = [(alias[idx] if alias[idx] else s.short_name) for idx, s in enumer
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
* Copyright (C) 2018-2019 PX4 Pro Development Team. All rights reserved.
|
||||
* Copyright (C) 2018-2019 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -92,7 +92,7 @@ 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]@
|
||||
@[ if 1.5 < fastrtpsgen_version <= 1.7]@
|
||||
@(topic)_ st;
|
||||
@[ else]@
|
||||
@(topic) st;
|
||||
@@ -149,7 +149,7 @@ 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]@
|
||||
@[ if 1.5 < fastrtpsgen_version <= 1.7]@
|
||||
@(topic)_ msg = _@(topic)_sub.getMsg();
|
||||
@[ else]@
|
||||
@(topic) msg = _@(topic)_sub.getMsg();
|
||||
|
||||
Reference in New Issue
Block a user