mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
msg: templates: update empy contexts, required fields and license header years
This commit is contained in:
parent
ffa70ac0fd
commit
0b23679f98
@ -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
|
||||
@###############################################
|
||||
/****************************************************************************
|
||||
*
|
||||
|
||||
@ -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
|
||||
@###############################################
|
||||
/****************************************************************************
|
||||
*
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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<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
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,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,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
|
||||
@###############################################
|
||||
/****************************************************************************
|
||||
*
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user