microRTPS_bridge: structural change to make possible to generate pub/sub code for multi-topics/aliased msgs

This commit is contained in:
TSC21
2019-07-26 15:05:54 +02:00
committed by Beat Küng
parent a747116eab
commit 3d9f83a4f2
23 changed files with 290 additions and 153 deletions
+4 -3
View File
@@ -17,12 +17,13 @@ import gencpp
from px_generate_uorb_topic_helper import * # this is in Tools/
from px_generate_uorb_topic_files import MsgScope # this is in Tools/
send_topics = [s.short_name for idx, s in enumerate(spec) if scope[idx] == MsgScope.SEND]
recv_topics = [s.short_name for idx, s in enumerate(spec) if scope[idx] == MsgScope.RECEIVE]
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]
}@
/****************************************************************************
*
* Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima).
* Copyright (C) 2018-2019 PX4 Pro 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:
@@ -88,7 +89,7 @@ void RtpsTopics::publish(uint8_t topic_ID, char data_buffer[], size_t len)
{
switch (topic_ID)
{
@[for topic in send_topics]@
@[for idx, topic in enumerate(send_topics)]@
case @(rtps_message_id(ids, topic)): // @(topic)
{
@(topic)_ st;