mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 13:38:53 +08:00
Add namespace support for uxrce-dds client during firmware upload (#25291)
This commit is contained in:
@@ -79,10 +79,16 @@ if not os.path.exists(folder_name):
|
||||
with open(args.yaml_file, 'r') as file:
|
||||
msg_map = yaml.safe_load(file)
|
||||
|
||||
# Get DDS namespace from environment, default to empty string
|
||||
namespace = os.getenv('PX4_UXRCE_DDS_NS', '')
|
||||
|
||||
merged_em_globals = {}
|
||||
all_type_includes = []
|
||||
|
||||
def process_message_type(msg_type):
|
||||
# Add namespace to topic
|
||||
msg_type['topic'] = f"/{namespace}{msg_type['topic']}" if namespace else msg_type['topic']
|
||||
|
||||
# eg TrajectoryWaypoint from px4_msgs::msg::TrajectoryWaypoint
|
||||
simple_base_type = msg_type['type'].split('::')[-1]
|
||||
|
||||
@@ -96,6 +102,8 @@ def process_message_type(msg_type):
|
||||
# topic_simple: eg vehicle_status
|
||||
msg_type['topic_simple'] = msg_type['topic'].split('/')[-1]
|
||||
|
||||
merged_em_globals['namespace'] = namespace
|
||||
|
||||
pubs_not_empty = msg_map['publications'] is not None
|
||||
if pubs_not_empty:
|
||||
for p in msg_map['publications']:
|
||||
|
||||
Reference in New Issue
Block a user