Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
isr_cobot
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rodrigo Ventura
isr_cobot
Commits
f677ed2d
Commit
f677ed2d
authored
May 11, 2016
by
Nuno Mendes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added feature to save waypoints as yaml file
parent
99aa98a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
rosbuild_ws/scout_map_editor/mapapp.py
rosbuild_ws/scout_map_editor/mapapp.py
+9
-0
No files found.
rosbuild_ws/scout_map_editor/mapapp.py
View file @
f677ed2d
...
@@ -590,6 +590,8 @@ class MapApp(Frame):
...
@@ -590,6 +590,8 @@ class MapApp(Frame):
try
:
try
:
if
fn
.
endswith
(
".xml"
):
if
fn
.
endswith
(
".xml"
):
self
.
savem_xml
(
fn
)
self
.
savem_xml
(
fn
)
elif
fn
.
endswith
(
".yaml"
):
self
.
savem_yaml
(
fn
)
else
:
else
:
self
.
savem_csv
(
fn
)
self
.
savem_csv
(
fn
)
except
IOError
:
except
IOError
:
...
@@ -603,6 +605,13 @@ class MapApp(Frame):
...
@@ -603,6 +605,13 @@ class MapApp(Frame):
fh
.
write
(
' <id_
%
s theta="
%
s" x="
%
s" y="
%
s"/>
\n
'
%
(
l
,
a
,
x
,
y
)
)
fh
.
write
(
' <id_
%
s theta="
%
s" x="
%
s" y="
%
s"/>
\n
'
%
(
l
,
a
,
x
,
y
)
)
fh
.
write
(
'</stargazermap>
\n
'
)
fh
.
write
(
'</stargazermap>
\n
'
)
def
savem_yaml
(
self
,
filename
):
with
open
(
filename
,
"w"
)
as
fh
:
fh
.
write
(
'navigation_goals:
\n
'
)
for
(
l
,
p
)
in
self
.
mdb
.
items
():
x
,
y
,
a
=
p
[
0
],
p
[
1
],
p
[
2
]
fh
.
write
(
'
\t
'
+
l
+
': ['
+
str
(
x
)
+
','
+
str
(
y
)
+
','
+
str
(
a
)
+
']
\n
'
)
def
savem_csv
(
self
,
filename
):
def
savem_csv
(
self
,
filename
):
with
open
(
filename
,
"w"
)
as
fh
:
with
open
(
filename
,
"w"
)
as
fh
:
for
(
l
,
p
)
in
self
.
mdb
.
items
():
for
(
l
,
p
)
in
self
.
mdb
.
items
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment