Comments (7)
ping ;)
from geometry2.
@tfoote ping ;)
from geometry2.
There's no significant docs. You can find examples here and here
For converting:
You write a to and from message and register them with tf2_ros.ConvertRegistration()
For transforming:
You write the function to add it and then register it using the tf2_ros.TransformRegistration()
from geometry2.
For me it is unclear why all the to_msg
and from_msg
functions can just return the same message.
I would expect that if I have class A and I want to transform to class B, but there is no direct conversion from A to B, it will use the to_msg
and from_msg
way. So I have to go from A to a msg. Lets call it X. And then convert msg X to class B.
In my mind, msg X has to be ONE type of msg. As a random pair of to_msg
and from_msg
aren't compatible, unless the to_msg
functions outputs a type, which the from_msg
functions accepts. Otherwise AttributeError are doomed to happen IMO.
Maybe I am missing something, please explain.
from geometry2.
The first example I sent isn't the best as those datatypes are already messages. So the convert to and from message is an identity transform which is why they return themselves.
For the KDL datatypes you can see a more complex version https://github.com/ros/geometry2/blob/noetic-devel/tf2_kdl/src/tf2_kdl/tf2_kdl.py
The logic is to chain the conversions if they exist via a star topology. Any datatype X trying to go to Y look to apply from_msg<Y>(to_msg(X)
. Thus if X is already a msg it can return itself.
from geometry2.
What happens in the following situations?
to_msg
returns aPointStamped
, but thefrom_msg
can only handlePoseStamped
as input.- Again
to_msg
returns aPointStamped
, but Y is a PoseStamped and itsfrom_msg
functions just returns the input msg. Just like
from geometry2.
-
The registrations are keyed on the datatype. A
Vector3Stamped
converter and aPoseStamped
converter will never be chained. -
Those the
to_msg
andfrom_msg
will not be paired like you said because they have different datatype keys.
The noop returns are required because in python we can't detect what the datatype is so we don't know if the datatype matches the input datatype. So convert
always triggers to_msg
then from_msg
to make the conversion. If either end of that goal is already a message it will be the noop.
from geometry2.
Related Issues (20)
- error: no matching function for call to βtoMsg(const Eigen::Transform<double, 3, 1>&)β HOT 1
- TransformListener x10 higher CPU load in rclpy than rclpp HOT 1
- A mistake in tf2/Tutorials HOT 2
- tf2 giving NAN values
- Release 0.6.7 never made it into Melodic distro? HOT 2
- PermissionError when using view_frames HOT 2
- Fail out of lookupTransform immediately if extrapolation into the past is required instead of waiting for timeout HOT 1
- Including tf2_geometry_msgs in a catkin package includes two versions of Eigen HOT 1
- Pose and Transform messages are redundant HOT 1
- ROS wiki tf2 tutorial page has errors
- sleep_duration of can_transform takes too much time HOT 1
- New release for Noetic HOT 13
- Wrong warning TF_REPEATED_DATA if 2 different transforms (with different frames) but same timestamp HOT 1
- tf_py.BufferCore not respecting cache_time argument HOT 2
- dotransform TransformStamped datatype not process child_frame_id HOT 2
- rostime_converter loses nanosecond precision
- Failing when Building for Humble with catkin errors
- Error while compiling using catkin for python3.8 HOT 1
- Using AngleShortestPath or getAngleShortestPath in python HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geometry2.