Open Sanic opened 7 years ago
I remember having a similar problem when adding rs::human (which is of type identifiable)
cas.set(VIEW_HUMAN, *m_skeleton);
// If access to rs::Human is needed use this instead of the struct:
// uima::FeatureStructure fs;
// if(!cas.getFS(VIEW_HUMAN, fs))
// {
// outInfo("No Humans detected. Nothing to broadcast.");
// return;
// }
// rs::Human human2(fs);
// std::vector<rs::Joint2D> joints2d = human2.joints2D();
// std::vector<rs::Joint3D> joints3d = human2.joints3D();
// outInfo(joints2d.at(0).position().x());
// outInfo(joints3d.at(0).position().x());
//... otherwise access the struct this way:
// struct skeletonHuman human2;
// if(!cas.get(VIEW_HUMAN, human2))
// {
// outInfo("No Humans detected. Nothing to broadcast.");
// return;
// }
// outInfo(human2.joint2D[0].x);
// outInfo(human2.joint3D[0].x);
Back then we tried to identify the problem, but (due to being short in time) we stopped investigating this any further.
Might be worth having a look at it again.
We just did some experiments. Have a look at: 730736eccfa5b92811d604f1d1105f544db95490
For some strange reason it works....
Using 730736eccfa5b92811d604f1d1105f544db95490 does not fix it for me. Using getFS solves this issue for now. I'll leave the issue open and hopefully we'll have the time to look at this in more detail.
As discussed with @bbferka, how can i add a simple test string to the CAS do use it across different Annotators?
This is the error message:
As @bbferka pointed out, a quick fix for this seems to be to use getFS() instead of get() in the second code block. But why is get() crashing?