<div dir="ltr">Hi Jakob,<div><br></div><div>thanks for your answer, but the question is: Why is the pointcloud removed in the 'without pointcloud' section? I don't apply any filter.</div><div style>And the the 'useContextUpdates' does not remove it as well, does it? Documentation: "provide additional and likely redundant information on the item and emit additional binary events"</div>
<div style><br></div><div style>Best regards,</div><div style>Stefan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/17 Jakob Schwendner <span dir="ltr"><<a href="mailto:jakob.schwendner@dfki.de" target="_blank">jakob.schwendner@dfki.de</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div><div class="im">
<div>
</div>
<div>
<br>On December 17, 2012 at 8:25 PM Stefan Haase <<a href="mailto:stefan.haase@dfki.de" target="_blank">stefan.haase@dfki.de</a>> wrote:
</div>
<div>
<blockquote style="margin-left:0px;padding-left:10px;border-left:solid 1px blue" type="cite">
<div>
Hi Jakob.
</div>
<div>
</div>
<div>
I did like you told or at least as I think you told (see below) and it seems to work (no Pointcloud in my visualization-module anymore), but on the second look I realize that it didn't do anything (see a little bit more below).
</div>
<div>
Btw.: event.a.get() is an EnvironmentItem and Pointcloud is an EnvironmentItem.. so dont we actually perform an downcast here?
</div>
</blockquote>
</div>
</div><p>Yes... did I say upcast? my bad.</p><div class="im">
<div>
<blockquote style="margin-left:0px;padding-left:10px;border-left:solid 1px blue" type="cite">
<div>
</div>
<div>
The filter:
</div>
<div>
/**
</div>
<div>
* Event filter to exclude the pointcloud from serialization.
</div>
<div>
*/
</div>
<div>
class EventFilterExcludePointcloud : public envire::EventFilter {
</div>
<div>
public:
</div>
<div>
bool filter(envire::Event const& event) {
</div>
<div>
try {
</div>
<div>
envire::Pointcloud* pointcloud = dynamic_cast<envire::Pointcloud*>(event.a.get());
</div>
<div>
if(pointcloud != NULL) {
</div>
<div>
LOG_INFO("Removes event %s", event.id_a.c_str());
</div>
<div>
return false;
</div>
<div>
}
</div>
<div>
} catch (std::exception& e) {
</div>
<div>
LOG_ERROR("Exception using EventFilterExcludePointcloud: %s", e.what());
</div>
<div>
return false;
</div>
<div>
}
</div>
<div>
return true;
</div>
<div>
}
</div>
<div>
};
</div>
</blockquote>
</div>
</div><p>Don't think you need to catch here. dynamic_cast of pointers doesn't throw afak. Looks good otherwise.</p><div class="im">
<div>
<blockquote style="margin-left:0px;padding-left:10px;border-left:solid 1px blue" type="cite">
<div>
</div>
<div>
Add it to the emitter:
</div>
<div>
<div>
mEmitter = new envire::OrocosEmitter(_envire_environment_out);
</div>
<div>
mEmitter->setFilter(&mFilterPointcloud);
</div>
<div>
mEmitter->useContextUpdates(&mEnv);
</div>
<div>
mEmitter->useEventQueue( true );
</div>
<div>
mEmitter->attach(&mEnv);
</div>
</div>
<div>
</div>
</blockquote>
</div>
</div><p>seems reasonable.</p><div class="im">
<div>
<blockquote style="margin-left:0px;padding-left:10px;border-left:solid 1px blue" type="cite">
<div>
</div>
<div>
Actually this removes the pointcloud (or at least I do not see it anymore):
</div>
<div>
</div>
<div>
<strong>With pointcloud:</strong>
</div>
<div>
</div>
<div>
update hook:
</div>
<div>
<div>
envire::OrocosEmitter emitter(&mEnv, _envire_environment_out);
</div>
<div>
emitter.setTime(base::Time::now());
</div>
<div>
emitter.flush();
</div>
</div>
<div>
</div>
</blockquote>
</div>
</div><p>This will flush the entire environment everytime the update hook is called. Not likely what you want.</p><div class="im">
<div>
<blockquote style="margin-left:0px;padding-left:10px;border-left:solid 1px blue" type="cite">
<div>
</div>
<div>
<strong>Without pointcloud:</strong>
</div>
<div>
</div>
<div>
configureHook:
</div>
<div>
<div>
mEmitter = new envire::OrocosEmitter(_envire_environment_out);
</div>
<div>
mEmitter->useContextUpdates(&mEnv);
</div>
<div>
mEmitter->attach(&mEnv);
</div>
</div>
<div>
</div>
<div>
updateHook:
</div>
<div>
<div>
mEmitter->setTime(base::Time::now());
</div>
<div>
mEmitter->flush();
</div>
</div>
<div>
</div>
<div>
Irritated greetings,
</div>
</blockquote>
</div>
</div><p>Irritation received... Is there a question here? If you leave out whatever you have in the "with pointcloud" paragraph, all seems to be good :)</p><span class="HOEnZb"><font color="#888888">
<p>Jakob</p>
<div>
</div>
</font></span></div></blockquote></div><br><br clear="all"><div><br></div>-- <br> Dipl.-Inf. Stefan Haase<br> Space Robotics and Animation<br> <br>Standort Bremen:<br> DFKI GmbH<br> Robotics Innovation Center<br> Robert-Hooke-Straße 5<br>
28359 Bremen, Germany<br> <br> Phone: +49 (0)421 178 45-4108<br> Fax: +49 (0)421 178 45-4150<br> E-Mail: <a href="mailto:Stefan.Haase@dfki.de" target="_blank">Stefan.Haase@dfki.de</a><br> <br> Weitere Informationen: <a href="http://www.dfki.de/robotik" target="_blank">http://www.dfki.de/robotik</a><br>
-----------------------------------------------------------------------<br> Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH<br> Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern<br> Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster <br>
(Vorsitzender) Dr. Walter Olthoff<br> Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes<br> Amtsgericht Kaiserslautern, HRB 2313<br> Sitz der Gesellschaft: Kaiserslautern (HRB 2313)<br> USt-Id.Nr.: DE 148646973<br>
Steuernummer: 19/673/0060/3<br> -----------------------------------------------------------------------<br>
</div>