diff --git a/msg/templates/px4/ros/msg.h.em b/msg/templates/px4/ros/msg.h.em index 3264bbaede..e102a087d4 100644 --- a/msg/templates/px4/ros/msg.h.em +++ b/msg/templates/px4/ros/msg.h.em @@ -14,8 +14,6 @@ @# Context: @# - file_name_in (String) Source file @# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@# - md5sum (String) MD5Sum of the .msg specification -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * diff --git a/msg/templates/px4/uorb/msg.h.em b/msg/templates/px4/uorb/msg.h.em index 4b848ce361..deed11912d 100644 --- a/msg/templates/px4/uorb/msg.h.em +++ b/msg/templates/px4/uorb/msg.h.em @@ -14,8 +14,6 @@ @# Context: @# - file_name_in (String) Source file @# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@# - md5sum (String) MD5Sum of the .msg specification -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * diff --git a/msg/templates/uorb/msg.cpp.em b/msg/templates/uorb/msg.cpp.em index a462f063fd..f7451740f8 100644 --- a/msg/templates/uorb/msg.cpp.em +++ b/msg/templates/uorb/msg.cpp.em @@ -12,15 +12,13 @@ @# Context: @# - file_name_in (String) Source file @# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@# - md5sum (String) MD5Sum of the .msg specification @# - search_path (dict) search paths for genmsg @# - topics (List of String) multi-topic names @# - constrained_flash set to true if flash is constrained -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * - * Copyright (C) 2013-2016 PX4 Development Team. All rights reserved. + * Copyright (C) 2013-2021 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 diff --git a/msg/templates/uorb/msg.h.em b/msg/templates/uorb/msg.h.em index 0180ebcf0d..adc4b585fa 100644 --- a/msg/templates/uorb/msg.h.em +++ b/msg/templates/uorb/msg.h.em @@ -12,14 +12,12 @@ @# Context: @# - file_name_in (String) Source file @# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@# - md5sum (String) MD5Sum of the .msg specification @# - search_path (dict) search paths for genmsg @# - topics (List of String) multi-topic names -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * - * Copyright (C) 2013-2016 PX4 Development Team. All rights reserved. + * Copyright (C) 2013-2021 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 diff --git a/msg/templates/uorb/uORBTopics.cpp.em b/msg/templates/uorb/uORBTopics.cpp.em index bce579b1a4..b08950bb19 100644 --- a/msg/templates/uorb/uORBTopics.cpp.em +++ b/msg/templates/uorb/uORBTopics.cpp.em @@ -9,11 +9,10 @@ @# Context: @# - msgs (List) list of all msg files @# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * - * Copyright (C) 2013-2020 PX4 Development Team. All rights reserved. + * Copyright (C) 2013-2021 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 diff --git a/msg/templates/uorb/uORBTopics.hpp.em b/msg/templates/uorb/uORBTopics.hpp.em index d1d33f4816..d278f06398 100644 --- a/msg/templates/uorb/uORBTopics.hpp.em +++ b/msg/templates/uorb/uORBTopics.hpp.em @@ -9,11 +9,10 @@ @# Context: @# - msgs (List) list of all msg files @# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * - * Copyright (C) 2020 PX4 Development Team. All rights reserved. + * Copyright (C) 2021 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 diff --git a/msg/templates/uorb_microcdr/microRTPS_client.cpp.em b/msg/templates/uorb_microcdr/microRTPS_client.cpp.em index 0bc015a297..c679997a60 100644 --- a/msg/templates/uorb_microcdr/microRTPS_client.cpp.em +++ b/msg/templates/uorb_microcdr/microRTPS_client.cpp.em @@ -6,9 +6,9 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files +@# - msgs (List) list of all RTPS messages @# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @############################################### @{ import os @@ -152,7 +152,7 @@ void *send(void *args) // copy raw data into local buffer. Payload is shifted by header length to make room for header serialize_@(send_base_types[idx])(&writer, &@(topic)_data, &data_buffer[header_length], &length); - if (0 < (read = transport_node->write(static_cast(@(ids[0].index(topic) + 1)), data_buffer, length))) { + if (0 < (read = transport_node->write(static_cast(@(msgs[0].index(topic) + 1)), data_buffer, length))) { data->total_sent += read; tx_last_sec_read += read; ++data->sent; @@ -261,7 +261,7 @@ void micrortps_start_topics(const uint32_t &datarate, struct timespec &begin, ui switch (topic_ID) { @[ for idx, topic in enumerate(recv_topics)]@ - case @(ids[0].index(topic) + 1): { + case @(msgs[0].index(topic) + 1): { @(receive_base_types[idx])_s @(topic)_data; deserialize_@(receive_base_types[idx])(&reader, &@(topic)_data, data_buffer); diff --git a/msg/templates/uorb_microcdr/msg.cpp.em b/msg/templates/uorb_microcdr/msg.cpp.em index ea7251c47b..458f455f49 100644 --- a/msg/templates/uorb_microcdr/msg.cpp.em +++ b/msg/templates/uorb_microcdr/msg.cpp.em @@ -12,14 +12,11 @@ @# Context: @# - file_name_in (String) Source file @# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@# - md5sum (String) MD5Sum of the .msg specification @# - search_path (dict) search paths for genmsg -@# - topics (List of String) multi-topic names -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * - * Copyright (C) 2013-2018 PX4 Development Team. All rights reserved. + * Copyright (C) 2013-2021 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 diff --git a/msg/templates/uorb_microcdr/msg.h.em b/msg/templates/uorb_microcdr/msg.h.em index ce49dd1356..76b793ab70 100644 --- a/msg/templates/uorb_microcdr/msg.h.em +++ b/msg/templates/uorb_microcdr/msg.h.em @@ -12,14 +12,10 @@ @# Context: @# - file_name_in (String) Source file @# - spec (msggen.MsgSpec) Parsed specification of the .msg file -@# - md5sum (String) MD5Sum of the .msg specification -@# - search_path (dict) search paths for genmsg -@# - topics (List of String) multi-topic names -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * - * Copyright (C) 2013-2018 PX4 Development Team. All rights reserved. + * Copyright (C) 2013-2021 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 diff --git a/msg/templates/uorb_microcdr/uORBTopics.cpp.em b/msg/templates/uorb_microcdr/uORBTopics.cpp.em index bd7a6683ba..88dc5255d8 100644 --- a/msg/templates/uorb_microcdr/uORBTopics.cpp.em +++ b/msg/templates/uorb_microcdr/uORBTopics.cpp.em @@ -5,11 +5,6 @@ @# @############################################### @# Start of Template -@# -@# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * diff --git a/msg/templates/uorb_microcdr/uORBTopics.hpp.em b/msg/templates/uorb_microcdr/uORBTopics.hpp.em index 66090030e9..6eebd31544 100644 --- a/msg/templates/uorb_microcdr/uORBTopics.hpp.em +++ b/msg/templates/uorb_microcdr/uORBTopics.hpp.em @@ -5,11 +5,6 @@ @# @############################################### @# Start of Template -@# -@# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids @############################################### /**************************************************************************** * diff --git a/msg/templates/urtps/Publisher.cpp.em b/msg/templates/urtps/Publisher.cpp.em index 1f0e93af8c..86687f06a1 100644 --- a/msg/templates/urtps/Publisher.cpp.em +++ b/msg/templates/urtps/Publisher.cpp.em @@ -6,9 +6,9 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - fastrtps_version (str) FastRTPS version installed on the system +@# - ros2_distro (str) ROS2 distro name +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @############################################### @{ import genmsg.msgs @@ -70,7 +70,7 @@ if ros2_distro: * @@file @(topic)_Publisher.cpp * This file contains the implementation of the publisher functions. * - * This file was adapted from the fastcdrgen tool. + * This file was adapted from the fastrtpsgen tool. */ #include "@(topic)_Publisher.h" diff --git a/msg/templates/urtps/Publisher.h.em b/msg/templates/urtps/Publisher.h.em index 8efab01719..6851497d2a 100644 --- a/msg/templates/urtps/Publisher.h.em +++ b/msg/templates/urtps/Publisher.h.em @@ -6,9 +6,8 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - ros2_distro (str) ROS2 distro name +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @############################################### @{ import genmsg.msgs @@ -58,7 +57,7 @@ except AttributeError: * @@file @(topic)_Publisher.h * This header file contains the declaration of the publisher functions. * - * This file was adapted from the fastcdrgen tool. + * This file was adapted from the fastrtpsgen tool. */ diff --git a/msg/templates/urtps/RtpsTopics.cpp.em b/msg/templates/urtps/RtpsTopics.cpp.em index 3bf123bdf3..be1d8d2045 100644 --- a/msg/templates/urtps/RtpsTopics.cpp.em +++ b/msg/templates/urtps/RtpsTopics.cpp.em @@ -6,8 +6,7 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - ids (List) list of all RTPS msg ids +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @############################################### @{ import genmsg.msgs @@ -16,7 +15,6 @@ 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] }@ /**************************************************************************** * @@ -61,7 +59,7 @@ bool RtpsTopics::init(std::condition_variable *t_send_queue_cv, std::mutex *t_se std::cout << "\033[0;36m--- Subscribers ---\033[0m" << std::endl; @[for topic in recv_topics]@ - if (_@(topic)_sub.init(@(ids[0].index(topic) + 1), t_send_queue_cv, t_send_queue_mutex, t_send_queue, ns)) { + if (_@(topic)_sub.init(@(msgs[0].index(topic) + 1), t_send_queue_cv, t_send_queue_mutex, t_send_queue, ns)) { std::cout << "- @(topic) subscriber started" << std::endl; } else { @@ -120,7 +118,7 @@ void RtpsTopics::publish(const uint8_t topic_ID, char data_buffer[], size_t len) switch (topic_ID) { @[for topic in send_topics]@ - case @(ids[0].index(topic) + 1): { // @(topic) publisher + case @(msgs[0].index(topic) + 1): { // @(topic) publisher @(topic)_msg_t st; eprosima::fastcdr::FastBuffer cdrbuffer(data_buffer, len); eprosima::fastcdr::Cdr cdr_des(cdrbuffer); @@ -162,7 +160,7 @@ bool RtpsTopics::getMsg(const uint8_t topic_ID, eprosima::fastcdr::Cdr &scdr) switch (topic_ID) { @[for topic in recv_topics]@ - case @(ids[0].index(topic) + 1): // @(topic) subscriber + case @(msgs[0].index(topic) + 1): // @(topic) subscriber if (_@(topic)_sub.hasMsg()) { @(topic)_msg_t msg = _@(topic)_sub.getMsg(); diff --git a/msg/templates/urtps/RtpsTopics.h.em b/msg/templates/urtps/RtpsTopics.h.em index 597ff99b4b..b82c7b20c8 100644 --- a/msg/templates/urtps/RtpsTopics.h.em +++ b/msg/templates/urtps/RtpsTopics.h.em @@ -6,8 +6,10 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - ids (List) list of all RTPS msg ids +@# - fastrtps_version (List[str]) FastRTPS version installed on the system +@# - package (List[str]) messages package name. Defaulted to 'px4' +@# - ros2_distro (List[str]) ROS2 distro name +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @############################################### @{ import genmsg.msgs diff --git a/msg/templates/urtps/Subscriber.cpp.em b/msg/templates/urtps/Subscriber.cpp.em index 7fc2a8c31c..ab0c5f2d82 100644 --- a/msg/templates/urtps/Subscriber.cpp.em +++ b/msg/templates/urtps/Subscriber.cpp.em @@ -6,9 +6,9 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - fastrtps_version (str) FastRTPS version installed on the system +@# - ros2_distro (str) ROS2 distro name +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @############################################### @{ import genmsg.msgs @@ -69,7 +69,7 @@ if ros2_distro: * @@file @(topic)_Subscriber.cpp * This file contains the implementation of the subscriber functions. * - * This file was adapted from the fastcdrgen tool. + * This file was adapted from the fastrtpsgen tool. */ #include "@(topic)_Subscriber.h" diff --git a/msg/templates/urtps/Subscriber.h.em b/msg/templates/urtps/Subscriber.h.em index afd40ae964..703112bef3 100644 --- a/msg/templates/urtps/Subscriber.h.em +++ b/msg/templates/urtps/Subscriber.h.em @@ -6,9 +6,8 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - ros2_distro (str) ROS2 distro name +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @############################################### @{ import genmsg.msgs @@ -58,7 +57,7 @@ except AttributeError: * @@file @(topic)_Subscriber.h * This header file contains the declaration of the subscriber functions. * - * This file was adapted from the fastcdrgen tool. + * This file was adapted from the fastrtpsgen tool. */ diff --git a/msg/templates/urtps/microRTPS_agent.cpp.em b/msg/templates/urtps/microRTPS_agent.cpp.em index b04f3fc0b2..acbb01e302 100644 --- a/msg/templates/urtps/microRTPS_agent.cpp.em +++ b/msg/templates/urtps/microRTPS_agent.cpp.em @@ -6,9 +6,8 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file +@# - ros2_distro (List[str]) ROS2 distro name @############################################### @{ import genmsg.msgs diff --git a/msg/templates/urtps/microRTPS_timesync.cpp.em b/msg/templates/urtps/microRTPS_timesync.cpp.em index 26c8336b51..a441339fb1 100644 --- a/msg/templates/urtps/microRTPS_timesync.cpp.em +++ b/msg/templates/urtps/microRTPS_timesync.cpp.em @@ -6,9 +6,8 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - package (List[str]) messages package name. Defaulted to 'px4' +@# - ros2_distro (List[str]) ROS2 distro name @############################################### @{ import genmsg.msgs diff --git a/msg/templates/urtps/microRTPS_timesync.h.em b/msg/templates/urtps/microRTPS_timesync.h.em index 6cb25ae5c5..ffe4541f18 100644 --- a/msg/templates/urtps/microRTPS_timesync.h.em +++ b/msg/templates/urtps/microRTPS_timesync.h.em @@ -6,9 +6,8 @@ @# Start of Template @# @# Context: -@# - msgs (List) list of all msg files -@# - multi_topics (List) list of all multi-topic names -@# - ids (List) list of all RTPS msg ids +@# - package (List[str]) messages package name. Defaulted to 'px4' +@# - ros2_distro (List[str]) ROS2 distro name @############################################### @{ import genmsg.msgs diff --git a/msg/templates/urtps/msg.idl.em b/msg/templates/urtps/msg.idl.em index 1f9c71032e..1fa20e3fe6 100644 --- a/msg/templates/urtps/msg.idl.em +++ b/msg/templates/urtps/msg.idl.em @@ -4,10 +4,15 @@ @# @# EmPy template for generating .idl files @# +@############################################### +@# Start of Template +@# +@# Context: +@# - spec (msggen.MsgSpec) Parsed specification of the .msg file @################################################################################ @# @# Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima). -@# Copyright (c) 2018-2019 PX4 Development Team. All rights reserved. +@# Copyright (c) 2018-2021 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: