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

[jsk_data] Use different value for duration and rate in tf_to_transform.py #1509

Merged
merged 2 commits into from Mar 22, 2017

Conversation

wkentaro
Copy link
Member

Rate can be 50 - 100 for example, but duration should be ~1 [s] even so. In
previous implementation, the duration will be 1/100 - 1/50 [s] and it is
too small to resolve tf.

@wkentaro wkentaro changed the title Use different value for duration and rate in tf_to_transform.py [jsk_data] Use different value for duration and rate in tf_to_transform.py Mar 19, 2017
Rate can be 50 - 100 for example, but duration should be ~1 [s] even
so. In previous implementation, the duration will be 1/100 - 1/50 [s]
and it is too small to resolve tf.
tf.ConnectivityException,
tf.ExtrapolationException):
rospy.logerr('cannot get transform')
except Exception:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needed to be Exception

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/timer.py", line 223, in run
    self._callback(TimerEvent(last_expected, last_real, current_expected, current_real, last_duration))
  File "/home/wkentaro/Projects/jsk_apc/src/jsk-ros-pkg/jsk_common/jsk_topic_tools/scripts/tf_to_transform.py", line 32, in _publish_transform
    timeout=rospy.Duration(self.duration)
Exception: Lookup would require extrapolation into the past.  Requested time 1489937523.406011105 but the earliest data is at time 1489937523.459053278, when looking up transform from frame [right_hand_camera_rgb_optical_frame] to frame [base]. canTransform returned after 1.00738 timeout was 1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I explain why I needed this change.
Catching the Exception is not ideal solution.

@wkentaro
Copy link
Member Author

@knorth55 Please review.

@knorth55
Copy link
Member

+1

@wkentaro
Copy link
Member Author

Please merge this.

@k-okada
Copy link
Member

k-okada commented Mar 21, 2017

please list up the code that affected by this change.

@wkentaro
Copy link
Member Author

Maybe the code used by @knorth55 .

@knorth55
Copy link
Member

I made this program, and i think there is yet no one or repo using this program.
it is not that big change, and i can manage it.

parent_frame_id)
self.child_frame_id = rospy.get_param('~child_frame_id',
child_frame_id)
rate = rospy.get_param('~rate', rate)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GOOD!

@k-okada
Copy link
Member

k-okada commented Mar 22, 2017

@knorth55 : please provide link to the code using this program

@k-okada k-okada merged commit 1c879db into jsk-ros-pkg:master Mar 22, 2017
@k-okada
Copy link
Member

k-okada commented Mar 22, 2017

ok, merged, but if this code is only used one place, that is not a common program....

@knorth55
Copy link
Member

i thought it can be used in various program for logging.
maybe no one knows its existence.

@k-okada
Copy link
Member

k-okada commented Mar 22, 2017 via email

@knorth55
Copy link
Member

Im using lookupTransform in this program.

@wkentaro wkentaro deleted the rate_tf_to_transform branch March 22, 2017 13:52
@wkentaro
Copy link
Member Author

wkentaro commented Mar 22, 2017

i thought it can be used in various program for logging.
maybe no one knows its existence.

Yeah. This program is originally created for data_collection_server.py.
It should be useful for people who have motivation for learning-based approach by collecting data with robot, but there are few people who have motivation about it.

It is used at projects like:

but current active users are only me and @knorth55

@k-okada
Copy link
Member

k-okada commented Mar 22, 2017 via email

@wkentaro
Copy link
Member Author

I mean why you do not log tf data? because it becomes too large?

Because /tf cannot be subscribe for synchronizing with other message,
and this means it cannot be saved with data_collection_server.py.

ok, at least this is used in 5 different places......

Ah, actually I mean data_collection_server.py.
So this program tf_to_transform.py is only used once by his bthesis.

@k-okada
Copy link
Member

k-okada commented Mar 24, 2017

I see, another aspect of understanding '/tf' is, Although tf is pub/sub through topic, but has different layer than other topics, because it has strong tf library and the message is cached in tf client or tf2 server. So we can use tf as a very basic information layer, like on euslisp, we use coordinates as a base class of most of class definition (https://github.com/euslisp/jskeus/blob/master/irteus/irtpointcloud.l#L31)
So another design of data_collection_server was whenever it collect data, it also LookUpTransform of all necessary transforms.

@wkentaro
Copy link
Member Author

Yeah, that is the another way.
data_collection_server.py is in the early stage, so surely there will be some changes of design.

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

Successfully merging this pull request may close these issues.

None yet

3 participants