Skip to content

Instantly share code, notes, and snippets.

@azheng987
Last active April 14, 2023 00:06
Show Gist options
  • Save azheng987/2e714dc5097eaf1b50c0e175240fe1cb to your computer and use it in GitHub Desktop.
Save azheng987/2e714dc5097eaf1b50c0e175240fe1cb to your computer and use it in GitHub Desktop.
Testing realsense-ros with a physical camera results

Description

Calvin and I worked on making ros commands work with the goal to control the realsense camera with ros commands, similar to the way we can control Handy with the ros commands.

Steps

Run the physical camera with roslaunch realsense2_camera rs_camera.launch. Note that you can set specifications like so: roslaunch realsense2_camera rs_camera.launch align_depth:=true This makes it publish the aligned depth stream to other available streams such as color or infra-red.

Run rviz with rosrun rviz rviz

  1. Add display (bottom left button)
  2. Create visualization by topic
  3. Under the relevant dropdown, click on Image
  4. Press OK

Results of these camera types:

  1. /camera/aligned_depth_to_color/image_raw image

  2. /camera/depth/image_rect_raw image

  3. /camera/color/image_raw

image

Other

Terminal command rostopic list:

/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressed/parameter_updates
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/camera/color/metadata
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressed/parameter_descriptions
/camera/depth/image_rect_raw/compressed/parameter_updates
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
/camera/depth/image_rect_raw/compressedDepth/parameter_updates
/camera/depth/image_rect_raw/theora
/camera/depth/image_rect_raw/theora/parameter_descriptions
/camera/depth/image_rect_raw/theora/parameter_updates
/camera/depth/metadata
/camera/extrinsics/depth_to_color
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
/clicked_point
/diagnostics
/initialpose
/move_base_simple/goal
/rosout
/rosout_agg
/tf
/tf_static

Terminal command: rostopic echo /camera/infra1/camera_info | head -n100 gives information about a frame from the camera:

header: 
  seq: 3073
  stamp: 
    secs: 389
    nsecs: 374000000
  frame_id: "camera_left_ir_optical_frame"
height: 720
width: 1280
distortion_model: "plumb_bob"
D: []
K: [695.9951171875, 0.0, 640.0, 0.0, 695.9951171875, 360.0, 0.0, 0.0, 1.0]
R: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
P: [695.9951171875, 0.0, 640.0, 0.0, 0.0, 695.9951171875, 360.0, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi: 
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False
---

Results

Can now set parameters via roslaunch in a new file called rs_camera_experiments.launch. In order to test this, we edited the align_depth parameter to be true in the file and ran the file. The aligned_depth camera came up in rviz :)

Q: What is the dimensions of the color and depth channels on the camera?

A: In exploration (I don't know what dimensions mean)

Q: Does the ros module work on the physical camera?

A: The ros module does work on the physical camera!

Q:What is the behavior of the aligned depth image?

A: Aligned depth image looks to be more zoomed in and blurrier? It has less of a gradient shading on the image too. The topics produced is called aligned_depth_to_color

Next Steps

Perhaps our next step is to enable pointcloud, which takes in information from the image produced by aligned_depth_to_color. Also, we might want to try putting more objects under the cmaera to see how it interprets them, since right now the camera is mostly just fixed on a flat surface.

@azheng987
Copy link
Author

FOR PICK-AND-PLACE

First follow the instructions above to run realsense-ros. Make sure /camera/aligned_depth_to_color/image_raw and /camera/color/image_raw are working properly.

Then follow the instructions from: https://github.com/Autobots-Visman/pick-and-place

MAKE SURE THE NVIDIA CUDA DRIVER IS COMPATIBLE WITH BEFORE CONTINUING

// This comment is temporary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment