Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-talos-balance
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-talos-balance
Commits
d1a84d4b
Commit
d1a84d4b
authored
6 years ago
by
Gabriele Buondonno
Browse files
Options
Downloads
Patches
Plain Diff
[CoM stabilization] Add impulsive test
parent
452dce7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/sot_talos_balance/test/run_test_utils.py
+18
-1
18 additions, 1 deletion
python/sot_talos_balance/test/run_test_utils.py
python/sot_talos_balance/test/test_dcmZmpControl.py
+7
-0
7 additions, 0 deletions
python/sot_talos_balance/test/test_dcmZmpControl.py
with
25 additions
and
1 deletion
python/sot_talos_balance/test/run_test_utils.py
+
18
−
1
View file @
d1a84d4b
'''
This module contains utilities for running the tests
'''
'''
This module contains utilities for running the tests
.
'''
from
__future__
import
print_function
import
rospy
from
std_srvs.srv
import
*
from
dynamic_graph_bridge.srv
import
*
from
dynamic_graph_bridge_msgs.srv
import
*
from
gazebo_msgs.srv
import
ApplyBodyWrench
from
geometry_msgs.msg
import
Wrench
runCommandClient
=
rospy
.
ServiceProxy
(
'
run_command
'
,
RunCommand
)
runCommandStartDynamicGraph
=
rospy
.
ServiceProxy
(
'
start_dynamic_graph
'
,
Empty
)
...
...
@@ -71,3 +75,16 @@ def run_test(module,main,*args,**kwargs):
print
()
except
rospy
.
ServiceException
,
e
:
rospy
.
logerr
(
"
Service call failed: %s
"
%
e
)
def
apply_force
(
force
,
duration
,
body_name
=
"
talos::torso_2_link
"
):
'''
Gazebo service call for applying a force on a body.
'''
rospy
.
wait_for_service
(
'
/gazebo/apply_body_wrench
'
)
apply_body_wrench_proxy
=
rospy
.
ServiceProxy
(
'
/gazebo/apply_body_wrench
'
,
ApplyBodyWrench
)
wrench
=
Wrench
()
wrench
.
force
.
x
=
force
[
0
]
wrench
.
force
.
y
=
force
[
1
]
wrench
.
force
.
z
=
force
[
2
]
wrench
.
torque
.
x
=
0
wrench
.
torque
.
y
=
0
wrench
.
torque
.
z
=
0
apply_body_wrench_proxy
(
body_name
=
body_name
,
wrench
=
wrench
,
duration
=
rospy
.
Duration
(
duration
))
This diff is collapsed.
Click to expand it.
python/sot_talos_balance/test/test_dcmZmpControl.py
+
7
−
0
View file @
d1a84d4b
...
...
@@ -14,6 +14,8 @@ from sot_talos_balance.create_entities_utils import addTrace, dump_tracer
import
matplotlib.pyplot
as
plt
import
numpy
as
np
from
sot_talos_balance.test.run_test_utils
import
apply_force
def
main
(
robot
):
dt
=
robot
.
timeStep
;
...
...
@@ -92,6 +94,11 @@ def main(robot):
sleep
(
5.0
)
# kick the robot on the chest to test its stability
apply_force
([
-
1000.0
,
0
,
0
],
0.01
)
sleep
(
5.0
)
dump_tracer
(
robot
.
tracer
)
# --- DISPLAY
...
...
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