[Rock-dev] Envire environment zum Versenden vereinfachen

Stefan Haase stefan.haase at dfki.de
Tue Dec 18 11:32:22 CET 2012


Hi Jakob,

thanks for your answer, but the question is: Why is the pointcloud removed
in the 'without pointcloud' section? I don't apply any filter.
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"

Best regards,
Stefan


2012/12/17 Jakob Schwendner <jakob.schwendner at dfki.de>

> **
>
>
> On December 17, 2012 at 8:25 PM Stefan Haase <stefan.haase at dfki.de>
> wrote:
>
>  Hi Jakob.
>
>  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).
>  Btw.: event.a.get() is an EnvironmentItem and Pointcloud is an
> EnvironmentItem.. so dont we actually perform an downcast here?
>
>  Yes... did I say upcast? my bad.
>
>
>  The filter:
>      /**
>       * Event filter to exclude the pointcloud from serialization.
>       */
>      class EventFilterExcludePointcloud : public envire::EventFilter {
>       public:
>          bool filter(envire::Event const& event) {
>              try {
>                  envire::Pointcloud* pointcloud =
> dynamic_cast<envire::Pointcloud*>(event.a.get());
>                  if(pointcloud != NULL) {
>                      LOG_INFO("Removes event %s", event.id_a.c_str());
>                      return false;
>                  }
>              } catch (std::exception& e) {
>                  LOG_ERROR("Exception using EventFilterExcludePointcloud:
> %s", e.what());
>                  return false;
>              }
>              return true;
>          }
>      };
>
>  Don't think you need to catch here. dynamic_cast of pointers doesn't
> throw afak. Looks good otherwise.
>
>
>  Add it to the emitter:
>      mEmitter = new envire::OrocosEmitter(_envire_environment_out);
>      mEmitter->setFilter(&mFilterPointcloud);
>      mEmitter->useContextUpdates(&mEnv);
>      mEmitter->useEventQueue( true );
>      mEmitter->attach(&mEnv);
>
>
>  seems reasonable.
>
>
>  Actually this removes the pointcloud (or at least I do not see it
> anymore):
>
>  *With pointcloud:*
>
>  update hook:
>          envire::OrocosEmitter emitter(&mEnv, _envire_environment_out);
>          emitter.setTime(base::Time::now());
>          emitter.flush();
>
>
>  This will flush the entire environment everytime the update hook is
> called. Not likely what you want.
>
>
>  *Without pointcloud:*
>
>  configureHook:
>      mEmitter = new envire::OrocosEmitter(_envire_environment_out);
>      mEmitter->useContextUpdates(&mEnv);
>      mEmitter->attach(&mEnv);
>
>  updateHook:
>      mEmitter->setTime(base::Time::now());
>      mEmitter->flush();
>
>  Irritated greetings,
>
>  Irritation received... Is there a question here? If you leave out
> whatever you have in the "with pointcloud" paragraph, all seems to be good
> :)
>
> Jakob
>
>



-- 
 Dipl.-Inf. Stefan Haase
 Space Robotics and Animation

Standort Bremen:
 DFKI GmbH
 Robotics Innovation Center
 Robert-Hooke-Straße 5
 28359 Bremen, Germany

 Phone: +49 (0)421 178 45-4108
 Fax:   +49 (0)421 178 45-4150
 E-Mail: Stefan.Haase at dfki.de

 Weitere Informationen: http://www.dfki.de/robotik
 -----------------------------------------------------------------------
 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
 Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
 Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
 (Vorsitzender) Dr. Walter Olthoff
 Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
 Amtsgericht Kaiserslautern, HRB 2313
 Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
 USt-Id.Nr.:    DE 148646973
 Steuernummer:  19/673/0060/3
 -----------------------------------------------------------------------
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://www.dfki.de/pipermail/rock-dev/attachments/20121218/dd23465c/attachment.htm 


More information about the Rock-dev mailing list