GithubHelp home page GithubHelp logo

ros-camera-gui's Introduction

ros-camera-gui

Camera GUI in ROS with Qt5/C++

For user:

1- Install Qt5:

sudo apt-get update

sudo apt-get install qt5-default

sudo apt-get install qtcreator

2- Download the support packages:

sudo apt-get install ros-kinetic-qt-create

sudo apt-get install ros-kinetic-qt-build

3- Steps to rebuild your workspace:

  • Copy the folder 'qtros' to your catkin workspace src folder.
  • check in the qnode.cpp the topic name you would like to display, currently the topics are: /ir/flir_tau2/image1 and /ir/flir_tau2/image2
  • check in the main_window.cpp the path, where the snapshot pictures will be saved, currently the path is: /media/ubuntu/demo/ . You can choose in code in which image format (.jpg or .png) the picture should be saved
  • build the workspace using catkin_make
  • source the workspace source devel/setup.bash
  • run the package using: - rosrun qtros qtros or run the qtros app located in /devel/lib/qtros/ (using terminal: ./qtros)
  • When the package is running:
    • the first tab is for ROS communications: you will get the ROS Master Url when roscore is running and ROS IP using ifconfig.
    • suppose that the camera node and gui node are running on different computers, to establish the ROS network:
      • in the computer where camera node and roscore is running: navigate to .bashrc file gedit .bashrc
      • add export ROS_IP=<gui node Computer IP> at the end
      • you may check how to establish ros network at
    • the second and third tabs are for displaying the camera pictures and offering the user following services: start, stop and snapshot
Attention: This GUI is designed to display 16-bit grayscale images from thermal camera, if you want to modify it, follow `for developer` instructions

For developer:

1- Install latest Qt version from, step-by-step installation guide could be found at

2- Go where Qt is installed ~/Qt5.12.2/Tools/QtCreator/bin and open it using terminal ./qtcreator

3- To import the GUI project to QtCreator, The steps are:

  • Click “File->Open File or Project”
  • Load the project using its “CMakeLists.txt” in qtros package folder
  • Go to Projects and browse in build directory to the build folder generated after catkin_make and choose it:

The photo

Practical issues:

    • Image processing:
    • Software Architecture:

The photo

The ROS image message is converted to an OpenCV image, the obtained image is again converted to a Qt image.

Translating this in code means: when you do image processing adjust myCallback function in qnode.cpp and displayMat function in main_window.cpp :

  • For OpenCV: try to avoid for loop (loop over an image pixel-by-pixel is slow)
  • For Qt: available Qimage formats can be found at
    • Update .ui file:
    • when you modify main_window.ui (Add new buttons, change label size ...etc), you need to update ui_main_window.h, the steps are:
      • save your modifications Ctrl+S
      • delete main_window.hpp in src/qtros/include/qtros/main_window.hpp and delete the build and devel folders generated after catkin_make
      • catkin_make and ignore the error which will appear
      • go to gui_ws/build/qtros and copy the new generated main_window.hpp and paste it in src/qtros/include/qtros/
      • catkin_make
      • run the package and you will see now your modifications

ros-camera-gui's People

Contributors

khalaf90 avatar

Watchers

 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.