Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
28521ea7
Commit
28521ea7
authored
6 years ago
by
TSC21
Committed by
Beat Küng
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
move parse_yaml_msg_id_file() definition to generate_microRTPS_bridge.py
parent
a50fed1b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
msg/tools/generate_microRTPS_bridge.py
+20
-2
20 additions, 2 deletions
msg/tools/generate_microRTPS_bridge.py
msg/tools/px_generate_uorb_topic_helper.py
+0
-20
0 additions, 20 deletions
msg/tools/px_generate_uorb_topic_helper.py
with
20 additions
and
22 deletions
msg/tools/generate_microRTPS_bridge.py
+
20
−
2
View file @
28521ea7
...
...
@@ -47,6 +47,11 @@ import px_generate_uorb_topic_helper
import
subprocess
import
glob
import
errno
try
:
import
yaml
except
ImportError
:
raise
ImportError
(
"
Failed to import yaml. You may need to install it with
'
sudo pip install pyyaml
'"
)
def
get_absolute_path
(
arg_parse_dir
):
...
...
@@ -63,6 +68,20 @@ def get_absolute_path(arg_parse_dir):
return
dir
def
parse_yaml_msg_id_file
(
yaml_file
):
"""
Parses a yaml file into a dict
"""
try
:
with
open
(
yaml_file
,
'
r
'
)
as
f
:
return
yaml
.
load
(
f
)
except
OSError
as
e
:
if
e
.
errno
==
errno
.
ENOENT
:
raise
IOError
(
errno
.
ENOENT
,
os
.
strerror
(
errno
.
ENOENT
),
yaml_file
)
else
:
raise
default_client_out
=
get_absolute_path
(
"
src/modules/micrortps_bridge/micrortps_client
"
)
default_agent_out
=
get_absolute_path
(
...
...
@@ -186,8 +205,7 @@ if agent and os.path.isdir(os.path.join(agent_out_dir, "idl")):
uorb_templates_dir
=
os
.
path
.
join
(
msg_folder
,
args
.
uorb_templates
)
urtps_templates_dir
=
os
.
path
.
join
(
msg_folder
,
args
.
urtps_templates
)
# parse yaml file into a map of ids
rtps_ids
=
px_generate_uorb_topic_helper
.
parse_yaml_msg_id_file
(
os
.
path
.
join
(
msg_folder
,
args
.
yaml_file
))
rtps_ids
=
parse_yaml_msg_id_file
(
os
.
path
.
join
(
msg_folder
,
args
.
yaml_file
))
uRTPS_CLIENT_TEMPL_FILE
=
'
microRTPS_client.cpp.template
'
...
...
This diff is collapsed.
Click to expand it.
msg/tools/px_generate_uorb_topic_helper.py
+
0
−
20
View file @
28521ea7
...
...
@@ -41,11 +41,6 @@ precompiled and thus message generation will be much faster
import
os
import
errno
try
:
import
yaml
except
ImportError
:
raise
ImportError
(
"
Failed to import yaml. You may need to install it with
'
sudo pip install pyyaml
"
)
import
genmsg.msgs
import
gencpp
...
...
@@ -351,21 +346,6 @@ def print_field_def(field):
print
(
'
\t
%s%s%s %s%s;%s
'
%
(
type_prefix
,
type_px4
,
type_appendix
,
field
.
name
,
array_size
,
comment
))
def
parse_yaml_msg_id_file
(
yaml_file
):
"""
Parses a yaml file into a dict
"""
try
:
with
open
(
yaml_file
,
'
r
'
)
as
f
:
return
yaml
.
load
(
f
)
except
OSError
as
e
:
if
e
.
errno
==
errno
.
ENOENT
:
raise
IOError
(
errno
.
ENOENT
,
os
.
strerror
(
errno
.
ENOENT
),
yaml_file
)
else
:
raise
def
rtps_message_id
(
msg_id_map
,
message
):
"""
Get RTPS ID of uORB message
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment