Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-dynamic-pinocchio
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
Show more breadcrumbs
Stack Of Tasks
sot-dynamic-pinocchio
Commits
ee8fe675
Commit
ee8fe675
authored
11 years ago
by
Francois Keith
Browse files
Options
Downloads
Patches
Plain Diff
Add a simple kinematic test for the humanoid robot Romeo.
parent
e9eda035
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1
[major][cpp] starting point to integrate pinocchio
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
python/CMakeLists.txt
+8
-0
8 additions, 0 deletions
python/CMakeLists.txt
python/kine_romeo.py
+99
-0
99 additions, 0 deletions
python/kine_romeo.py
with
108 additions
and
0 deletions
CMakeLists.txt
+
1
−
0
View file @
ee8fe675
...
...
@@ -76,6 +76,7 @@ SEARCH_FOR_BOOST()
ADD_SUBDIRECTORY
(
include
)
ADD_SUBDIRECTORY
(
src
)
ADD_SUBDIRECTORY
(
doc
)
ADD_SUBDIRECTORY
(
python
)
ADD_SUBDIRECTORY
(
unitTesting
)
SETUP_PROJECT_FINALIZE
()
...
...
This diff is collapsed.
Click to expand it.
python/CMakeLists.txt
0 → 100644
+
8
−
0
View file @
ee8fe675
INCLUDE
(
../cmake/python.cmake
)
FINDPYTHON
()
INSTALL
(
FILES kine_romeo.py
DESTINATION
${
PYTHON_SITELIB
}
/dynamic_graph/tutorial
)
This diff is collapsed.
Click to expand it.
python/kine_romeo.py
0 → 100644
+
99
−
0
View file @
ee8fe675
# -*- coding: utf-8 -*-
# Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
#
# This file is part of dynamic-graph.
# dynamic-graph is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# dynamic-graph is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
from
dynamic_graph.sot.core.matrix_util
import
matrixToTuple
,
vectorToTuple
,
rotate
,
matrixToRPY
from
dynamic_graph.sot.core.meta_tasks_kine
import
*
from
numpy
import
*
# Create the robot romeo.
from
dynamic_graph.sot.romeo.romeo
import
*
robot
=
Robot
(
'
romeo
'
,
device
=
RobotSimu
(
'
romeo
'
))
plug
(
robot
.
device
.
state
,
robot
.
dynamic
.
position
)
# Binds with ROS. assert that roscore is running.
from
dynamic_graph.ros
import
*
ros
=
Ros
(
robot
)
# Create a simple kinematic solver.
from
dynamic_graph.sot.dynamics.solver
import
Solver
solver
=
Solver
(
robot
)
# Alternate visualization tool
from
dynamic_graph.sot.core.utils.viewer_helper
import
addRobotViewer
addRobotViewer
(
robot
.
device
,
small
=
True
,
small_extra
=
24
,
verbose
=
False
)
#-------------------------------------------------------------------------------
#----- MAIN LOOP ---------------------------------------------------------------
#-------------------------------------------------------------------------------
# define the macro allowing to run the simulation.
from
dynamic_graph.sot.core.utils.thread_interruptible_loop
import
loopInThread
,
loopShortcuts
dt
=
5e-3
@loopInThread
def
inc
():
robot
.
device
.
increment
(
dt
)
runner
=
inc
()
[
go
,
stop
,
next
,
n
]
=
loopShortcuts
(
runner
)
# ---- TASKS -------------------------------------------------------------------
# ---- TASKS -------------------------------------------------------------------
# ---- TASKS -------------------------------------------------------------------
# ---- TASK GRIP ---
# Defines a task for the right hand.
taskRH
=
MetaTaskKine6d
(
'
rh
'
,
robot
.
dynamic
,
'
right-wrist
'
,
'
right-wrist
'
)
# Move the operational point.
handMgrip
=
eye
(
4
);
handMgrip
[
0
:
3
,
3
]
=
(
0.1
,
0
,
0
)
taskRH
.
opmodif
=
matrixToTuple
(
handMgrip
)
taskRH
.
feature
.
frame
(
'
desired
'
)
# robot.tasks['right-wrist'].add(taskRH.feature.name)
# --- STATIC COM (if not walking)
robot
.
createCenterOfMassFeatureAndTask
(
'
featureCom
'
,
'
featureComDef
'
,
'
comTask
'
,
selec
=
'
011
'
,
gain
=
10
)
# --- CONTACTS
# define contactLF and contactRF
for
name
,
joint
in
[
[
'
LF
'
,
'
left-ankle
'
],
[
'
RF
'
,
'
right-ankle
'
]
]:
contact
=
MetaTaskKine6d
(
'
contact
'
+
name
,
robot
.
dynamic
,
name
,
joint
)
contact
.
feature
.
frame
(
'
desired
'
)
contact
.
gain
.
setConstant
(
10
)
contact
.
keep
()
locals
()[
'
contact
'
+
name
]
=
contact
# --- RUN ----------------------------------------------------------------------
# Move the desired position of the right hand
# 1st param: task concerned
# 2st param: objective
# 3rd param: selected parameters
# 4th param: gain
target
=
(
0.5
,
-
0.2
,
0.8
)
gotoNd
(
taskRH
,
target
,
'
111
'
,(
4.9
,
0.9
,
0.01
,
0.9
))
# Fill the stack with some tasks.
solver
.
push
(
contactRF
.
task
)
solver
.
push
(
contactLF
.
task
)
solver
.
push
(
robot
.
comTask
)
solver
.
push
(
taskRH
.
task
)
# type inc to run one iteration, or go to run indefinitely.
# go()
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