Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tf tree unconnected for rbcar #7

Open
karanchawla opened this issue Jun 15, 2017 · 0 comments
Open

Tf tree unconnected for rbcar #7

karanchawla opened this issue Jun 15, 2017 · 0 comments

Comments

@karanchawla
Copy link

karanchawla commented Jun 15, 2017

@RomanRobotnik I've been trying to access the base_footprint using the lookupTransform method in tf and even though my terminal shows that the link exists, like so

At time 2176.573
- Translation: [-0.750, 0.198, 0.350]
- Rotation: in Quaternion [0.000, 0.003, -0.133, 0.991]
            in RPY (radian) [0.000, 0.006, -0.268]
            in RPY (degree) [0.006, 0.332, -15.341]

Every time I try to access it via code it fails. My node that is trying to listen to the aforementioned transform is:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
import tf
import math

if __name__ == "__main__":
  rospy.init_node("tf_listener")
  #tfBuffer = tf2_ros.Buffer()
  #listener = tf2_ros.TransformListener(tfBuffer)
  listener = tf.TransformListener()
  rate = rospy.Rate(10.0)
  listener.waitForTransform("odom","base_link", rospy.Time(), rospy.Duration(4.0))
  while not rospy.is_shutdown():
    try:
      now = rospy.Time.now()
      #(trans,rot) = tfBuffer.lookup_transform('odom', 'base_footprint', now)
      listener.waitForTransform('odom', 'base_link', now, rospy.Duration(2.0))
      (trans,rot) = listener.lookupTransform('odom', 'base_link', now)
    except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
      rospy.loginfo("No transform")
      continue
    rate.sleep()

If I try to print the tf using the command evince frames.pdf I get the following image, I'm not sure why the tf is unable to make the connection odom->base_footprint->base_link
frames.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant