<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
 </head><body style="">
 
 
  <div>
   &#160;
  </div> 
  <div>
   <br/>On December 17, 2012 at 8:25 PM Stefan Haase &#60;stefan.haase@dfki.de&#62; wrote:
  </div> 
  <div style="position: relative;"> 
   <blockquote style="margin-left: 0px; padding-left: 10px; border-left: solid 1px blue;" type="cite"> 
    <div>
     Hi Jakob.
    </div> 
    <div>
     &#160;
    </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&#39;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?&#160;
    </div> 
   </blockquote> 
  </div> 
  <p>Yes... did I say upcast? my bad.</p> 
  <div style="position: relative;"> 
   <blockquote style="margin-left: 0px; padding-left: 10px; border-left: solid 1px blue;" type="cite"> 
    <div>
     &#160;
    </div> 
    <div>
     The filter:
    </div> 
    <div>
     &#160; &#160; /**
    </div> 
    <div>
     &#160; &#160; &#160;* Event filter to exclude the pointcloud from serialization.
    </div> 
    <div>
     &#160; &#160; &#160;*/
    </div> 
    <div>
     &#160; &#160; class EventFilterExcludePointcloud : public envire::EventFilter {
    </div> 
    <div>
     &#160; &#160; &#160;public:
    </div> 
    <div>
     &#160; &#160; &#160; &#160; bool filter(envire::Event const&#38; event) {
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; try {
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; envire::Pointcloud* pointcloud = dynamic_cast&#60;envire::Pointcloud*&#62;(event.a.get());
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; if(pointcloud != NULL) {
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; LOG_INFO(&#34;Removes event %s&#34;, event.id_a.c_str());
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; return false;
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; }
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; } catch (std::exception&#38; e) {
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; LOG_ERROR(&#34;Exception using EventFilterExcludePointcloud: %s&#34;, e.what());
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; return false;
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; }
    </div> 
    <div>
     &#160; &#160; &#160; &#160; &#160; &#160; return true;
    </div> 
    <div>
     &#160; &#160; &#160; &#160; }
    </div> 
    <div>
     &#160; &#160; };
    </div> 
   </blockquote> 
  </div> 
  <p>Don&#39;t think you need to catch here. dynamic_cast of pointers doesn&#39;t throw afak. Looks good otherwise.</p> 
  <div style="position: relative;"> 
   <blockquote style="margin-left: 0px; padding-left: 10px; border-left: solid 1px blue;" type="cite"> 
    <div>
     &#160;
    </div> 
    <div>
     Add it to the emitter:
    </div> 
    <div> 
     <div>
      &#160; &#160; mEmitter = new envire::OrocosEmitter(_envire_environment_out);
     </div> 
     <div>
      &#160; &#160; mEmitter-&#62;setFilter(&#38;mFilterPointcloud);
     </div> 
     <div>
      &#160; &#160; mEmitter-&#62;useContextUpdates(&#38;mEnv);
     </div> 
     <div>
      &#160; &#160; mEmitter-&#62;useEventQueue( true );
     </div> 
     <div>
      &#160; &#160; mEmitter-&#62;attach(&#38;mEnv);
     </div> 
    </div> 
    <div>
     &#160;
    </div> 
   </blockquote> 
  </div> 
  <p>seems reasonable.</p> 
  <div style="position: relative;"> 
   <blockquote style="margin-left: 0px; padding-left: 10px; border-left: solid 1px blue;" type="cite"> 
    <div>
     &#160;
    </div> 
    <div>
     Actually this removes the pointcloud (or at least I do not see it anymore):
    </div> 
    <div>
     &#160;
    </div> 
    <div>
     <strong>With pointcloud:</strong>
    </div> 
    <div>
     &#160;
    </div> 
    <div>
     update hook:
    </div> 
    <div> 
     <div>
      &#160; &#160; &#160; &#160; envire::OrocosEmitter emitter(&#38;mEnv, _envire_environment_out);
     </div> 
     <div>
      &#160; &#160; &#160; &#160; emitter.setTime(base::Time::now());
     </div> 
     <div>
      &#160; &#160; &#160; &#160; emitter.flush(); &#160;
     </div> 
    </div> 
    <div>
     &#160;
    </div> 
   </blockquote> 
  </div> 
  <p>This will flush the entire environment everytime the update hook is called. Not likely what you want.</p> 
  <div style="position: relative;"> 
   <blockquote style="margin-left: 0px; padding-left: 10px; border-left: solid 1px blue;" type="cite"> 
    <div>
     &#160;
    </div> 
    <div>
     <strong>Without pointcloud:</strong>
    </div> 
    <div>
     &#160;
    </div> 
    <div>
     configureHook:
    </div> 
    <div> 
     <div>
      &#160; &#160; mEmitter = new envire::OrocosEmitter(_envire_environment_out);
     </div> 
     <div>
      &#160; &#160; mEmitter-&#62;useContextUpdates(&#38;mEnv);
     </div> 
     <div>
      &#160; &#160; mEmitter-&#62;attach(&#38;mEnv);
     </div> 
    </div> 
    <div>
     &#160;
    </div> 
    <div>
     updateHook:
    </div> 
    <div> 
     <div>
      &#160; &#160; mEmitter-&#62;setTime(base::Time::now());
     </div> 
     <div>
      &#160; &#160; mEmitter-&#62;flush();&#160;
     </div> 
    </div> 
    <div>
     &#160;
    </div> 
    <div>
     Irritated greetings,
    </div> 
   </blockquote> 
  </div> 
  <p>Irritation received... Is there a question here? If you leave out whatever you have in the &#34;with pointcloud&#34; paragraph, all seems to be good :)</p> 
  <p>Jakob</p> 
  <div>
   &#160;
  </div>
 
</body></html>