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
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Olivier Bertrand
navipy
Commits
5db0a620
Commit
5db0a620
authored
7 years ago
by
Luise Odenthal
Browse files
Options
Downloads
Patches
Plain Diff
changed renderer
parent
a799f3c8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
navipy/sensors/renderer.py
+46
-14
46 additions, 14 deletions
navipy/sensors/renderer.py
with
46 additions
and
14 deletions
navipy/sensors/renderer.py
+
46
−
14
View file @
5db0a620
...
@@ -285,24 +285,56 @@ class BlenderRender():
...
@@ -285,24 +285,56 @@ class BlenderRender():
"""
assign the position and the orientation of the camera.
"""
assign the position and the orientation of the camera.
:param posorient: is a 1x6 vector containing:
:param posorient: is a 1x6 vector containing:
x,y,z, angle_1, angle_2, angle_3,
*in case of euler angeles the index should be
[
'
location
'
][
'
x
'
]
[
'
location
'
][
'
y
'
]
[
'
location
'
][
'
z
'
]
[convention][alpha_0]
[convention][alpha_1]
[convention][alpha_2]
**where convention can be:
sxyz, sxzy, syxz, syzx, szyx, szxy
*in case of quaternions the index should be
[
'
location
'
][
'
x
'
]
[
'
location
'
][
'
y
'
]
[
'
location
'
][
'
z
'
]
[convention][
'
q_0
'
]
[convention][
'
q_1
'
]
[convention][
'
q_2
'
]
[convention][
'
q_3
'
]
**where convention can be:
quaternion
here the angles are euler rotation around the axis
here the angles are euler rotation around the axis
specified by scene.camera.rotation_mode
specified by scene.camera.rotation_mode
:type posorient:
1x6 double array
:type posorient:
pandas Series with multi-index
"""
"""
print
(
posorient
)
if
isinstance
(
posorient
,
pd
.
Series
):
if
(
isinstance
(
posorient
,
np
.
ndarray
)
or
# set roation mode
isinstance
(
posorient
,
list
)):
index
=
posorient
.
index
convention
=
index
.
get_level_values
(
0
)[
-
1
]
if
len
(
posorient
)
!=
6
:
if
convention
==
'
sxyz
'
:
raise
Exception
(
'
posorient should be a 1x6 double array
'
)
self
.
camera_rotation_mode
=
'
XYZ
'
self
.
camera
.
location
=
posorient
[:
3
]
elif
convention
==
'
syzx
'
:
self
.
camera
.
rotation_euler
=
posorient
[
3
:]
self
.
camera_rotation_mode
=
'
YZX
'
elif
isinstance
(
posorient
,
pd
.
Series
):
elif
convention
==
'
sxzy
'
:
self
.
camera_rotation_mode
=
'
XZY
'
elif
convention
==
'
syxz
'
:
self
.
camera_rotation_mode
=
'
YXZ
'
elif
convention
==
'
szxy
'
:
self
.
camera_rotation_mode
=
'
ZXY
'
elif
convention
==
'
szyx
'
:
self
.
camera_rotation_mode
=
'
ZYX
'
self
.
camera
.
location
=
\
self
.
camera
.
location
=
\
posorient
.
loc
[[
'
x
'
,
'
y
'
,
'
z
'
]].
values
posorient
.
loc
[[
'
location
'
],
[
'
x
'
,
'
y
'
,
'
z
'
]].
values
self
.
camera
.
rotation_euler
=
\
if
convention
!=
'
quaternion
'
:
posorient
.
loc
[[
'
alpha_0
'
,
'
alpha_1
'
,
'
alpha_2
'
]].
values
self
.
camera
.
rotation_euler
=
\
posorient
.
loc
[[
convention
],
[
'
alpha_0
'
,
'
alpha_1
'
,
'
alpha_2
'
]].
values
else
:
self
.
camera_rotation_mode
=
'
QUATERNION
'
self
.
camera
.
rotation_quaternion
=
\
posorient
.
loc
[[
convention
],
[
'
q_0
'
,
'
q_1
'
,
'
q_2
'
,
'
q_3
'
]].
values
else
:
else
:
raise
TypeError
(
raise
TypeError
(
'
posorient must be of type array, list, or pandas Series
'
)
'
posorient must be of type array, list, or pandas Series
'
)
...
...
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