-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add ROS style api #3
base: master
Are you sure you want to change the base?
Conversation
Kind of hacky, but it works for now. This is just the built version of the ROS Melodic messages.
I made Robot tooltip position in the world frame:
0.10000000000000003, 0.0, 1.0
0.0, 0.7071067811865476, 0.0, 0.7071067811865475
In Euler angles: -0.0, 1.5707963267948961, 0.0
Traceback (most recent call last):
File "tiny_tf/test_transformer.py", line 98, in <module>
test_transformations(tree)
File "tiny_tf/test_transformer.py", line 67, in test_transformations
ps_new = tree.transformPose("robot_camera", ps)
File "/home/felix/tiny_tf/transformer.py", line 49, in transformPose
t = self.lookup_transform(pose_stamped.header.frame_id, target_frame)
File "/home/felix/tiny_tf/tf.py", line 76, in lookup_transform
frame_transform_to_common_parent = get_inverse_xform_for_path(frame_path_to_parent)
File "/home/felix/tiny_tf/tf.py", line 73, in get_inverse_xform_for_path
transform_to_parent = np.dot(node.transformation_matrix, transform_to_parent)
File "/home/felix/tiny_tf/tf.py", line 141, in transformation_matrix
return self.transform.matrix
File "/home/felix/tiny_tf/tf.py", line 174, in matrix
out[0, -1] = self.x
TypeError: float() argument must be a string or a number, not 'Point' |
The problem seems to come from lines 30 and 38 of the
This makes me wish for |
ROS itself uses it, so python2 compatibility is probably smart. I doubt type checking or even CI will be necessary for this. It's supposed to be tiny, right? This last commit should work, but I can't check until tomorrow. I also forgot that |
Well. I assumed that removing the genpy.Message dependance would work fine, but I guess I was mistaken. Not being able to parse from a list of arguments would make the code a lot uglier:
I guess including genpy.Message as well could do the trick, but it's starting to get awkward. Thoughts? |
From Melodic
Ok. It's super ugly, but it finally works out of the box on Mac OS X on both python3 and python2 (after installing numpy and pyyaml). Feel free to merge and make it not embarrassing. |
Do you mind if I split the messages into a separate repo? I can release it as a separate package and make it a dependency for tiny_tf. |
I don't mind at all. Feel free to tear this apart as much as you want. I really have no strong opinion as long as it's easy to use. "pip install tiny_tf" sounds as easy as it gets.
|
This PR adds a
Transformer
class with similar interfaces to the original ROSTransformListener
. This should allow much easier switching between the ROS tf library andtiny_tf
.ToDo:
geometry_msgs
folder