microRTPS: templates: only decode ros2_distro when possible and nedeed

This commit is contained in:
TSC21 2019-10-19 20:05:31 +01:00 committed by Nuno Marques
parent 981f8d5d90
commit 2930b55732
5 changed files with 21 additions and 5 deletions

View File

@ -16,7 +16,10 @@ import gencpp
from px_generate_uorb_topic_helper import * # this is in Tools/
topic = alias if alias else spec.short_name
ros2_distro = ros2_distro.decode("utf-8")
try:
ros2_distro = ros2_distro.decode("utf-8")
except AttributeError:
pass
}@
/****************************************************************************
*
@ -58,6 +61,7 @@ ros2_distro = ros2_distro.decode("utf-8")
* This file was adapted from the fastcdrgen tool.
*/
#include <fastrtps/participant/Participant.h>
#include <fastrtps/attributes/ParticipantAttributes.h>
#include <fastrtps/publisher/Publisher.h>

View File

@ -16,7 +16,10 @@ import gencpp
from px_generate_uorb_topic_helper import * # this is in Tools/
topic = alias if alias else spec.short_name
ros2_distro = ros2_distro.decode("utf-8")
try:
ros2_distro = ros2_distro.decode("utf-8")
except AttributeError:
pass
}@
/****************************************************************************
*

View File

@ -21,7 +21,10 @@ send_topics = [(alias[idx] if alias[idx] else s.short_name) for idx, s in enumer
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]
fastrtpsgen_version = fastrtpsgen_version[0]
ros2_distro = ros2_distro[0].decode("utf-8")
try:
ros2_distro = ros2_distro[0].decode("utf-8")
except AttributeError:
ros2_distro = ros2_distro[0]
}@
/****************************************************************************
*

View File

@ -16,7 +16,10 @@ import gencpp
from px_generate_uorb_topic_helper import * # this is in Tools/
topic = alias if alias else spec.short_name
ros2_distro = ros2_distro.decode("utf-8")
try:
ros2_distro = ros2_distro.decode("utf-8")
except AttributeError:
pass
}@
/****************************************************************************
*

View File

@ -16,7 +16,10 @@ import gencpp
from px_generate_uorb_topic_helper import * # this is in Tools/
topic = alias if alias else spec.short_name
ros2_distro = ros2_distro.decode("utf-8")
try:
ros2_distro = ros2_distro.decode("utf-8")
except AttributeError:
pass
}@
/****************************************************************************
*