├── .gitignore
├── config
├── ids_xcpe.bias
├── silky_ev_cam.bias
├── trigger_pins.yaml
└── trigger_pins_stereo.yaml
├── udev
└── rules.d
│ ├── 99-evkv2.rules
│ ├── ca_device.rules
│ └── 88-cyusb.rules
├── images
├── ros_event_camera.png
└── time_offset_example.png
├── .flake8.ini
├── metavision_driver.repos
├── nodelet_plugins.xml
├── launch
├── sync_test.launch
├── driver_nodelet.launch
├── cyclone_dds_config.xml
├── recording_driver.launch
├── recorder_node.launch.py
├── recording_stereo_driver.launch
├── sync_test.launch.py
├── stereo_driver_node.launch
├── driver_node.launch
├── start_recording.launch.py
├── recording_driver.launch.py
├── driver_node.launch.py
├── recording_stereo_driver.launch.py
├── driver_composition.launch.py
└── stereo_driver.launch.py
├── .clang-format
├── .github
├── workflows
│ └── ci.yaml
└── docker
│ ├── Dockerfile.focal_noetic_galactic
│ ├── Dockerfile.armv7_focal_noetic_metavision
│ ├── Dockerfile.jetson_r34_noetic_metavision
│ ├── Dockerfile.amd64_jammy_humble_openeb
│ ├── Dockerfile.arm64v8_jammy_humble_openeb
│ ├── Dockerfile.focal_noetic_galactic_metavision
│ └── README.md
├── CONTRIBUTING.md
├── include
└── metavision_driver
│ ├── driver_ros1_base.h
│ ├── check_endian.h
│ ├── bias_parameter.h
│ ├── callback_handler.h
│ ├── resize_hack.h
│ ├── driver_ros1.h
│ ├── driver_ros2.h
│ ├── ros_time_keeper.h
│ ├── logging.h
│ └── metavision_wrapper.h
├── src
├── driver_node_ros1.cpp
├── driver_node_ros2.cpp
├── stop_recording.py
├── start_recording.py
├── driver_nodelet_ros1.cpp
├── stop_recording_ros2.py
├── bias_parameter.cpp
├── test_time_stamps_ros1.py
├── test_time_stamps_ros2.py
├── driver_ros1.cpp
└── driver_ros2.cpp
├── CMakeLists.txt
├── cfg
└── MetaVisionDyn.cfg
├── package.xml
├── cmake
├── ROS2.cmake
└── ROS1.cmake
├── LICENSE
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | launch/__pycache__/*
2 |
--------------------------------------------------------------------------------
/config/ids_xcpe.bias:
--------------------------------------------------------------------------------
1 | 0 % bias_diff_off
2 | 0 % bias_diff_on
3 | 0 % bias_fo
4 | 0 % bias_hpf
5 | 0 % bias_refr
6 |
--------------------------------------------------------------------------------
/udev/rules.d/99-evkv2.rules:
--------------------------------------------------------------------------------
1 | ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03fd", ATTR{idProduct}=="5832", MODE="0666"
--------------------------------------------------------------------------------
/images/ros_event_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-event-camera/metavision_driver/HEAD/images/ros_event_camera.png
--------------------------------------------------------------------------------
/images/time_offset_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ros-event-camera/metavision_driver/HEAD/images/time_offset_example.png
--------------------------------------------------------------------------------
/udev/rules.d/ca_device.rules:
--------------------------------------------------------------------------------
1 | KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", ATTR{idVendor}=="31f7", MODE="666", TAG="causb_dev"
2 |
--------------------------------------------------------------------------------
/.flake8.ini:
--------------------------------------------------------------------------------
1 | [flake8]
2 | extend-ignore = Q000,D100,D103
3 | import-order-style = google
4 | max-line-length = 99
5 | show-source = true
6 | statistics = true
7 |
--------------------------------------------------------------------------------
/config/silky_ev_cam.bias:
--------------------------------------------------------------------------------
1 | 299 % bias_diff
2 | 221 % bias_diff_off
3 | 384 % bias_diff_on
4 | 1477 % bias_fo
5 | 1499 % bias_hpf
6 | 1250 % bias_pr
7 | 1500 % bias_refr
8 |
--------------------------------------------------------------------------------
/metavision_driver.repos:
--------------------------------------------------------------------------------
1 | repositories:
2 | event_camera_msgs:
3 | type: git
4 | url: https://github.com/ros-event-camera/event_camera_msgs.git
5 | version: master
6 |
--------------------------------------------------------------------------------
/nodelet_plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | ROS metavision driver nodelet
7 |
8 |
9 |
--------------------------------------------------------------------------------
/launch/sync_test.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.clang-format:
--------------------------------------------------------------------------------
1 | ---
2 | Language: Cpp
3 | BasedOnStyle: Google
4 |
5 | AccessModifierOffset: -2
6 | AlignAfterOpenBracket: AlwaysBreak
7 | BraceWrapping:
8 | AfterClass: true
9 | AfterFunction: true
10 | AfterNamespace: true
11 | AfterStruct: true
12 | BreakBeforeBraces: Custom
13 | ColumnLimit: 100
14 | ConstructorInitializerIndentWidth: 0
15 | ContinuationIndentWidth: 2
16 | DerivePointerAlignment: false
17 | PointerAlignment: Middle
18 | ReflowComments: false
19 | ...
20 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yaml:
--------------------------------------------------------------------------------
1 | #
2 | # continuous integration workflow
3 | #
4 | name: build repo
5 |
6 | on:
7 | push:
8 | branches: [ master]
9 | pull_request:
10 | branches: [ master]
11 | workflow_dispatch:
12 | branches: [ master]
13 |
14 | jobs:
15 | build_ros2:
16 | uses: ros-misc-utilities/ros_build_scripts/.github/workflows/ci_humble_and_later.yml@master
17 | with:
18 | repo: ${{ github.event.repository.name }}
19 | vcs_url: ${{ github.event.repository.name }}.repos
20 |
--------------------------------------------------------------------------------
/udev/rules.d/88-cyusb.rules:
--------------------------------------------------------------------------------
1 | # Cypress USB driver for FX2 and FX3 (C) Cypress Semiconductor Corporation / ATR-LABS
2 | # Rules written by V. Radhakrishnan ( rk@atr-labs.com )
3 | # Cypress USB vendor ID = 0x04b4
4 | # Note: The cy_renumerate.sh script is required only when using Cypress SDK cyusb_linux tool (to flash via USB)
5 | KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="add", ATTR{idVendor}=="04b4", MODE="666", TAG="cyusb_dev", RUN+="/usr/local/bin/cy_renumerate.sh A"
6 | KERNEL=="*", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ACTION=="remove", TAG=="cyusb_dev", RUN+="/usr/local/bin/cy_renumerate.sh R"
7 |
--------------------------------------------------------------------------------
/launch/driver_nodelet.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/config/trigger_pins.yaml:
--------------------------------------------------------------------------------
1 | event_camera: # must match node name per ROS2 convention!!!
2 | ros__parameters: # must be present for ROS2
3 | prophesee_pin_config:
4 | evc3a_plugin_gen31:
5 | external: 0
6 | loopback: 6
7 | evc4a_plugin_imx636:
8 | external: 0
9 | loopback: 6
10 | hal_plugin_gen31_evk2:
11 | external: 0
12 | loopback: 3
13 | hal_plugin_gen31_evk3:
14 | external: 0
15 | loopback: 6
16 | hal_plugin_gen31_fx3:
17 | external: 0
18 | loopback: 6
19 | hal_plugin_gen3_fx3:
20 | external: 0
21 | loopback: 6
22 | hal_plugin_gen41_evk2:
23 | external: 1
24 | loopback: 3
25 | hal_plugin_gen4_evk2:
26 | external: 1
27 | loopback: 3
28 | hal_plugin_gen4_fx3:
29 | external: 1
30 | loopback: 6
31 |
--------------------------------------------------------------------------------
/launch/cyclone_dds_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | auto
6 | default
7 | 65500B
8 | 4000B
9 |
10 |
11 |
12 | 600kB
13 |
14 |
15 |
16 | config
17 | stdout
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/.github/docker/Dockerfile.focal_noetic_galactic:
--------------------------------------------------------------------------------
1 | FROM ros:noetic
2 | LABEL maintainer="bernd.pfrommer@gmail.com"
3 | LABEL version="1.0"
4 | LABEL description="ros noetic + galactic image"
5 | ARG DEBIAN_FRONTEND=noninteractive
6 | RUN apt-get update
7 |
8 | # for add-apt-repository and to make debconf happy
9 | RUN apt-get -y install software-properties-common apt-utils
10 |
11 | #
12 | # install ROS2 galactic
13 | #
14 | RUN add-apt-repository universe
15 | RUN apt-get update && sudo apt-get -y install curl gnupg lsb-release
16 | RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
17 | RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
18 | RUN apt-get update
19 | RUN apt-get -y install ros-galactic-desktop
20 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Any contribution that you make to this repository will
2 | be under the Apache 2 License, as dictated by that
3 | [license](http://www.apache.org/licenses/LICENSE-2.0.html):
4 |
5 | ~~~
6 | 5. Submission of Contributions. Unless You explicitly state otherwise,
7 | any Contribution intentionally submitted for inclusion in the Work
8 | by You to the Licensor shall be under the terms and conditions of
9 | this License, without any additional terms or conditions.
10 | Notwithstanding the above, nothing herein shall supersede or modify
11 | the terms of any separate license agreement you may have executed
12 | with Licensor regarding such Contributions.
13 | ~~~
14 |
15 | Contributors must sign-off each commit by adding a `Signed-off-by: ...`
16 | line to commit messages to certify that they have the right to submit
17 | the code they are contributing to the project according to the
18 | [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
19 |
--------------------------------------------------------------------------------
/include/metavision_driver/driver_ros1_base.h:
--------------------------------------------------------------------------------
1 | // -*-c++-*---------------------------------------------------------------------------------------
2 | // Copyright 2022 Bernd Pfrommer
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | #ifndef METAVISION_DRIVER__DRIVER_ROS1_BASE_H_
17 | #define METAVISION_DRIVER__DRIVER_ROS1_BASE_H_
18 |
19 | namespace metavision_driver
20 | {
21 | class DriverROS1Base
22 | {
23 | public:
24 | DriverROS1Base() {}
25 | virtual ~DriverROS1Base() {}
26 | };
27 | } // namespace metavision_driver
28 | #endif // METAVISION_DRIVER__DRIVER_ROS1_BASE_H_
29 |
--------------------------------------------------------------------------------
/src/driver_node_ros1.cpp:
--------------------------------------------------------------------------------
1 | // -*-c++-*---------------------------------------------------------------------------------------
2 | // Copyright 2022 Bernd Pfrommer
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | #include
17 |
18 | #include "metavision_driver/driver_ros1.h"
19 |
20 | int main(int argc, char ** argv)
21 | {
22 | ros::init(argc, argv, "driver_node");
23 | ros::NodeHandle pnh("~");
24 |
25 | try {
26 | metavision_driver::DriverROS1 node(pnh);
27 | ros::spin();
28 | } catch (const std::exception & e) {
29 | ROS_ERROR("%s: %s", pnh.getNamespace().c_str(), e.what());
30 | return (-1);
31 | }
32 | return (0);
33 | }
34 |
--------------------------------------------------------------------------------
/src/driver_node_ros2.cpp:
--------------------------------------------------------------------------------
1 | // -*-c++-*---------------------------------------------------------------------------------------
2 | // Copyright 2021 Bernd Pfrommer
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | #include
17 | #include
18 |
19 | #include "metavision_driver/driver_ros2.h"
20 |
21 | int main(int argc, char * argv[])
22 | {
23 | rclcpp::init(argc, argv);
24 | auto node = std::make_shared(rclcpp::NodeOptions());
25 |
26 | RCLCPP_INFO(node->get_logger(), "driver_node started up!");
27 | // actually run the node
28 | rclcpp::spin(node); // should not return
29 | rclcpp::shutdown();
30 | return 0;
31 | }
32 |
--------------------------------------------------------------------------------
/launch/recording_driver.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
10 |
11 |
12 | ["/event_camera/events"]
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/stop_recording.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python3
2 | # -----------------------------------------------------------------------------
3 | # Copyright 2021 Bernd Pfrommer
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | import actionlib
19 | from nodelet_rosbag.msg import StopAction, StopGoal
20 | import rospy
21 |
22 |
23 | if __name__ == "__main__":
24 | rospy.init_node("stop_recording_client")
25 | print("sending command to stop recording!")
26 | client = actionlib.SimpleActionClient("stop", StopAction)
27 | client.wait_for_server()
28 | goal = StopGoal()
29 | client.send_goal(goal)
30 | client.wait_for_result(rospy.Duration.from_sec(5.0))
31 | print("recording should be stopped now...")
32 |
--------------------------------------------------------------------------------
/src/start_recording.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python3
2 | # -----------------------------------------------------------------------------
3 | # Copyright 2021 Bernd Pfrommer
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | import actionlib
19 | from nodelet_rosbag.msg import StartAction, StartGoal
20 | import rospy
21 |
22 |
23 | if __name__ == "__main__":
24 | rospy.init_node("start_recording_client")
25 | print("sending command to start recording!")
26 | client = actionlib.SimpleActionClient("start", StartAction)
27 | client.wait_for_server()
28 | goal = StartGoal()
29 | client.send_goal(goal)
30 | client.wait_for_result(rospy.Duration.from_sec(5.0))
31 | print("recording should be started now...")
32 |
--------------------------------------------------------------------------------
/include/metavision_driver/check_endian.h:
--------------------------------------------------------------------------------
1 | // -*-c++-*---------------------------------------------------------------------------------------
2 | // Copyright 2022 Bernd Pfrommer
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | #ifndef METAVISION_DRIVER__CHECK_ENDIAN_H_
17 | #define METAVISION_DRIVER__CHECK_ENDIAN_H_
18 |
19 | namespace metavision_driver
20 | {
21 | namespace check_endian
22 | {
23 | // check endianness
24 | inline bool isBigEndian()
25 | {
26 | const union {
27 | uint32_t i;
28 | char c[4];
29 | } combined_int = {0x01020304}; // from stackoverflow
30 | return (combined_int.c[0] == 1);
31 | }
32 | } // namespace check_endian
33 | } // namespace metavision_driver
34 | #endif // METAVISION_DRIVER__CHECK_ENDIAN_H_
35 |
--------------------------------------------------------------------------------
/include/metavision_driver/bias_parameter.h:
--------------------------------------------------------------------------------
1 | // -*-c++-*---------------------------------------------------------------------------------------
2 | // Copyright 2023 Bernd Pfrommer
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | #ifndef METAVISION_DRIVER__BIAS_PARAMETER_H_
17 | #define METAVISION_DRIVER__BIAS_PARAMETER_H_
18 |
19 | #include