Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
sot-talos
Commits
6be905af
Commit
6be905af
authored
Nov 16, 2018
by
Olivier Stasse
Browse files
Add files to perform servo-off.
parent
0bc47a79
Pipeline
#1880
failed with stage
in 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/publish-robot-state.py
0 → 100755
View file @
6be905af
#!/usr/bin/python
import
sys
import
rospy
from
std_srvs.srv
import
*
from
dynamic_graph_bridge.srv
import
*
from
dynamic_graph_bridge_msgs.srv
import
*
def
launchScript
(
code
,
title
,
description
=
""
):
raw_input
(
title
+
': '
+
description
)
rospy
.
loginfo
(
title
)
rospy
.
loginfo
(
code
)
for
line
in
code
:
if
line
!=
''
and
line
[
0
]
!=
'#'
:
print
line
answer
=
runCommandClient
(
str
(
line
))
rospy
.
logdebug
(
answer
)
print
answer
rospy
.
loginfo
(
"...done with "
+
title
)
# Waiting for services
try
:
rospy
.
loginfo
(
"Waiting for run_command"
)
rospy
.
wait_for_service
(
'/run_command'
)
rospy
.
loginfo
(
"...ok"
)
rospy
.
loginfo
(
"Waiting for start_dynamic_graph"
)
rospy
.
wait_for_service
(
'/start_dynamic_graph'
)
rospy
.
loginfo
(
"...ok"
)
runCommandClient
=
rospy
.
ServiceProxy
(
'run_command'
,
RunCommand
)
runCommandStartDynamicGraph
=
rospy
.
ServiceProxy
(
'start_dynamic_graph'
,
Empty
)
initCode
=
open
(
"servooff.py"
,
"r"
).
read
().
split
(
"
\n
"
)
rospy
.
loginfo
(
"Stack of Tasks launched"
)
launchScript
(
initCode
,
'Publishing robotState_ros'
)
except
rospy
.
ServiceException
,
e
:
rospy
.
logerr
(
"Service call failed: %s"
%
e
)
tests/servooff.py
0 → 100644
View file @
6be905af
from
dynamic_graph
import
plug
from
dynamic_graph.ros
import
RosPublish
robot
.
ros
=
RosPublish
(
'rosPublish'
)
robot
.
ros
.
add
(
'vector'
,
'robotState_ros'
,
'robotState'
)
plug
(
robot
.
device
.
robotState
,
robot
.
ros
.
signal
(
'robotState_ros'
))
robot
.
device
.
after
.
addDownsampledSignal
(
'rosPublish.trigger'
,
1
);
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment