Giter Club home page Giter Club logo

shm_vision_demo's Introduction

shm_vision_demo

Demonstrate how to use shared memory with image processing algorithms.

Note this is highly experimental and requires much clean up. It may still serve as an inspiration how to set up a computer vision app in ROS 2 with shared memory for high transmission efficiency.

Requirements

As of today this package only supports ROS 2 Rolling.

ROS 2 Galactic is not supported due to some cmake command changes.

Also require yolov3 object detection parameters which are automatically downloaded at build time using the scripts/download_yolo_weights.sh script.

Installation

TODO: more detail

  1. Install ROS 2 Rolling

  2. Clone the shm_vision_demo repo into your colcon_ws/src directory

  3. Clone the iceoryx repo into your colcon_ws/src directory - parallel with the repo you just cloned in step number two

  4. Build using colcon build --packages-up-to shm_vision_demo. While building it will automatically fetch the yolov3.weights file from https://pjreddie.com/darknet/yolo/ and copy them to the shm_vision_demo/config directory. The weights file is fairly large so it is not included in the repository but automatically downloaded during the build.

The following files are needed in the config/ directory:

  • coco.names
  • yolov3.cfg
  • yolov3.weights (YOLOv3-320 for the right image size)
  1. Adapt the ros2_ws variable in the scripts/demo.sh and scripts/shm_demo.sh scripts as needed. ros2_ws needs to point to the ROS 2 rolling workspace where shm_vision_demo and iceoryx are located.

Running the applications

By default the provided demo.sh and shm_demo.sh scripts will try to use your devices camera running live. If for some reason you do not wish to use your camera, you may pass in an argument to each script specifying an .mp4 file to use instead.

Quickstart

cd shm_vision_demo/scripts
# to run on live camera connected to device
./shm_demo.sh
# to run demo on pre-recorded video
./shm_demo.sh ~/videos/my_cool_video.mp4

Without Shared Memory

Ensure you are in the scripts directory: cd shm_vision_demo/scripts/

Run the ./demo.sh script, it should start all applications and show the corresponding outputs. Alternatively all (or a subset of) the applications can be started on their own (cf. parameterization in the script).

stop_demo.sh stops all applications and the tmux session or alternatively enter ctrl+b then kill-session to kill the running tmux session.

With Shared Memory

Run the shm_demo.sh script, it should start all applications and show the corresponding outputs. This will automatically load the cyclonedds.xml configuration. In addition the RouDi shared memory daemon will be started with the configuration roudi_config.toml-

stop_demo.sh stops all applications and the tmux session or alternatively enter ctrl+b then kill-session to kill the running tmux session.

TODO

  1. more detailed explanation and system description
  2. clean up code and add more documentation
  3. proper installation (scripts, config, yolo etc.)
  4. extend to image pipeline, use ROS 2 executor (?)

shm_vision_demo's People

Contributors

matthiaskillat avatar evan-flynn-apexai avatar flynneva avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.