Repository navigation
Conversation
|
Can you ask the agent to take inspiration from #75 for moving the opencv-using interfaces in a different cmake subproject, instead of having |
Done in 785ed6b |
| * | ||
| * A signal is any stream of data of a device, for example an encoder, an IMU or a camera, | ||
| * identified by its name (e.g. the sensor name returned by the `get<Sensor>Name` methods of | ||
| * the interfaces in `MultipleAnalogSensorsInterfaces.h`). |
There was a problem hiding this comment.
A common practice is to share names across several sensors (so for example in IMU, for accelerometer, gyro and others). I think if two sensors share the name it may be a reasonable assumption that they share the producer, but it is a assumption I would explicitly document.
There was a problem hiding this comment.
Not sure I understood what you would like to be documented. Maybe it is only a bad example. If the name is exactly the same, the two methods down below will have to produce the same result. If instead the sensor names are different, but they contain a shared substring, I think there are still cases where the assumption would fail. For example, a chest IMU could be read from one board, while the chest cameras might be read from another board
76ae1bd to
c8022f3
Compare
| * this reason they share one timestamp. Use toSeconds() to convert it to a timestamp in | ||
| * seconds, for example to compare it with the one of other sensors. | ||
| */ | ||
| Stamp stamp; |
There was a problem hiding this comment.
Can we move the timestamp in ImageSample? There might be case where the images are not necessarily synchronized.
We could also keep stamp in MultipleImagesData as well to keep record of when the bundle was produced.
An helper method areSyncrhonized(std::string name1, std::string name2) (or a variadic version of this) could be provided as well if users wants to know about syncrhonization.
There was a problem hiding this comment.
The idea was that all the images retrieved are synchronized by default, so having a single stamp would have avoided confusions
| virtual Status | ||
| getImagesExtrinsics(const std::string& referenceFrameName, | ||
| std::unordered_map<std::string, cv::Matx44d>& transforms) = 0; |
There was a problem hiding this comment.
What do you think about having
getImageFrameTransform(const std::string& referenceFrameName, const std::string& frameName, cv::Matx44d& transform)
instead?
I think this would:
- Reflect better consumer's flow
- Allow for easier proxying. Rather than returning the full list of transforms, the implementor could act in some cases as a proxy to a transform server for example, or a device attached to another IMultipleImage (e.g. a Rectifier) could provide some relative transforms between some frames of the attached and some of its own
There was a problem hiding this comment.
The reason why I preferred in this way is to keep consistency with the getImages call, where all images are retrieved at once. Since the interface is supposed to provide synchronized images, also the extrinsics would need to be synchronized. I then realized that there was no way to check if the extrinsics and images are synchronized among each other, so I added the possibility to get also the stamp in 1b0ecdd
There was a problem hiding this comment.
Do you think it would be worth having a fake multiple images device and a test application for prototyping or do you want to address also this implementations in a future PR?
There was a problem hiding this comment.
Yes, this PR is only for the interfaces
traversaro
left a comment
There was a problem hiding this comment.
Go for me, I have some doubts on how ISignalProducers would work in practice, but I think it would be better to see how it is used in following PRs.
My plan was simply to have the physical devices implement this specifying an ID for the sensor, documented somewhere. This could be used to adopt other types of synchronization, for example with another interface that collects clock diffs between producers to have extra synchronization. |
ChatGPT found this C++ library that does this https://github.com/sccn/liblsl. See https://labstreaminglayer.readthedocs.io/projects/liblsl/internals/time_sync.html |
This is the first PR to address #85. In particular, it adds two interfaces:
ISignalProducers: this allows getting the information of who is producing a given signal. Can be useful for syncronization across signals (e.g. cameras and IMUs)IMultipleImages: this allows getting multiple synchronized images, their intristics and extrinsicsThis PR only adds the interfaces. NWS/NWC and interop are coming later