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
764883ac
Commit
764883ac
authored
11 years ago
by
Benjamin Coudrin
Committed by
Francois Keith
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add a script to publish JointState to TF
parent
370408d7
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
scripts/robot_pose_publisher
+32
-0
32 additions, 0 deletions
scripts/robot_pose_publisher
with
32 additions
and
0 deletions
scripts/robot_pose_publisher
0 → 100755
+
32
−
0
View file @
764883ac
#!/usr/bin/env python
#
# Listens to TransformStamped messages and publish them to tf
#
import
roslib
roslib
.
load_manifest
(
'
dynamic_graph_bridge
'
)
import
rospy
import
tf
#import geometry_msgs.msg
import
sensor_msgs.msg
frame
=
''
childFrame
=
''
def
pose_broadcaster
(
msg
):
translation
=
msg
.
position
[
0
:
3
];
rotation
=
tf
.
transformations
.
quaternion_from_euler
(
msg
.
position
[
3
],
msg
.
position
[
4
],
msg
.
position
[
5
])
tfbr
=
tf
.
TransformBroadcaster
()
tfbr
.
sendTransform
(
translation
,
rotation
,
rospy
.
Time
.
now
(),
childFrame
,
frame
)
if
__name__
==
'
__main__
'
:
rospy
.
init_node
(
'
robot_pose_publisher
'
,
anonymous
=
True
)
frame
=
rospy
.
get_param
(
'
~frame
'
,
'
odom
'
)
childFrame
=
rospy
.
get_param
(
'
~child_frame
'
,
'
base_link
'
)
topic
=
rospy
.
get_param
(
'
~topic
'
,
'
joint_states
'
)
rospy
.
Subscriber
(
topic
,
sensor_msgs
.
msg
.
JointState
,
pose_broadcaster
)
rospy
.
spin
()
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