Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
navipy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Olivier Bertrand
navipy
Commits
20d18048
Commit
20d18048
authored
6 years ago
by
Olivier Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Add tool to render along trajectory
parent
0f41d98e
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
navipy/sensors/blend_alongtraj.py
+6
-10
6 additions, 10 deletions
navipy/sensors/blend_alongtraj.py
setup.py
+2
-1
2 additions, 1 deletion
setup.py
with
8 additions
and
11 deletions
navipy/sensors/blend_alongtraj.py
+
6
−
10
View file @
20d18048
...
...
@@ -22,12 +22,12 @@ def parser_blend_alongtraj():
parser
=
argparse
.
ArgumentParser
()
arghelp
=
'
Path to the environment (.blend) in which your agent lives
'
defaultworld
=
pkg_resources
.
resource_filename
(
'
navipy
'
,
'
resources/twocylinders_world.blend
'
)
'
navipy
'
,
'
resources/corridor.blend
'
)
defaulttraj
=
pkg_resources
.
resource_filename
(
'
navipy
'
,
'
resources/corridor_traj.csv
'
)
defaultconfig
=
pkg_resources
.
resource_filename
(
'
navipy
'
,
'
resources/configs/BlenderRender.yaml
'
)
defaultoutput
=
tempfile
.
NamedTemporaryFile
().
name
defaulttraj
=
pkg_resources
.
resource_filename
(
'
navipy
'
,
'
resources/twocylinders_traj.hdf
'
)
parser
.
add_argument
(
'
--blender-world
'
,
type
=
str
,
default
=
defaultworld
,
...
...
@@ -70,7 +70,7 @@ def run(config_file, outputfile, trajfile):
renderer
=
BlenderRender
()
renderer
.
config_file
=
config_file
# Load trajectory
trajectory
=
Trajectory
().
fromfile
(
trajfile
)
trajectory
=
Trajectory
().
read_csv
(
trajfile
)
renderer
.
render_trajectory
(
outputfile
,
trajectory
)
...
...
@@ -81,11 +81,6 @@ def main():
# Fetch arguments
args
=
parser_blend_alongtraj
().
parse_args
()
# Some output
print
(
'
-----
'
)
print
(
'
Config file:
\n
{}
'
.
format
(
args
.
config_file
))
print
(
'
Blender file:
\n
{}
'
.
format
(
args
.
blender_world
))
print
(
'
Output file:
\n
{}
'
.
format
(
args
.
output_file
))
print
(
'
-----
'
)
# Create tempfile with testing code and then call blendnavipy
header
=
'
# Generated by {}
\n
'
.
format
(
sys
.
argv
[
0
])
with
tempfile
.
NamedTemporaryFile
()
as
tfile
:
...
...
@@ -107,7 +102,8 @@ def main():
tfile
.
write
(
'
sys.exit(1)
\n
'
.
encode
(
encoding
))
tfile
.
seek
(
0
)
command
=
'
blendnavipy --blender-world {} --python-script {}
'
command
=
'
blendnavipy --background
'
command
+=
'
--blender-world {} --python-script {}
'
command
=
command
.
format
(
args
.
blender_world
,
tfile
.
name
)
if
args
.
blender_command
is
not
None
:
command
+=
'
--blender-command {}
'
.
format
(
args
.
blender_command
)
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
2
−
1
View file @
20d18048
...
...
@@ -60,7 +60,8 @@ setup_dict = {'name': 'navipy',
'
blendnavipy=navipy.sensors.blendnavipy:main
'
,
'
blendunittest=navipy.sensors.blendunittest:main
'
,
'
blendongrid=navipy.sensors.blend_ongrid:main
'
,
'
blendoverlaytraj=navipy.sensors.blend_overlaytraj:main
'
'
blendoverlaytraj=navipy.sensors.blend_overlaytraj:main
'
,
'
blendalongtraj=navipy.sensors.blend_alongtraj:main
'
]},
}
...
...
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