mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-20 20:03:54 +08:00
microRTPS: templates: only decode ros2_distro when possible and nedeed
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
}@
|
||||
/****************************************************************************
|
||||
*
|
||||
|
||||
@@ -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]
|
||||
}@
|
||||
/****************************************************************************
|
||||
*
|
||||
|
||||
@@ -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
|
||||
}@
|
||||
/****************************************************************************
|
||||
*
|
||||
|
||||
@@ -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
|
||||
}@
|
||||
/****************************************************************************
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user