Difference between revisions of "Intel RealSense Foxy 20210511"

From wikidb
Jump to: navigation, search
(Install RealSense Utilities)
(Other RealSense Images)
 
(22 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
* [https://github.com/intel/ros2_intel_realsense Intel RealSense Dashing Release]
 
* [https://github.com/intel/ros2_intel_realsense Intel RealSense Dashing Release]
 
* [https://index.ros.org/r/ros2_intel_realsense/#foxy ROS org RealSense Foxy Release]
 
* [https://index.ros.org/r/ros2_intel_realsense/#foxy ROS org RealSense Foxy Release]
* [https://github.com/IntelRealSense/librealsense/tree/master/tools/enumerate-devices rs-enumerate-devices tool repository]
 
 
* [[TB3 Install ROS RealSense 2]]: Notes from my February 2019 install Sisters (Dell laptop)
 
* [[TB3 Install ROS RealSense 2]]: Notes from my February 2019 install Sisters (Dell laptop)
  
Line 61: Line 60:
 
* libgtk-3-dev
 
* libgtk-3-dev
 
* libglfw3-dev
 
* libglfw3-dev
 
== Install RealSense Utilities ==
 
 
* Installing rs-enumerate-devices is the goal of this step. It is required in the configuration step.
 
* [https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md librealsense distribution] These utilities run under Ubuntu (not ROS 2)
 
* Followed the instuctions for Ubuntu 20.04 LTS (Focal Fossa). See the reference to "focal" in the second step below.
 
* The order is important which I messed up. See the log and notes at the bottom.
 
 
  $ sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
 
 
 
  $ sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo focal main" -u
 
 
  $ sudo apt-get install librealsense2-utils
 
 
  $ apt list | grep librealsense
 
 
The apt list returns more hits because we expanded the apt repository above.
 
 
'''TBD''' See
 
 
 
enumerateD435
 
realsense 2021...
 
relasenseconfig...
 
 
and notes at end
 
  
 
== Install ros2_intel_realsense From Source - Success ==
 
== Install ros2_intel_realsense From Source - Success ==
Line 150: Line 123:
 
         ...
 
         ...
  
More detail in
+
* [[Intel RealSense D435 lsusb 20210515]]: the complete listing
* [[Intel RealSense D435 lsusb 20210515]]
+
* Just curious: no action taken.
  
 
== Setting udev Rules ==
 
== Setting udev Rules ==
Line 163: Line 136:
 
== Configure with the Camera's Serial Number ==
 
== Configure with the Camera's Serial Number ==
  
 +
* [[Intel RealSense Utilities Ubuntu 20.04 Focal 20210518]]: Install Instructions
  
* [[Intel RealSense D435 Enumerate Devices 20210515]]
+
  $ rs-enumerate-devices
 +
      Device info:
 +
          Name                          : Intel RealSense D435
 +
          Serial Number                : 935322071334
 +
          Firmware Version              : 05.11.01.100
 +
          Recommended Firmware Version  : 05.12.13.50
 +
          ...
 +
 
 +
* Notice the Serial Number
 +
* [[Intel RealSense D435 Enumerate Devices 20210515]]: the complete listing of my D435.
 +
* Now modify the d435.yaml file with the correct serial number
 +
 
 +
  $ cd ~/image_ws/src/ros2_intel_realsense/realsense_examples/config
 +
 +
  $ cp d435.yaml d435.yaml.org
 +
 +
  $ emacs d435.yaml&
 +
 +
  $ diff d435.yaml d435.yaml.org
 +
        4c4
 +
        <      serial_no: 935322071334 # d435
 +
        ---
 +
        >      serial_no: 819312071869 # d435
 +
 
 +
* [[Turtlebot Waffle NUC D435.yaml 20210514]] new listing for the D435.yaml file
  
 
= Execution =
 
= Execution =
Line 181: Line 179:
 
         [INFO] [1621277685.299402714] [d435.camera]: Device with serial number 935322071334 was found.
 
         [INFO] [1621277685.299402714] [d435.camera]: Device with serial number 935322071334 was found.
 
         [INFO] [1621277685.299500802] [d435.camera]: Create a node for D4X5 Camera
 
         [INFO] [1621277685.299500802] [d435.camera]: Create a node for D4X5 Camera
 +
 +
=== Display Color Raw Image ===
  
 
'''TERMINAL 2'''
 
'''TERMINAL 2'''
Line 203: Line 203:
 
         ^C[INFO] [1621356720.889545172] [rclcpp]: signal_handler(signal_value=2)
 
         ^C[INFO] [1621356720.889545172] [rclcpp]: signal_handler(signal_value=2)
  
'''TBD''' add screen shot
+
/d435/camera/color/image_raw is RGB. opencv_ros2sub tells opencv that it is BGR.
  
'''TBD''' Errors for other published images.
+
[[File: opencv_rossub_colorimageraw.png | 400px]]
 +
 
 +
'''TERMINAL 3'''
 +
 
 +
$ ros2 topic echo d435/camera/color/image_raw
 +
      ---
 +
      header:
 +
        stamp:
 +
          sec: 1621719587
 +
          nanosec: 920183274
 +
        frame_id: camera_color_optical_frame
 +
      height: 480
 +
      width: 640
 +
      encoding: rgb8
 +
      is_bigendian: 0
 +
        step: 1920
 +
        data:
 +
        - 170
 +
        - 178
 +
        ...
 +
 
 +
=== Other RealSense Images ===
 +
 
 +
'''TBD''': modify opencv_rossub to handle other images and fix the one above
 +
 
 +
  $ ros2 run opencv_ros2sub opencv_exp --ros-args -r image:=d435/camera/depth/image_rect_raw
 +
        terminate called after throwing an instance of 'cv::Exception'
 +
          what():  OpenCV(4.2.0) ../modules/imgproc/src/color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function 'cv::impl::{anonymous}::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::impl::{anonymous}::Set<3, 4>; VDcn = cv::impl::{anonymous}::Set<3>; VDepth = cv::impl::{anonymous}::Set<0, 5>; cv::impl::{anonymous}::SizePolicy sizePolicy = cv::impl::<unnamed>::NONE; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
 +
        > Invalid number of channels in input image:
 +
        >    'VScn::contains(scn)'
 +
        > where
 +
        >    'scn' is 1
 +
 
 +
 
 +
  /d435/camera/aligned_depth_to_color/image_raw  16UC1
 +
  /d435/camera/color/image_raw                    rgb8
 +
  /d435/camera/depth/image_rect_raw              16UC1
 +
  /d435/camera/infra1/image_rect_raw              8UC1
 +
  /d435/camera/infra2/image_rect_raw              8UC1
  
 
== Using rbiz ==
 
== Using rbiz ==
Line 229: Line 267:
  
 
   rqt_graph
 
   rqt_graph
 +
 +
= Notes and Logs =
 +
 +
* [[Turtlebot3 Waffle NUC Foxy RealSense 20210513 Notes and Logs]]
 +
* [[Turtlebot3 Waffle NUC RealSense2 Configure 20210514 Notes and Logs]]
 +
* [[Turtlebot3 Waffle NUC RealSense2 udev 20210517 Notes and Logs]]
 +
* [[Turtlebot3 Waffle NUC RealSense2 Use 20210518 Notes and Logs]]
  
 
= Depreciated =
 
= Depreciated =
Line 273: Line 318:
 
* Success: realsense_camera_msgs
 
* Success: realsense_camera_msgs
 
* Failed: realsense_ros2_camera - It could not find some of the stuff for librealsense2 which compiled fine above. Not sure what to do.
 
* Failed: realsense_ros2_camera - It could not find some of the stuff for librealsense2 which compiled fine above. Not sure what to do.
 
= Notes and Logs =
 
 
* [[Turtlebot3 Waffle NUC Foxy RealSense 20210513 Notes and Logs]]
 
* [[Turtlebot3 Waffle NUC Lib RealSense2 Utilities 20210515 Notes and Logs]]
 
* [[Turtlebot3 Waffle NUC RealSense2 Configure 20210514 Notes and Logs]]
 
* [[Turtlebot3 Waffle NUC RealSense2 udev 20210517 Notes and Logs]]
 
* [[Turtlebot3 Waffle NUC RealSense2 Use 20210518 Notes and Logs]]
 

Latest revision as of 17:52, 14 June 2021

References

Background

Repositories - Installation, Test, Demos

Information About All Things RealSense

Install

I adapted the following Dashing instructions below to Foxy.

Then I tried these Foxy instructions I found did the source install differently

Install ROS2 Dependences

sudo apt update

TBD: I didn't do an upgrade because that has sometimes broken things. This may be a mistake.

The following were already installed.

  • ros-foxy-cv-bridge
  • ros-foxy-message-filters
  • ros-foxy-image-transport

The following installed successfully.

  • rose-foxy-librealsense2

Install Other non-ROS Debian Packages

The following were already installed.

  • libssl-dev
  • libusb-1.0-0-dev
  • pkg-config
  • libgl1-mesa-dev
  • libglu1-mesa-dev

The following were installed successfully

  • libgtk-3-dev
  • libglfw3-dev

Install ros2_intel_realsense From Source - Success

Moved to the following instructions on the ROS org repository site which changed the source compile for Foxy

 $ cd src/

 $ ls
       image_pipeline  ros2_intel_realsense

 $ cd ros2_intel_realsense/

 $ git checkout refactor
       Branch 'refactor' set up to track remote branch 'refactor' from 'origin'.
       Switched to a new branch 'refactor'

 $ ls
       CHANGELOG.rst  README.md           realsense_msgs  realsense_ros
       LICENSE        realsense_examples  realsense_node

 $ cd ../..

 $ source install/local_setup.bash 

 $ colcon build --symlink-install --parallel-workers 1
       Starting >>> realsense_msgs
       Finished <<< realsense_msgs [0.85s]                     
       Starting >>> realsense_ros
       Finished <<< realsense_ros [0.43s]                     
       Starting >>> realsense_node
       Finished <<< realsense_node [0.28s]                     
       Starting >>> realsense_examples
       Finished <<< realsense_examples [0.22s]                  

       Summary: 4 packages finished [2.04s]

Configure

USB Info

 $ lsusb
       Bus 001 Device 002: ID 8087:8000 Intel Corp. 
       Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
       Bus 003 Device 003: ID 8086:0b07 Intel Corp. Intel(R) RealSense(TM) Depth Camera 435 
       Bus 003 Device 002: ID 05e3:0617 Genesys Logic, Inc. USB3.0 Hub
       Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
       Bus 002 Device 008: ID 8087:07dc Intel Corp. 
       Bus 002 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
       Bus 002 Device 003: ID 0483:5740 STMicroelectronics Virtual COM Port
       Bus 002 Device 006: ID 413c:3200 Dell Computer Corp. Mouse
       Bus 002 Device 004: ID f617:0905 Silicon Labs CP2102 USB to UART Bridge Controller
       Bus 002 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
       Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 $ lsusb -s 3:3 -v

       Bus 003 Device 003: ID 8086:0b07 Intel Corp. Intel(R) RealSense(TM) Depth Camera 435 
       Couldn't open device, some information will be missing
       ...
       ...

Setting udev Rules

librealsense2-udev-rules found here referenced in the Installing the Packages section

 $ sudo cp /lib/udev/rules.d/60-librealsense2-udev-rules.rules /etc/udev/rules.d/
       [sudo] password for eepp: 

Configure with the Camera's Serial Number

 $ rs-enumerate-devices
     Device info: 
         Name                          : 	Intel RealSense D435
         Serial Number                 : 	935322071334
         Firmware Version              : 	05.11.01.100
         Recommended Firmware Version  : 	05.12.13.50
         ...
 $ cd ~/image_ws/src/ros2_intel_realsense/realsense_examples/config

 $ cp d435.yaml d435.yaml.org

 $ emacs d435.yaml&

 $ diff d435.yaml d435.yaml.org 
       4c4
       <       serial_no: 935322071334 # d435
       ---
       >       serial_no: 819312071869 # d435

Execution

Publishing Realsense

Plug in D435

TERMINAL 1

 $ source image_ws/install/local_setup.bash 

 $ ros2 run realsense_node realsense_node __params:=`ros2 pkg prefix realsense_examples`/share/realsense_ros/config/d435.yaml __ns:=/d435
       [WARN] [1621277685.022811473] [rcl]: Found remap rule '__ns:=/d435'. This syntax is deprecated. Use '--ros-args --remap __ns:=/d435' instead.
       [INFO] [1621277685.065798831] [d435.camera]: Device's serial number is not set, enabling the default device!
       [INFO] [1621277685.299402714] [d435.camera]: Device with serial number 935322071334 was found.
       [INFO] [1621277685.299500802] [d435.camera]: Create a node for D4X5 Camera

Display Color Raw Image

TERMINAL 2

 $ ros2 topic list
       /d435/camera/aligned_depth_to_color/camera_info
       /d435/camera/aligned_depth_to_color/image_raw
       /d435/camera/color/camera_info
       /d435/camera/color/image_raw
       /d435/camera/depth/camera_info
       /d435/camera/depth/image_rect_raw
       /d435/camera/infra1/camera_info
       /d435/camera/infra1/image_rect_raw
       /d435/camera/infra2/camera_info
       /d435/camera/infra2/image_rect_raw
       /d435/camera/pointcloud
       /parameter_events
       /rosout
       /tf_static

 eepp@hood:~$ ros2 run opencv_ros2sub opencv_exp --ros-args -r image:=d435/camera/color/image_raw
       ^C[INFO] [1621356720.889545172] [rclcpp]: signal_handler(signal_value=2)

/d435/camera/color/image_raw is RGB. opencv_ros2sub tells opencv that it is BGR.

Opencv rossub colorimageraw.png

TERMINAL 3

$ ros2 topic echo d435/camera/color/image_raw
     ---
     header:
       stamp:
         sec: 1621719587
         nanosec: 920183274
       frame_id: camera_color_optical_frame
     height: 480
     width: 640
     encoding: rgb8
     is_bigendian: 0
       step: 1920
       data:
       - 170
       - 178
       ...

Other RealSense Images

TBD: modify opencv_rossub to handle other images and fix the one above

 $ ros2 run opencv_ros2sub opencv_exp --ros-args -r image:=d435/camera/depth/image_rect_raw
       terminate called after throwing an instance of 'cv::Exception'
         what():  OpenCV(4.2.0) ../modules/imgproc/src/color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function 'cv::impl::{anonymous}::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::impl::{anonymous}::Set<3, 4>; VDcn = cv::impl::{anonymous}::Set<3>; VDepth = cv::impl::{anonymous}::Set<0, 5>; cv::impl::{anonymous}::SizePolicy sizePolicy = cv::impl::<unnamed>::NONE; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
       > Invalid number of channels in input image:
       >     'VScn::contains(scn)'
       > where
       >     'scn' is 1


 /d435/camera/aligned_depth_to_color/image_raw   16UC1
 /d435/camera/color/image_raw                    rgb8
 /d435/camera/depth/image_rect_raw               16UC1
 /d435/camera/infra1/image_rect_raw              8UC1
 /d435/camera/infra2/image_rect_raw              8UC1

Using rbiz

TBD doesn't work


https://github.com/intel/ros2_intel_realsense

 eepp@hood:~$ ros2 run rviz2 rviz2 -d realsense_ros2_camera/rviz/ros2.rviz
     [INFO] [1621280162.151564317] [rviz2]: Stereo is NOT SUPPORTED
     [INFO] [1621280162.151725581] [rviz2]: OpenGl version: 3 (GLSL 1.3)
     [INFO] [1621280162.182381340] [rviz2]: Stereo is NOT SUPPORTED
 eepp@hood:~$ ros2 run realsense_ros2_camera realsense_ros2_camera
     Package 'realsense_ros2_camera' not found

Doesn't help to do a turtlebot bringup first.

Investigate

TBD

 rqt_graph

Notes and Logs

Depreciated

Install ros2_intel_realsense Binary Packages - failed

It could not locate the following packages.

  • ros-foxy-realsense-camera-msgs
  • ros-foxy-realsense-ros2-camera

So I move to the source process.

Install ros2_intel_realsense from Source - Failed

 $ cd image_ws/src/

 $ git clone https://github.com/intel/ros2_intel_realsense.git
       Cloning into 'ros2_intel_realsense'...
       remote: Enumerating objects: 961, done.
       remote: Total 961 (delta 0), reused 0 (delta 0), pack-reused 961
       Receiving objects: 100% (961/961), 1.08 MiB | 7.80 MiB/s, done.
       Resolving deltas: 100% (567/567), done.
 
 $ ls
       image_pipeline  ros2_intel_realsense

The image_pipeline did not compile cleanly. So to avoid getting error messages from its packages that did not compile, disable compiling it.

 $ cd image_pipeline/

 $ cp ~/eepp_ws/src/image_listener/CATKIN_IGNORE .

 $ cd ..

 $ cd ..
 
 $ colcon build --symlink-install --parallel-workers 1
       ...
       ...

These are the results for each package

  • Success: realsense_camera_msgs
  • Failed: realsense_ros2_camera - It could not find some of the stuff for librealsense2 which compiled fine above. Not sure what to do.