TB3 ROS Intel Movidius NCS

From wikidb
Jump to: navigation, search

Reference

Context

This is the ROS wrapper thefor Movidius installed in TB3_Movidius_Neural_Compute_Stick_1.12.01.01

Archive Old Installation

Temp save the old installation if a recovery is needed.

 $ cd catkin_ws/src

 $ mv ros_intel_movidius_ncs/ ~/tmp/packages/

Prerequisite and Environment Setup

Sections 2 and 3

Building and Installation

Section 4

Done Jan 2019 The object_msgs installation is skipped here because it was done earlier in TR3_Intel_ROS_Project#Package:_Object_Msgs_.281.29

 $ cd ~/catkin_ws/src/

 $ git clone https://github.com/intel/ros_intel_movidius_ncs.git

 $ cd ros_intel_movidius_ncs

 $ git checkout master

 $ cd ~/catkin_ws

 $ catkin_make

 $ catkin_make install

 $ source install/setup.bash

 $ cp ~/catkin_ws/src/ros_intel_movidius_ncs/data/labels/* /opt/movidius/ncappzoo/data/ilsvrc12/

Detection for Video Demo

Reference

  • [ROS Movidius Wrapper See section 5 "Running the Demo"
    • Went to section 5.2 "Detection"
      • Then subsection 5.2.3 "Running the Demo" (miss numbered)
        • Picked "Video Streaming" Which took me to the following page
  • [Detection for Video]
    • Followed the steps for "MobileNet_SSD"
    • Used the USB Camera version
    • The Realsense version didn't - probably a setup issue.

Build SSD MobileNet Model

 $ cd /opt/movidius//ncappzoo/caffe/SSD_MobileNet/

 $ make

Run

Pre Condition

  • Using the ROS wrapper does not require that cv2.so is removed
  • make sure that the console camera is mapped to video0.
 $ ll /dev/video0 
     crw-rw----+ 1 root video 81, 0 Feb  6 15:30 /dev/video0

Terminal 1

 $ roscore

Terminal 2

 $ roslaunch movidius_ncs_launch ncs_camera.launch cnn_type:=mobilenetssd camera:=usb

Terminal 3

 $ roslaunch movidius_ncs_launch ncs_stream_detection_example.launch camera_topic:="/usb_cam/image_raw"

Old Tests

Previous install test. They need to be updated

Running the GoogleNet Demo

Section 5.1.3 Static Image in ROS Intel Movidius NCS to get to Image Classification

Tested GoogleNet

Terminal 1

 $ cd /opt/movidius/ncappzoo/caffe/GoogLeNet/

 $ make

 $ roslaunch movidius_ncs_launch ncs_image.launch cnn_type:=googlene

Terminal 2

 $ roslaunch movidius_ncs_launch ncs_image_classification_example.launch demo_mode:=0
     .....
     started roslaunch server http://10.0.0.159:40939/

     SUMMARY
     ========

     PARAMETERS
      * /movidius_ncs_image_multiple_classification/demo_mode: 0
      * /movidius_ncs_image_multiple_classification/image_base_path: /opt/movidius/nca...
      * /movidius_ncs_image_multiple_classification/parallel_flag: 1
      * /movidius_ncs_image_multiple_classification/parallel_size: 5
      * /rosdistro: kinetic
      * /rosversion: 1.12.13
   
     NODES
       /
         movidius_ncs_image_multiple_classification (movidius_ncs_example/movidius_ncs_example_image_classification)

     ROS_MASTER_URI=http://10.0.0.159:11311

     process[movidius_ncs_image_multiple_classification-1]: started with pid [4490]
     [ INFO] [1530389864.336625534]: use image_base_path = /opt/movidius/ncappzoo/data/images/
     [ INFO] [1530389864.337313049]: use parallel_size = 5
     [ INFO] [1530389864.337796107]: use demo_mode = 0
     [ INFO] [1530389864.338202014]: use parallel_flag = 1
     [ INFO] [1530389872.551396548]: Classification result for image No.1:
     [ INFO] [1530389872.552059429]: 0: object: electric guitar
     probability: 98.291016%
     [ INFO] [1530389872.556133395]: 1: object: acoustic guitar
     probability: 1.664734%
     [ INFO] [1530389872.557159819]: 2: object: violin, fiddle
     probability: 0.037336%

Image of a guitar displayed.

Test Passed

cv2 Test

The remove cv2.so fix, see TB3_Movidius_Neural_Compute_Stick#Fix_Two, was removed.

 $ sudo cp cv2_rename.so cv2.so

Test Passed