Herowaree

print_odom

May 3rd, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import rospy
  3. from nav_msgs.msg import Odometry
  4.  
  5. def print_odom(odom):
  6. print("x: %.2f / y: %.2f "% (odom.pose.pose.position.x, odom.pose.pose.position.y))
  7.  
  8.  
  9. rospy.init_node('print_odom')
  10.  
  11. sub = rospy.Subscriber ('/tb0/odom', Odometry, print_odom)
  12.  
  13. rospy.spin()
Advertisement
Add Comment
Please, Sign In to add comment