Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-dyninv
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
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Stack Of Tasks
sot-dyninv
Commits
17aa8b7b
Commit
17aa8b7b
authored
13 years ago
by
Nicolas Mansard
Browse files
Options
Downloads
Patches
Plain Diff
Minor modifs.
parent
6c88a6a0
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
python/dyn2openhrp.py
+44
-9
44 additions, 9 deletions
python/dyn2openhrp.py
with
44 additions
and
9 deletions
python/dyn2openhrp.py
+
44
−
9
View file @
17aa8b7b
...
...
@@ -5,6 +5,10 @@
#import random
#q=[random.random() for i in range(36)]
#q=dyn.position.value
q
=
[
0
,
0
,
0.6487
,
0
,
0
,
0
,
0
,
0
,
-
0.453786
,
0.872665
,
-
0.418879
,
0
,
0
,
0
,
-
0.453786
,
0.872665
,
-
0.418879
,
0
,
0
,
0
,
0
,
0
,
0.261799
,
-
0.174533
,
0
,
-
1.3
,
0
,
-
0.5
,
0.174533
,
0.261799
,
0.174533
,
0
,
-
1.3
,
0
,
-
0.5
,
0.174533
]
from
dynamic_graph
import
plug
from
dynamic_graph.sot.core
import
*
...
...
@@ -12,15 +16,9 @@ from dynamic_graph.sot.core.math_small_entities import Derivator_of_Matrix
from
dynamic_graph.sot.dynamics
import
*
from
dynamic_graph.sot.dyninv
import
*
import
dynamic_graph.script_shortcuts
import
math
# --- Conversion
toUT
=
PoseRollPitchYawToPoseUTheta
(
'
toUT
'
)
#plug(dyn.position,toUT.sin)
toUT
.
sin
.
value
=
tuple
(
q
[
0
:
6
])
import
math
toUT
.
sout
.
recompute
(
1
)
u
=
toUT
.
sout
.
value
[
3
:
6
]
jointNames
=
(
"
RLEG_JOINT0
"
,
"
RLEG_JOINT1
"
,
...
...
@@ -54,12 +52,17 @@ jointNames = ("RLEG_JOINT0",
"
LARM_JOINT6
"
)
pattern
=
"
<property name=
\"
%s
\"
value=
\"
%f
\"
/>
"
pattern
=
"
<property name=
\"
%s
.angle
\"
value=
\"
%f
\"
/>
"
for
i
in
range
(
len
(
q
)
-
6
):
print
pattern
%
(
jointNames
[
i
],
q
[
i
+
6
])
u
=
[
random
.
random
()
for
i
in
range
(
3
)]
toUT
=
PoseRollPitchYawToPoseUTheta
(
'
toUT
'
)
#plug(dyn.position,toUT.sin)
toUT
.
sin
.
value
=
tuple
(
q
[
0
:
6
])
toUT
.
sout
.
recompute
(
1
)
u
=
toUT
.
sout
.
value
[
3
:
6
]
theta
=
math
.
sqrt
(
sum
(
v
*
v
for
v
in
u
))
if
theta
>
1e-4
:
(
ux
,
uy
,
uz
)
=
[
v
/
theta
for
v
in
u
]
...
...
@@ -78,3 +81,35 @@ for i in range(len(bushJointNames)):
print
"
<property name=
\"
RHAND_JOINT4.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
RHAND_JOINT1.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
RHAND_JOINT3.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
RHAND_JOINT0.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
RHAND_JOINT2.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
LHAND_JOINT2.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
LHAND_JOINT1.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
LHAND_JOINT4.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
LHAND_JOINT0.angle
\"
value=
\"
0.0
\"
/>
"
print
"
<property name=
\"
LHAND_JOINT3.angle
\"
value=
\"
0.0
\"
/>
"
print
""
print
"
<property name=
\"
setupDirectory
\"
value=
\"
/opt/grx3.0/HRP2LAAS/bin
\"
/>
"
print
"
<property name=
\"
imageProcessTime
\"
value=
\"
0.033
\"
/>
"
print
"
<property name=
\"
imageProcessor
\"
value=
\"\"
/>
"
print
"
<property name=
\"
controller
\"
value=
\"
HRP2LAASControllerFactory
\"
/>
"
print
"
<property name=
\"
isRobot
\"
value=
\"
true
\"
/>
"
print
"
<property name=
\"
controlTime
\"
value=
\"
0.0010
\"
/>
"
print
"
<property name=
\"
setupCommand
\"
value=
\"
HRP2Controller$(BIN_SFX)
\"
/>
"
#import robotviewer
#viewer = robotviewer.client('XML-RPC')
#viewer.updateElementConfig('hrp',[float(val) for val in q]+10*[0.0])
posinit
=
""
for
v
in
q
[
6
:]:
posinit
+=
str
(
v
*
180
/
math
.
pi
)
+
"
"
print
"
seq.sendMsg(
\"
:joint-angles
\"
+
\"
"
+
posinit
+
"
\"
+
\"
0 0 0 0 0 0 0 0 0 0 2.5
\"
)
"
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