Browse Source

msg: templates: update empy contexts, required fields and license header years

master
TSC21 4 years ago committed by Nuno Marques
parent
commit
0b23679f98
  1. 2
      msg/templates/px4/ros/msg.h.em
  2. 2
      msg/templates/px4/uorb/msg.h.em
  3. 4
      msg/templates/uorb/msg.cpp.em
  4. 4
      msg/templates/uorb/msg.h.em
  5. 3
      msg/templates/uorb/uORBTopics.cpp.em
  6. 3
      msg/templates/uorb/uORBTopics.hpp.em
  7. 8
      msg/templates/uorb_microcdr/microRTPS_client.cpp.em
  8. 5
      msg/templates/uorb_microcdr/msg.cpp.em
  9. 6
      msg/templates/uorb_microcdr/msg.h.em
  10. 5
      msg/templates/uorb_microcdr/uORBTopics.cpp.em
  11. 5
      msg/templates/uorb_microcdr/uORBTopics.hpp.em
  12. 8
      msg/templates/urtps/Publisher.cpp.em
  13. 7
      msg/templates/urtps/Publisher.h.em
  14. 10
      msg/templates/urtps/RtpsTopics.cpp.em
  15. 6
      msg/templates/urtps/RtpsTopics.h.em
  16. 8
      msg/templates/urtps/Subscriber.cpp.em
  17. 7
      msg/templates/urtps/Subscriber.h.em
  18. 5
      msg/templates/urtps/microRTPS_agent.cpp.em
  19. 5
      msg/templates/urtps/microRTPS_timesync.cpp.em
  20. 5
      msg/templates/urtps/microRTPS_timesync.h.em
  21. 7
      msg/templates/urtps/msg.idl.em

2
msg/templates/px4/ros/msg.h.em

@ -14,8 +14,6 @@ @@ -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
@###############################################
/****************************************************************************
*

2
msg/templates/px4/uorb/msg.h.em

@ -14,8 +14,6 @@ @@ -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
@###############################################
/****************************************************************************
*

4
msg/templates/uorb/msg.cpp.em

@ -12,15 +12,13 @@ @@ -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

4
msg/templates/uorb/msg.h.em

@ -12,14 +12,12 @@ @@ -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

3
msg/templates/uorb/uORBTopics.cpp.em

@ -9,11 +9,10 @@ @@ -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

3
msg/templates/uorb/uORBTopics.hpp.em

@ -9,11 +9,10 @@ @@ -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

8
msg/templates/uorb_microcdr/microRTPS_client.cpp.em

@ -6,9 +6,9 @@ @@ -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) @@ -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<char>(@(ids[0].index(topic) + 1)), data_buffer, length))) {
if (0 < (read = transport_node->write(static_cast<char>(@(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 @@ -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);

5
msg/templates/uorb_microcdr/msg.cpp.em

@ -12,14 +12,11 @@ @@ -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

6
msg/templates/uorb_microcdr/msg.h.em

@ -12,14 +12,10 @@ @@ -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

5
msg/templates/uorb_microcdr/uORBTopics.cpp.em

@ -5,11 +5,6 @@ @@ -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
@###############################################
/****************************************************************************
*

5
msg/templates/uorb_microcdr/uORBTopics.hpp.em

@ -5,11 +5,6 @@ @@ -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
@###############################################
/****************************************************************************
*

8
msg/templates/urtps/Publisher.cpp.em

@ -6,9 +6,9 @@ @@ -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: @@ -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"

7
msg/templates/urtps/Publisher.h.em

@ -6,9 +6,8 @@ @@ -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: @@ -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.
*/

10
msg/templates/urtps/RtpsTopics.cpp.em

@ -6,8 +6,7 @@ @@ -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/ @@ -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 @@ -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) @@ -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) @@ -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();

6
msg/templates/urtps/RtpsTopics.h.em

@ -6,8 +6,10 @@ @@ -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

8
msg/templates/urtps/Subscriber.cpp.em

@ -6,9 +6,9 @@ @@ -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: @@ -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"

7
msg/templates/urtps/Subscriber.h.em

@ -6,9 +6,8 @@ @@ -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: @@ -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.
*/

5
msg/templates/urtps/microRTPS_agent.cpp.em

@ -6,9 +6,8 @@ @@ -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

5
msg/templates/urtps/microRTPS_timesync.cpp.em

@ -6,9 +6,8 @@ @@ -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

5
msg/templates/urtps/microRTPS_timesync.h.em

@ -6,9 +6,8 @@ @@ -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

7
msg/templates/urtps/msg.idl.em

@ -4,10 +4,15 @@ @@ -4,10 +4,15 @@
@#
@# EmPy template for generating <msg>.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:

Loading…
Cancel
Save