<div dir="ltr">Hi Jakob,<div><br></div><div>thanks for your answer, but the question is: Why is the pointcloud removed in the &#39;without pointcloud&#39; section? I don&#39;t apply any filter.</div><div style>And the  the &#39;useContextUpdates&#39; does not remove it as well, does it? Documentation: &quot;provide additional and likely redundant information on the item and emit additional binary events&quot;</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">&lt;<a href="mailto:jakob.schwendner@dfki.de" target="_blank">jakob.schwendner@dfki.de</a>&gt;</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 &lt;<a href="mailto:stefan.haase@dfki.de" target="_blank">stefan.haase@dfki.de</a>&gt; 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&#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? 
    </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&amp; event) {
    </div> 
    <div>
                 try {
    </div> 
    <div>
                     envire::Pointcloud* pointcloud = dynamic_cast&lt;envire::Pointcloud*&gt;(event.a.get());
    </div> 
    <div>
                     if(pointcloud != NULL) {
    </div> 
    <div>
                         LOG_INFO(&quot;Removes event %s&quot;, event.id_a.c_str());
    </div> 
    <div>
                         return false;
    </div> 
    <div>
                     }
    </div> 
    <div>
                 } catch (std::exception&amp; e) {
    </div> 
    <div>
                     LOG_ERROR(&quot;Exception using EventFilterExcludePointcloud: %s&quot;, e.what());
    </div> 
    <div>
                     return false;
    </div> 
    <div>
                 }
    </div> 
    <div>
                 return true;
    </div> 
    <div>
             }
    </div> 
    <div>
         };
    </div> 
   </blockquote> 
  </div> 
  </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 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-&gt;setFilter(&amp;mFilterPointcloud);
     </div> 
     <div>
          mEmitter-&gt;useContextUpdates(&amp;mEnv);
     </div> 
     <div>
          mEmitter-&gt;useEventQueue( true );
     </div> 
     <div>
          mEmitter-&gt;attach(&amp;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(&amp;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-&gt;useContextUpdates(&amp;mEnv);
     </div> 
     <div>
          mEmitter-&gt;attach(&amp;mEnv);
     </div> 
    </div> 
    <div>
      
    </div> 
    <div>
     updateHook:
    </div> 
    <div> 
     <div>
          mEmitter-&gt;setTime(base::Time::now());
     </div> 
     <div>
          mEmitter-&gt;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 &quot;with pointcloud&quot; 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>