-
Notifications
You must be signed in to change notification settings - Fork 74
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
use uuid_in tracking ID. #25
Comments
It is unnecessary to read UUID by human. |
@Kukanani said that string is flexible. |
If you use UUID in tracking_id, vision_msgs users process data from multiple trackers very very easily. |
So, I think we should use UUID in tracking field. |
We should not use UUID. A string has the benefits already described in my last comparison. The most compelling reason for UUID is that it uses less space in the msg and it is faster to deserialise because it is a number. Another benefit is, that UUID are almost guaranteed to be different when generated on different hosts without coordination. |
@mistermult I think the benefit of the vision_msgs is it enables to use all nodes using vision_msgs each other. |
If we use vision_msgs in multiple sensor systems, we use multiple tracking nodes. |
Sure, tracking_id of type string does not guarantee that nodes make unique IDs. However, some nodes might want to guarantee uniqueness in other (faster) ways, e.g. by using an internal counter. Other nodes, might want to reference a global database, which is not possible with UUIDs. @hakuturu583 Please explain: Why is it not possible to make strings out of UUIDs in your application? What are the drawbacks of this solution. |
@mistermult If we use string in tracking_id field, someone use this field as UUID, other people use this field as other format. |
I am now making a benchmark code of UUID generation. |
I'm just an observer here, but if I understand @mistermult correctly, he suggests that even though ID is a A field typed to be a re: uniqueness: it is true that UUID guarantee uniqueness, which is something that cannot be guaranteed necessarily with arbitrary strings. Using the node name as a prefix/ns for each ID coming out of a specific node could already help though (but just making this up right now). In the end all that is needed is some way of being able to compare ID fields, which should be possible with both UUIDs and |
I understand string can perform UUID. |
prefix and namespace is good idea, but it cannot prevent this risk completely. |
I write test code like below.
|
can you clarify which "own way" would be a problem in your opinion? Any string could be used as an ID. What we lose with |
In my mac book air, I can generate single UUID in 0.47 micro seconds. |
If we allow to use String in tracking ID field, each tracking algorithum developer use this field freely. Jhon "I set UUID to the trackin_id field" It causes problem when we want to integrate them and build complex sensor fusion system. |
If we use uuid_msg in tracking_id field, developer can know the field should be represented by UUID clearly. |
There are two requirements on tracking_id's:
It is true that setting the type to UUID makes it likely that each developer generates a fresh UUID, so no collisions occur. If we allow strings, a programmer that converts UUIDs to strings is still sure that he uses fresh unique IDs because other nodes that do not UUIDs are very unlikely to use the exact format of UUIds (format something like: ####-######-#####). So it's a matter of taste: If we want to encode everything in the type system, we should use UUIDs. If we want more flexibility, use strings. I prefer the latter for the aforementioned reasons. I have some modules in python without any types and my system does not crash. Even in C++ not all constraints are modeled in the type system. |
I understand @hakuturu583 's point: If you have multiple distributed trackers, and you want to aggregate all the different tracks from different topics, it is nice to have UUIDs that are guaranteed to be unique across all topics. However, I still prefer strings for all the reasons discussed before (here and in #18). I believe an aggregating node should expect IDs to be unique per topic; if it aggregates multiple topics, it should prefix the IDs with the topic name (or something along those lines). |
@hakuturu583 wrote:
I understand what you're saying (and I expected this rationale), but if the ID field's task is to provide a unique identifier, it wouldn't seem to matter what it is set to exactly, as long as it is consistent and unique. Any string could be made unique. Consumers of msgs could treat the ID field as an opaque blob/cookie/sequence-of-bytes: they could still be unique, be used as an identifier but would no longer need to be a UUID necessarily. Would it matter whether Would there be problems if I keep using @hakuturu583 wrote:
Do you expect developers/msg consumers to introspect the ID field, instead of just using it as an opaque identifier? Note: I'm not a stakeholder here, just an observer. I typically prefer type-safety over convenience (so UUIDs over plain If we would use UUIDs to encode class then I would see a need for a strongly-typed field, but unless I'm misunderstanding, that is not the case here, correct? |
@gavanderhoorn : You still didn't 100% understand the point raised by @hakuturu583. Maybe an example helps to clarify it: If you have two different publishers, both of them could set the id of an object to However, if we were to use the UUID messages, it is practically guaranteed that there will not be two different tracking_ids set to In short, without UUIDs, there can be name clashes, but only between different nodes. This is why I think this is an edge case that should be handled differently, and we should keep using strings. |
I believe I did understand, but didn't articulate my comment sufficiently. I realise that UUIDs guarantee uniquess, even across different nodes, machines, etc and arbitrary strings do not. The situation would seem somewhat similar to TF, where |
I see where you are coming from @hakuturu583, and I also understand @mintar's clarification, but I maintain that a flexible string representation is better in terms of usability, and also doesn't add extra dependencies for all package users. The usability gain of using universally-understood If you would like to maintain a unique internal representation, UUID v3 or v5 can be used to convert + (or similar) into a UUID. I agree that UUIDs are quick to generate but speed was never a primary concern here. |
@Kukanani How do you treat batting of the tracking_id from multiple trackers which made by multiple developers. |
I think the compatibility is the most important thing in ROS package. |
There is uuid generator in uuid_msgs.(https://github.com/ros-geographic-info/unique_identifier/blob/master/unique_id/include/unique_id/unique_id.h) Using this generator and if we write which generater should be used in message comment, we can avoid conflict of the tracking_id. |
I really afraid that if we use string in the tracking ID format, people use this filed as they like. |
You say only two, but if we want to build complex sensor fusion system such as 3 cameras and 2 lidars like autonomous driving vehicle, the batting problem become much more complex. |
OK, sorry for assuming you didn't. :) |
@mistermult I think adding namespace and restriction to the tracking ID is good idea.(#25 (comment)) |
@hakuturu583 wrote :
By "batting" you mean conflicting / colliding?
Using UUIDs makes this specific problem easier to handle, at the cost of making other problems more difficult. For example, with strings, you can reuse IDs that your tracker or other software (like MoveIt) is already using. This seems to me a more common use case than aggregating multiple trackers by simply throwing all their messages together. Therefore, I prefer string. There are ways for you to handle your problem even if we keep strings:
|
right, after that I call conflicting. |
We can convert UUID to String very easily, so I think you should convert them into String after you subscribe UUID in other nodes. |
I think this is good, but I recommend to add tracking_namespace field if you want to use String.
Republishing data is just a useless process and it makes the system complex more than necessary. |
I'm voting for string. |
@hakuturu583 I'd appreciate it if you'd respond using one message rather than a chain of messages, it breaks up the dialogue and takes up visual space, making it hard to follow the flow of conversation. Taking all this into account, I'm going to keep the tracking_id as a string. Although please note that I will soon be moving the recently merged PRs off of As for the recent comments:
Counterpoint: We can convert String to UUID very easily, so I think you should convert them into UUID after you receive them. If UUID benefits your use case there are multiple methods of creating a unique UUID based on side information, some of which have been listed in this thread. By enforcing UUID, we are adding dependencies and also essentially requiring that everyone use a set of boilerplate code to use the tracking_id field. This is unacceptable to me. Personally I would not want to have to go to the trouble while writing my own node. I already find it annoying enough to have to remember to set w = 1 in every quaternion.
It is still unnecessary. You can use the fully-qualified topic name as the namespace, for example.
The goal is not to build complex pipelines more easily, the goal is to standardize usage and make a message structure that works for multiple use cases. Many vision pipelines are simple. |
I agree with sometimes boilerplate code annoying me.
Namespace should be splited by ROS message field.
Why do you think we are not necessary to standardize the usage of tracking_id node. |
If we all agree to use a string and the field is encoded as a string, then it is standardized. At this point we're just rehashing the same arguments over and over. If any new information comes to light then I'll consider it when the time comes. Thanks for the discussion! |
I still strong disagree with using string. |
String is not "standardized". |
In order to discuss more in open Isses.
I made this Issue.
I add tracking field in Detection2D.
I understand the human readable, but I strongly disagree with use string in tracking ID field.
I have oppositions about these issues.
The text was updated successfully, but these errors were encountered: