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
Show more breadcrumbs
Guilhem Saurel
sot-dyninv
Commits
d0bd2a2b
Commit
d0bd2a2b
authored
12 years ago
by
Francois Keith
Browse files
Options
Downloads
Patches
Plain Diff
Clean and comment the script ros-planche with romeo.
Add the possibility to use both viewer.
parent
2b0cc83d
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/ros/ros-planche.py
+14
-8
14 additions, 8 deletions
python/ros/ros-planche.py
with
14 additions
and
8 deletions
python/ros/ros-planche.py
+
14
−
8
View file @
d0bd2a2b
...
@@ -24,21 +24,27 @@ from dynamic_graph.sot.core.utils.attime import attime
...
@@ -24,21 +24,27 @@ from dynamic_graph.sot.core.utils.attime import attime
from
numpy
import
*
from
numpy
import
*
from
dynamic_graph.sot.dyninv.robot_specific
import
postureRange
from
dynamic_graph.sot.dyninv.robot_specific
import
postureRange
from
dynamic_graph.sot.core.matrix_util
import
matrixToTuple
,
vectorToTuple
,
rotate
,
matrixToRPY
from
dynamic_graph.sot.core.matrix_util
import
matrixToTuple
,
vectorToTuple
,
rotate
,
matrixToRPY
from
dynamic_graph.sot.core.utils.viewer_helper
import
addRobotViewer
,
VisualPinger
from
dynamic_graph.tracer
import
*
from
dynamic_graph.tracer
import
*
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# --- ROBOT SIMU -------------------------------------------------------------
# --- ROBOT SIMU -------------------------------------------------------------
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# create the robot. Use a RobotDynSimu for the integration.
from
dynamic_graph.sot.romeo.romeo
import
*
from
dynamic_graph.sot.romeo.romeo
import
*
robot
=
Robot
(
'
ro
bot
'
,
device
=
RobotDynSimu
(
'
ro
bot
'
))
robot
=
Robot
(
'
ro
meo
'
,
device
=
RobotDynSimu
(
'
ro
meo
'
))
plug
(
robot
.
device
.
state
,
robot
.
dynamic
.
position
)
plug
(
robot
.
device
.
state
,
robot
.
dynamic
.
position
)
# Binds with ROS. assert that roscore is running.
# if you prefer a ROS free installation, please comment those lines.
# Export joint_state into ros.
# Export joint_state into ros.
from
dynamic_graph.ros
import
*
from
dynamic_graph.ros
import
*
ros
=
Ros
(
robot
)
ros
=
Ros
(
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 ---------------------------------------------------------------
#----- MAIN LOOP ---------------------------------------------------------------
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
...
@@ -70,6 +76,7 @@ plug(robot.device.state, robot.dynamic.position)
...
@@ -70,6 +76,7 @@ plug(robot.device.state, robot.dynamic.position)
plug
(
robot
.
device
.
velocity
,
robot
.
dynamic
.
velocity
)
plug
(
robot
.
device
.
velocity
,
robot
.
dynamic
.
velocity
)
robot
.
dynamic
.
acceleration
.
value
=
robot
.
dimension
*
(
0.
,)
robot
.
dynamic
.
acceleration
.
value
=
robot
.
dimension
*
(
0.
,)
# set the free flyer free.
robot
.
dynamic
.
ffposition
.
unplug
()
robot
.
dynamic
.
ffposition
.
unplug
()
robot
.
dynamic
.
ffvelocity
.
unplug
()
robot
.
dynamic
.
ffvelocity
.
unplug
()
robot
.
dynamic
.
ffacceleration
.
unplug
()
robot
.
dynamic
.
ffacceleration
.
unplug
()
...
@@ -77,8 +84,6 @@ robot.dynamic.ffacceleration.unplug()
...
@@ -77,8 +84,6 @@ robot.dynamic.ffacceleration.unplug()
robot
.
dynamic
.
setProperty
(
'
ComputeBackwardDynamics
'
,
'
true
'
)
robot
.
dynamic
.
setProperty
(
'
ComputeBackwardDynamics
'
,
'
true
'
)
robot
.
dynamic
.
setProperty
(
'
ComputeAccelerationCoM
'
,
'
true
'
)
robot
.
dynamic
.
setProperty
(
'
ComputeAccelerationCoM
'
,
'
true
'
)
robot
.
device
.
control
.
unplug
()
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# --- OPERATIONAL TASKS (For HRP2-14)---------------------------------------------
# --- OPERATIONAL TASKS (For HRP2-14)---------------------------------------------
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
...
@@ -132,6 +137,8 @@ plug(robot.dynamic.inertiaReal,sot.matrixInertia)
...
@@ -132,6 +137,8 @@ plug(robot.dynamic.inertiaReal,sot.matrixInertia)
plug
(
robot
.
dynamic
.
dynamicDrift
,
sot
.
dyndrift
)
plug
(
robot
.
dynamic
.
dynamicDrift
,
sot
.
dyndrift
)
plug
(
robot
.
dynamic
.
velocity
,
sot
.
velocity
)
plug
(
robot
.
dynamic
.
velocity
,
sot
.
velocity
)
# replug the control signal
robot
.
device
.
control
.
unplug
()
plug
(
sot
.
solution
,
robot
.
device
.
control
)
plug
(
sot
.
solution
,
robot
.
device
.
control
)
#For the integration of q = int(int(qddot)).
#For the integration of q = int(int(qddot)).
...
@@ -208,11 +215,10 @@ plug(robot.device.state,sot.position)
...
@@ -208,11 +215,10 @@ plug(robot.device.state,sot.position)
q0
=
robot
.
device
.
state
.
value
q0
=
robot
.
device
.
state
.
value
rf0
=
matrix
(
taskrf
.
feature
.
position
.
value
)[
0
:
3
,
3
]
rf0
=
matrix
(
taskrf
.
feature
.
position
.
value
)[
0
:
3
,
3
]
MetaTaskDynPosture
.
postureRange
=
postureRange
[
'
romeo
'
]
MetaTaskDynPosture
.
postureRange
=
postureRange
[
'
romeo
'
]
# --- Events ---------------------------------------------
# --- Events ---------------------------------------------
# The sequence of tasks.
sigset
=
(
lambda
s
,
v
:
s
.
__class__
.
value
.
__set__
(
s
,
v
)
)
sigset
=
(
lambda
s
,
v
:
s
.
__class__
.
value
.
__set__
(
s
,
v
)
)
refset
=
(
lambda
mt
,
v
:
mt
.
__class__
.
ref
.
__set__
(
mt
,
v
)
)
refset
=
(
lambda
mt
,
v
:
mt
.
__class__
.
ref
.
__set__
(
mt
,
v
)
)
...
@@ -227,7 +233,6 @@ attime(140
...
@@ -227,7 +233,6 @@ attime(140
,(
lambda
:
gotoNd
(
taskrf
,
(
0
,
0
,
0.65
),
"
000110
"
),
"
Up foot RF
"
)
,(
lambda
:
gotoNd
(
taskrf
,
(
0
,
0
,
0.65
),
"
000110
"
),
"
Up foot RF
"
)
)
)
# Was -.8,0,.8 with full extension
attime
(
500
,
lambda
:
gotoNd
(
taskrf
,
(
-
0.55
,
0
,
0.7
),
"
000101
"
),
"
Extend RF
"
)
attime
(
500
,
lambda
:
gotoNd
(
taskrf
,
(
-
0.55
,
0
,
0.7
),
"
000101
"
),
"
Extend RF
"
)
attime
(
800
,
lambda
:
sot
.
push
(
taskChest
.
task
.
name
),
"
add chest
"
)
attime
(
800
,
lambda
:
sot
.
push
(
taskChest
.
task
.
name
),
"
add chest
"
)
...
@@ -279,7 +284,8 @@ attime(2650+tex ,(lambda: contact(contactRF) , "RF to contact" )
...
@@ -279,7 +284,8 @@ attime(2650+tex ,(lambda: contact(contactRF) , "RF to contact" )
attime
(
3200
+
tex
,
stop
)
attime
(
3200
+
tex
,
stop
)
go
()
# start the motion
# 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