@ -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(@(id s[0].index(topic) + 1), t_send_queue_cv, t_send_queue_mutex, t_send_queue, ns)) {
if (_@(topic)_sub.init(@(msg s[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 @(id s[0].index(topic) + 1): { // @(topic) publisher
case @(msg s[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 @(id s[0].index(topic) + 1): // @(topic) subscriber
case @(msg s[0].index(topic) + 1): // @(topic) subscriber
if (_@(topic)_sub.hasMsg()) {
@(topic)_msg_t msg = _@(topic)_sub.getMsg();