-
Notifications
You must be signed in to change notification settings - Fork 342
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 new KinBody::ExtraGeometryInfo struture for KinBody::Link::_mapExtraGeometries #1441
base: production
Are you sure you want to change the base?
Conversation
just to comment, he is zirui.xie@mujin |
src/libopenrave/kinbodylink.cpp
Outdated
FOREACHC(im, _mapExtraGeometries) { | ||
rapidjson::Value extraGeometryValue; | ||
extraGeometryValue.SetObject(); | ||
orjson::SetJsonValueByKey(extraGeometryValue, "name", im->first, allocator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you missed handling the id
field here and in deserialization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for offline conversation, I think you can put id
instead of name
here.
the key
of the std::map
is now represented by id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
talked in person.
It looks we still need both id
and name
.
The user of id
can handle limited characters.
Meanwhile, we want to use the more characters for the key of the mapExtraGeometries
.
In the upcoming safety-related geometry handling (c.f. #1402), we want to define the key based on the KinBody::GetName
, ...etc. Thus, the supported characters should be the same level as KinBody::GetName
and others.
Therefore, we also need name
field.
That means, we need to introduce the new data structure for mapExtraGeometries
...
25064fe
to
61ef8a6
Compare
61ef8a6
to
5ccc302
Compare
… into extra_geometries
pr for autotester
fixed an unintialized pointer issue in python binding
change function signature for compatibility
0380fa6
to
48a1991
Compare
… into rdiankov-extra_geometries
Fixed an issue of inserting wrong pointer into map
include/openrave/kinbody.h
Outdated
@@ -1331,19 +1359,19 @@ class OPENRAVE_API KinBody : public InterfaceBase | |||
/// | |||
/// \param name The name of the geometry group. If name is empty, will initialize the default geometries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the param comments
src/libopenrave/kinbodylink.cpp
Outdated
geometriesValue.PushBack(geometryValue, allocator); | ||
} | ||
} | ||
extraGeometryValue.AddMember("geometries", geometriesValue, allocator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just reuse ExtraGeometryInfo::SerializeJSON
src/libopenrave/kinbodylink.cpp
Outdated
std::map<std::string, std::vector<KinBody::GeometryInfoPtr>>::iterator it = _info._mapExtraGeometries.insert(make_pair(groupname, std::vector<KinBody::GeometryInfoPtr>())).first; | ||
it->second.resize(geometries.size()); | ||
std::copy(geometries.begin(), geometries.end(), it->second.begin()); | ||
KinBody::ExtraGeometryInfoPtr new_extrageom( new KinBody::ExtraGeometryInfo() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use camel case
The problem with serializing extra geometry infos is that "self" geometry group gets serialization, which is just a copy of the regular geometry. Furthermore, a lot of other geometries are auto-generated (like padding), so there's really no reason to serialize them as part of the JSON, which then gets into the saved files, and significantly increases the save/load times of the files along with increasing the size on disk. Perhaps you can begin with talking about the problem you are trying to solve here, and we can think about the right solution. |
The problem we're solving is that in the latest MCD, we would like to use the We've added the |
Why does webstack need to handle extra geometries at the moment? |
Add support for serialization and deserialization of the
extraGeometries
field.The
extraGeometries
in OpenRAVE is saved asstd::map< std::string, std::vector<GeometryInfoPtr> >
while the schema supposes to be: