Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
jazzy

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
kilted

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
rolling

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version rolling
Last Updated 2024-05-29
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 1.0.5

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro ardent showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro bouncy showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro crystal showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro eloquent showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro dashing showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro foxy showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
iron

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version iron
Last Updated 2024-02-04
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 1.2.4

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Create a workspace, clone this repo, and use vcs to pull in the remaining dependencies:

pkg=event_camera_codecs
mkdir -p ~/$pkg/src
cd ~/ws
git clone https://github.com/ros-event-camera/${pkg}.git src/${pkg}
cd src
vcs import < ${pkg}/${pkg}.repos
cd ..

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro lunar showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro jade showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro indigo showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro hydro showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro kinetic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

event_camera_codecs repository

event_camera_codecs

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/ros-event-camera/event_camera_codecs.git
VCS Type git
VCS Version release
Last Updated 2025-05-22
Dev Status DEVELOPED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
event_camera_codecs 2.0.0

README

event_camera_codecs

This repository holds code for decoding event_camera_msgs. It builds under both ROS1 and ROS2. You can use this decoder from python via the event_camera_py repository.

Supported platforms

Currently tested on:

  • ROS1: Ubuntu 20.04 on Noetic
  • ROS2: Ubuntu 22.04 on Humble, Iron, Rolling

How to build

Set the following shell variables:

repo=event_camera_codecs
url=https://github.com/ros-event-camera/${repo}.git

and follow the instructions here

configure and build on ROS1:

catkin config -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)
catkin build

configure and build on ROS2:

cd ~/ws
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo  # (optionally add -DCMAKE_EXPORT_COMPILE_COMMANDS=1)

To also build the unit tests, add the cmake argument -DEVENT_CAMERA_CODECS_BUILD_TESTS=ON.

API example

```cpp #include <event_camera_codecs/decoder.h> #include <event_camera_codecs/decoder_factory.h>

using event_camera_codecs::EventPacket;

class MyProcessor : public event_camera_codecs::EventProcessor { public: inline void eventCD(uint64_t, uint16_t ex, uint16_t ey, uint8_t polarity) override { // do useful stuff here } void eventExtTrigger(uint64_t, uint8_t, uint8_t) override {} void finished() override{}; // called after no more events decoded in this packet void rawData(const char *, size_t) override{}; // passthrough of raw data };

MyProcessor processor;

// the decoder factory method is templated on the event processor // to permit inlining of methods like eventCD() above.

event_camera_codecs::DecoderFactory<EventPacket, MyProcessor> decoderFactory;

// to get callbacks into MyProcessor, feed the message buffer // into the decoder like so

void eventMsg(const event_camera_codecs::EventPacketConstSharedPtr & msg) { // will create a new decoder on first call, from then on returns existing one auto decoder = decoderFactory.getInstance(msg); if (!decoder) { // msg->encoding was invalid return; } // the decode() will trigger callbacks to processor decoder->decode(msg, &processor); }

/* To synchronize with frame based sensors it is useful to play back until a frame boundary is reached. The interface decodeUntil() is provided for this purpose. Do NOT use decode() and decodeUntil() on the same decoder! In the sample code belowframeTimes is an ordered queue of frame times. */

void eventMsg2(const event_camera_codecs::EventPacketConstSharedPtr & msg) { auto decoder = decoderFactory.getInstance(msg); uint64_t nextTime{0}; // The loop will exit when all events in msg have been processed // or there are no more frame times available decoder->setTimeBase(msg->time_base); while (!frameTimes.empty() && decoder->decodeUntil(msg, &processor, frameTimes.front(), &nextTime)) { // use loop in case multiple frames fit inbetween two events while (!frameTimes.empty() && frameTimes.front() <= nextTime) { // processFrameHere() frameTimes.pop(); } }

File truncated at 100 lines see the full file

CONTRIBUTING

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

Contributors must sign-off each commit by adding a Signed-off-by: ... line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the Developer Certificate of Origin (DCO).

Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that [license](http://www.apache.org/licenses/LICENSE-2.0.html): ~~~ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. ~~~ Contributors must sign-off each commit by adding a `Signed-off-by: ...` line to commit messages to certify that they have the right to submit the code they are contributing to the project according to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).