Open3DMotionGroup / Open3DMotion

Other
5 stars 2 forks source link

Support for reading lists of BSONObjectId from motion bundles #15

Closed drjrm closed 6 years ago

drjrm commented 6 years ago

Motion bundles contain BSON data whose JSON representation looks like: { ... "m" : { "a" : [ { "$oid" : "59f0891f25cad79185c89780" }, { "$oid" : "59f0892625cad79187c89780" } ], ... } ... }

If we try to read such data using: Open3DMotion::BSONReaderMOBL reader(stream_bson, memfactory); reader.ReadDocument(datatree); then it results in the a key being ignored, because it does not conform to the expected content of a list. Although BSON object ID objects are supported, lists are expected to begin with a string identifying the name tag to use for list entries, in case the list needs to be exported as XML. Since this list has no such string entry it is ignored.

Can the reader be modified to allow reading of this list somehow? Ideally it should be done in such a way that when written back to BSON it reproduces the original content.

drjrm commented 6 years ago

Tests added in 69922e9de7c56e0ae139b71347dff9a2882383b7.