Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-rbprm-corba
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
Humanoid Path Planner
hpp-rbprm-corba
Commits
ce31ce49
Commit
ce31ce49
authored
8 years ago
by
Steve Tonneau
Browse files
Options
Downloads
Patches
Plain Diff
integrating trajectory optimization method
parent
39a0cae9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!2
new release of the planner with clean demos / tutorials
,
!3
release of rbprm-corba for ijrr resubmission
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CMakeLists.txt
+1
-0
1 addition, 0 deletions
src/CMakeLists.txt
src/hpp/corbaserver/rbprm/rbprmfullbody.py
+1
-1
1 addition, 1 deletion
src/hpp/corbaserver/rbprm/rbprmfullbody.py
src/hpp/corbaserver/rbprm/tools/cwc_trajectory.py
+51
-0
51 additions, 0 deletions
src/hpp/corbaserver/rbprm/tools/cwc_trajectory.py
with
53 additions
and
1 deletion
src/CMakeLists.txt
+
1
−
0
View file @
ce31ce49
...
@@ -109,6 +109,7 @@ INSTALL(
...
@@ -109,6 +109,7 @@ INSTALL(
${
CMAKE_CURRENT_SOURCE_DIR
}
/hpp/corbaserver/rbprm/tools/__init__.py
${
CMAKE_CURRENT_SOURCE_DIR
}
/hpp/corbaserver/rbprm/tools/__init__.py
${
CMAKE_CURRENT_SOURCE_DIR
}
/hpp/corbaserver/rbprm/tools//generateROMs.py
${
CMAKE_CURRENT_SOURCE_DIR
}
/hpp/corbaserver/rbprm/tools//generateROMs.py
${
CMAKE_CURRENT_SOURCE_DIR
}
/hpp/corbaserver/rbprm/tools/plot_analytics.py
${
CMAKE_CURRENT_SOURCE_DIR
}
/hpp/corbaserver/rbprm/tools/plot_analytics.py
${
CMAKE_CURRENT_SOURCE_DIR
}
/hpp/corbaserver/rbprm/tools/cwc_trajectory.py
DESTINATION
${
PYTHON_SITELIB
}
/hpp/corbaserver/rbprm/tools
DESTINATION
${
PYTHON_SITELIB
}
/hpp/corbaserver/rbprm/tools
)
)
# Stand alone corba server
# Stand alone corba server
...
...
This diff is collapsed.
Click to expand it.
src/hpp/corbaserver/rbprm/rbprmfullbody.py
+
1
−
1
View file @
ce31ce49
...
@@ -243,7 +243,7 @@ class FullBody (object):
...
@@ -243,7 +243,7 @@ class FullBody (object):
# \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the configuration (0 by default).
# \param robustnessTreshold minimum value of the static equilibrium robustness criterion required to accept the configuration (0 by default).
def
computeContactPoints
(
self
,
stateId
):
def
computeContactPoints
(
self
,
stateId
):
rawdata
=
self
.
client
.
rbprm
.
rbprm
.
computeContactPoints
(
stateId
)
rawdata
=
self
.
client
.
rbprm
.
rbprm
.
computeContactPoints
(
stateId
)
return
[[
b
[
i
:
i
+
6
]
for
i
in
range
(
0
,
len
(
b
),
6
)]
for
b
in
rawdata
]
return
[[
b
[
i
:
i
+
3
]
for
i
in
range
(
0
,
len
(
b
),
6
)]
for
b
in
rawdata
],
[[
b
[
i
+
3
:
i
+
6
]
for
i
in
range
(
0
,
len
(
b
),
6
)]
for
b
in
rawdata
]
## Given start and goal states
## Given start and goal states
...
...
This diff is collapsed.
Click to expand it.
src/hpp/corbaserver/rbprm/tools/cwc_trajectory.py
0 → 100644
+
51
−
0
View file @
ce31ce49
from
cwc
import
cone_optimization
import
numpy
as
np
def
__get_com
(
robot
,
config
):
save
=
robot
.
getCurrentConfig
()
robot
.
setCurrentConfig
(
config
)
com
=
robot
.
getCenterOfMass
()
robot
.
setCurrentConfig
(
save
)
return
com
def
gen_trajectory
(
fullBody
,
states
,
state_id
,
mu
=
1
,
reduce_ineq
=
True
):
init_com
=
__get_com
(
fullBody
,
states
[
state_id
])
end_com
=
__get_com
(
fullBody
,
states
[
state_id
+
1
])
p
,
N
=
fullBody
.
computeContactPoints
(
state_id
)
mass
=
fullBody
.
getMass
()
t_end_phases
=
[
0
]
[
t_end_phases
.
append
(
t_end_phases
[
-
1
]
+
0.5
)
for
_
in
range
(
len
(
p
))]
print
t_end_phases
dt
=
0.1
return
cone_optimization
(
p
,
N
,
[
init_com
+
[
0
,
0
,
0
],
end_com
+
[
0
,
0
,
0
]],
t_end_phases
[
1
:],
dt
,
mu
,
mass
,
9.81
,
reduce_ineq
)
def
draw_trajectory
(
fullBody
,
states
,
state_id
,
mu
=
1
,
reduce_ineq
=
True
):
var_final
,
params
=
gen_trajectory
(
fullBody
,
states
,
state_id
,
mu
,
reduce_ineq
)
p
,
N
=
fullBody
.
computeContactPoints
(
state_id
)
print
var_final
import
numpy
as
np
from
mpl_toolkits.mplot3d
import
Axes3D
import
matplotlib.pyplot
as
plt
fig
=
plt
.
figure
()
ax
=
fig
.
add_subplot
(
111
,
projection
=
'
3d
'
)
n
=
100
points
=
var_final
[
'
x
'
]
xs
=
[
points
[
i
]
for
i
in
range
(
0
,
len
(
points
),
6
)]
ys
=
[
points
[
i
]
for
i
in
range
(
1
,
len
(
points
),
6
)]
zs
=
[
points
[
i
]
for
i
in
range
(
2
,
len
(
points
),
6
)]
ax
.
scatter
(
xs
,
ys
,
zs
,
c
=
'
b
'
)
colors
=
[
"
r
"
,
"
b
"
,
"
g
"
]
#print contact points of first phase
for
id_c
,
points
in
enumerate
(
p
):
xs
=
[
point
[
0
]
for
point
in
points
]
ys
=
[
point
[
1
]
for
point
in
points
]
zs
=
[
point
[
2
]
for
point
in
points
]
ax
.
scatter
(
xs
,
ys
,
zs
,
c
=
colors
[
id_c
])
ax
.
set_xlabel
(
'
X Label
'
)
ax
.
set_ylabel
(
'
Y Label
'
)
ax
.
set_zlabel
(
'
Z Label
'
)
plt
.
show
()
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