Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic_graph_bridge
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
dynamic_graph_bridge
Commits
115d730c
Commit
115d730c
authored
2 years ago
by
Guilhem Saurel
Browse files
Options
Downloads
Patches
Plain Diff
fix syntax
parent
b7a19578
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/tf_publisher
+12
-10
12 additions, 10 deletions
scripts/tf_publisher
with
12 additions
and
10 deletions
scripts/tf_publisher
+
12
−
10
View file @
115d730c
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
# through dynamic_graph_bridge.
# through dynamic_graph_bridge.
#
#
import
logging
import
rospy
import
rospy
import
tf
import
tf
...
@@ -13,15 +15,15 @@ import geometry_msgs.msg
...
@@ -13,15 +15,15 @@ import geometry_msgs.msg
def
main
():
def
main
():
rospy
.
init_node
(
'
tf_publisher
'
,
anonymous
=
True
)
rospy
.
init_node
(
"
tf_publisher
"
,
anonymous
=
True
)
frame
=
rospy
.
get_param
(
'
~frame
'
,
''
)
frame
=
rospy
.
get_param
(
"
~frame
"
,
""
)
childFrame
=
rospy
.
get_param
(
'
~child_frame
'
,
''
)
childFrame
=
rospy
.
get_param
(
"
~child_frame
"
,
""
)
topic
=
rospy
.
get_param
(
'
~topic
'
,
''
)
topic
=
rospy
.
get_param
(
"
~topic
"
,
""
)
rateSeconds
=
rospy
.
get_param
(
'
~rate
'
,
5
)
rateSeconds
=
rospy
.
get_param
(
"
~rate
"
,
5
)
if
not
frame
or
not
childFrame
or
not
topic
:
if
not
frame
or
not
childFrame
or
not
topic
:
log
py
.
error
(
"
frame, childFrame and topic are required parameters
"
)
log
ging
.
error
(
"
frame, childFrame and topic are required parameters
"
)
return
return
rate
=
rospy
.
Rate
(
rateSeconds
)
rate
=
rospy
.
Rate
(
rateSeconds
)
...
@@ -35,11 +37,10 @@ def main():
...
@@ -35,11 +37,10 @@ def main():
ok
=
False
ok
=
False
while
not
rospy
.
is_shutdown
()
and
not
ok
:
while
not
rospy
.
is_shutdown
()
and
not
ok
:
try
:
try
:
tl
.
waitForTransform
(
childFrame
,
frame
,
tl
.
waitForTransform
(
childFrame
,
frame
,
rospy
.
Time
(),
rospy
.
Duration
(
0.1
))
rospy
.
Time
(),
rospy
.
Duration
(
0.1
))
ok
=
True
ok
=
True
except
tf
.
Exception
,
e
:
except
tf
.
Exception
:
rospy
.
log
warn
(
"
waiting for tf transform
"
)
logging
.
warn
ing
(
"
waiting for tf transform
"
)
ok
=
False
ok
=
False
while
not
rospy
.
is_shutdown
():
while
not
rospy
.
is_shutdown
():
...
@@ -60,4 +61,5 @@ def main():
...
@@ -60,4 +61,5 @@ def main():
pub
.
publish
(
transform
)
pub
.
publish
(
transform
)
rate
.
sleep
()
rate
.
sleep
()
main
()
main
()
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