Items with no label
3335 Discussions

Using D415 with ROS

SBans3
Beginner
4,871 Views

Hello All,

I am using Intel D415 for our Robotic Arm. I got to know about the ROS wrapppers from this https://github.com/intel-ros/realsense https://github.com/intel-ros/realsense.

I am able to launch rs_camera in my ROS environment. And also able to watch the image, depth data and pointclouds in RViz.

But I need to interface this camera with my URDF at specific link. Can somebody please provide a help or example code for that.

Regards,

Saurabh

0 Kudos
15 Replies
MartyG
Honored Contributor III
2,226 Views

I have not dealt with URDF before, so apologies if I make some obvious mistakes.

As the URDF (Universal Robot Description Format) name suggests, it is usually linked up to RealSense cameras by providing a 'description' file, using a macro language called xacro..

http://wiki.ros.org/urdf http://wiki.ros.org/urdf

I'm not sure if this will be useful, but below is a link to the UDRF xacro file for the earlier Intel Euclid product, which had a RealSense ZR300 camera inside it. Looking at it may give some insight about how to set up an URDF description file for your D415 project.

https://github.com/IntelEuclid/euclid_description/blob/master/urdf/euclid.urdf.xacro euclid_description/euclid.urdf.xacro at master · IntelEuclid/euclid_description · GitHub

https://github.com/IntelEuclid/euclid_description GitHub - IntelEuclid/euclid_description: Intel Euclid Description with URDF

0 Kudos
SBans3
Beginner
2,226 Views

Hello Marty,

Thanks a lot for responding to my query.

I saw the https://github.com/IntelEuclid/euclid_description link you shared. Can you please let me know if it is a working package.

I was not able to get how you are starting the camera process. As what I have seen generally, camera is added as a sensor plugin and respective .so file is passed in the URDF.

But here I was not able to see mention of a .so file.

If this is a working one, can you please provide the package for D415 and integrating procedure in my current URDF.

Thanks again.

Saurabh

0 Kudos
MartyG
Honored Contributor III
2,226 Views

As I said above, I am new to the concept of URDF and learning as I research your case. So I apologize.

I think a better approach may be for you to refer to a complete TurtleBot3 robotic vehicle project created by RealSense robotics and SLAM expert McCool as it contains the complete blueprints as well as the description file for that project. So it will be easier to see how everything links together.

Project main pages

https://software.intel.com/en-us/articles/build-an-autonomous-mobile-robot-with-the-intel-realsense-camera-ros-and-sawr Build an Autonomous Mobile Robot with the Intel® RealSense™ Camera, ROS*, and SAWR | Intel® Software

https://github.com/01org/sawr GitHub - 01org/sawr

Description file for the project, and launch files for publishing the data

https://github.com/01org/sawr/tree/master/sawr_description sawr/sawr_description at master · 01org/sawr · GitHub

0 Kudos
SBans3
Beginner
2,226 Views

Hello Marty,

Thanks a lot for providing the repository link. It was really useful.

I added few more links in my URDF related to Camera's links, and also added a piece of code to my camera launch file:

<!-- Start nodelet manager -->

type="nodelet"

name="nodelet_manager"

args="manager"

output="screen"/>

Thank you once again for your kind help.

With warm regards,

Saurabh

0 Kudos
MartyG
Honored Contributor III
2,226 Views

Awesome news! I'm very glad you got it working, and I appreciate you sharing your additions with the community. Have a great weekend!

0 Kudos
SBans3
Beginner
2,226 Views

Hello Marty,

I am able to get the PointClouds in my RViz. But there seems to be some TF problem.

And direction of point cloud is random each time I start.

I think this may be the reason because of high data rate.

I tried to reduce the frame rate from 30 to some lower value in the launch file itself.

But it gives error and doesn't run with some other frame rate than 30.

Can you please let me know to change the frame rate, as I don't need that much frame rate for my application.

Saurabh

0 Kudos
MartyG
Honored Contributor III
2,226 Views

If you are using a JSON configuration file to set the FPS then that apparently does not work at present, as any FPS set in the JSON configuration gets overridden by the pipeline on startup. The last I heard at the end of February was that the development team would be looking at this issue.

If you can write your own application, you could try setting the FPS at the pipeline point in the line of code that sets the resolution. Here's some example resolutions and FPS.

COLOR

cfg.enable_stream( RS2_STREAM_COLOR, 1920, 1080, RS2_FORMAT_RGB8, 30 );

DEPTH

cfg.enable_stream( RS2_STREAM_DEPTH, 1920, 1080, RS2_FORMAT_Z16, 30 );

IR

cfg.enable_stream(RS2_STREAM_INFRARED, -1, 1280, 720, RS2_FORMAT_UYVY, 30);

The first two numbers in the bracket set the resolution, and the final number at the end of the bracket sets the FPS.

An example script can be found in this link:

0 Kudos
SBans3
Beginner
2,226 Views

Hello Marty,

No I am not using the JSON configuration to set the Camera FPS.

But I am using the ROS wrappers from this link (https://github.com/intel-ros/realsense/releases Releases · intel-ros/realsense · GitHub ).

Here as I have copied the rs_camera.launch file and using to to launch the node for our Camera.

Please have a look on the attached file camera.launch (just renamed from rs_camera.launch).

I tried to change the FPS at 2 places as below:

1. I tried to change depth_fps and color_fps in camera.launch file attached.

2. There is a file constants.h in Camera ROS package, at this location realsense2_camera/include/constants.h.

Here I tried with changing DEPTH_FPS and COLOR_FPS.

By default the FPS is 30. Whenever I try to change FPS from 30 to something else (I tried even 25, 35, 10), it is throwing below error:

With RS200 04/06 15:11:31,661 WARNING [140124075702144] (backend-v4l2.cpp:1098) Pixel format 435a4e49-b602-480f-978c-e4e88ae likely requires patch for fourcc code INZC! 04/06 15:11:31,662 WARNING [140124075702144] (backend-v4l2.cpp:1098) Pixel format 52494150-8536-4841-b6bf-8fc6ffb likely requires patch for fourcc code PAIR! 04/06 15:11:31,662 WARNING [140124075702144] (sensor.cpp:313) Unregistered Media formats : [ INZC PAIR Y10 YUYV ]; Supported: [ ][ WARN] [1528105291.663445508]: Given stream configuration is not supported by the device! Stream: Depth, Stream Index: 0, Format: Z16, Width: 640, Height: 480, FPS: 35[ WARN] [1528105291.666485695]: Given stream configuration is not supported by the device! Stream: Color, Stream Index: 0, Format: RGB8, Width: 640, Height: 480, FPS: 35[ INFO] [1528105291.666532755]: publishStaticTransforms...[ERROR] [1528105291.666576372]: Given depth profile is not supported by current device![FATAL] [1528105291.831958069]: Failed to load nodelet '/camera/realsense2_camera` of type `realsense2_camera/RealSenseNodeFactory` to manager `realsense2_camera_manager'[camera/realsense2_camera_manager-2] process has died [pid 14435, exit code 1, cmd /opt/ros/kinetic/lib/nodelet/nodelet manager __name:=realsense2_camera_manager __log:=/home/saurabh/.ros/log/75d971c6-67db-11e8-a8b1-a86bad217c79/camera-realsense2_camera_manager-2.log].log file: /home/saurabh/.ros/log/75d971c6-67db-11e8-a8b1-a86bad217c79/camera-realsense2_camera_manager-2*.log[camera/realsense2_camera-3] process has died [pid 14436, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load realsense2_camera/RealSenseNodeFactory realsense2_camera_manager __name:=realsense2_camera __log:=/home/saurabh/.ros/log/75d971c6-67db-11e8-a8b1-a86bad217c79/camera-realsense2_camera-3.log].log file: /home/saurabh/.ros/log/75d971c6-67db-11e8-a8b1-a86bad217c79/camera-realsense2_camera-3*.log

And with D415[ WARN] [1528105801.864239262]: Given stream configuration is not supported by the device! Stream: Depth, Stream Index: 0, Format: Z16, Width: 640, Height: 480, FPS: 25 04/06 15:20:01,865 WARNING [139785883817856] (backend-v4l2.cpp:1098) Pixel format 36315752-1a66-a242-9065-d01814a likely requires patch for fourcc code RW16! 04/06 15:20:01,866 WARNING [139785883817856] (sensor.cpp:313) Unregistered Media formats : [ RW16 ]; Supported: [ ][ WARN] [1528105801.874165779]: Given stream configuration is not supported by the device! Stream: Color, Stream Index: 0, Format: RGB8, Width: 640, Height: 480, FPS: 25[ INFO] [1528105801.874521207]: publishStaticTransforms...[ERROR] [1528105801.874569321]: Given depth profile is not supported by current device![FATAL] [1528105802.129559177]: Failed to load nodelet '/camera/realsense2_camera` of type `realsense2_camera/RealSenseNodeFactory` to manager `realsense2_camera_manager'[camera/realsense2_camera_manager-2] process has died [pid 16561, exit code 1, cmd /opt/ros/kinetic/lib/nodelet/nodelet manager __name:=realsense2_camera_manager __log:=/home/saurabh/.ros/log/a5ff95c8-67dc-11e8-a8b1-a86bad217c79/camera-realsense2_camera_manager-2.log].log file: /home/saurabh/.ros/log/a5ff95c8-67dc-11e8-a8b1-a86bad217c79/camera-realsense2_camera_manager-2*.log[camera/realsense2_camera-3] process has died [pid 16562, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load realsense2_camera/RealSenseNodeFactory realsense2_camera_manager __name:=realsense2_camera __log:=/home/saurabh/.ros/log/a5ff95c8-67dc-11e8-a8b1-a86bad217c79/camera-realsense2_camera-3.log].log file: /home/saurabh/.ros/log/a5ff95c8-67dc-11e8-a8b1-a86bad217c79/camera-realsense2_camera-3*.log

Please let me know, if you are able to get something from this information.

Or please let me know if something more is needed.

Saurabh

0 Kudos
MartyG
Honored Contributor III
2,226 Views

If you are using an R200 camera (RS200) with the ROS wrapper you linked to at the beginning of this discussion then I would not be surprised, as that wrapper is intended for the SR300 (sometimes called SR300 by people), the D415 or D435.

In regard to the D415 problem ... 'fourcc code' errors can be tricky to diagnose. Someone else with a fourcc code RW16, like you had on D415, fixed their problem by calling a hardware_reset() instruction in their script.

https://github.com/IntelRealSense/librealsense/issues/1086 Frames didn't arrive error - after improper shutdown · Issue # 1086 · IntelRealSense/librealsense · GitHub

0 Kudos
SBans3
Beginner
2,226 Views

Hello Marty,

Thanks for the response. Yes I have tried both camera (RS300 and D415) with this ROS Wrapper package.

Both are working fine at 30FPS, and I am able to get the PointClouds also.

But for anyone, if I change the frame rate to anything else than 30FPS (less or more, like I tried both 25FPS and 35FPS), both the cameras leads to the respective errors.

I checked the like shared by you, but I think my problem is little different. As I checked the camera with below procedure:

1. Used the camera at 30FPS, there was no error and I was able to generate and view the PointClouds

2. Changed the frame rate to 25FPS (or 35FPS), without plugging out. There I got respective errors.

3. Changed back the frame rate to 30FPS again, then I was able to run without any error thrown.

So these steps I did without plugging in/out the cable. So it seems my problem is different and neither I am getting this error logs:

RealSense error calling rs2_pipeline_wait_for_frames(pipe:0x8ceea0): 

Frame didn't arrived within 5000

So I will request you to confirm the actual procedure to change the Frame rate when we are using ROS Wrappers.

Definitely there should be something that I am missing to change the Frame Rate.

And can you please also confirm if we reduce the Frame rate, then it is having some negative impact on Stereo vision?

With best regards,

Saurabh

0 Kudos
MartyG
Honored Contributor III
2,226 Views

There is a ROS tutorial for changing the FPS that may give you some useful insight.

http://wiki.ros.org/realsense_camera/Tutorials/change_camera_parameters realsense_camera/Tutorials/change_camera_parameters - ROS Wiki

I am not aware of a negative effect of reducing the frame rate. In some cases it may be beneficial, as it can make a stream more stable and less prone to freezing up by reducing the amount of data bandwidth being pumped to the USB port.

0 Kudos
SBans3
Beginner
2,226 Views

Hello Marty,

I really appreciate your efforts to help me solve this problem.

First of all, sorry to create a confusion, I am using SR300 and D415 and I am not using any RS300 or R200.

So the launch file to modify the default parameters in your link will support only R200.

But that is not my problem, still I made the respective change in the .launch file, and by default mode was set to manual, so I changed the FPS to 25.

But it didn't worked and having a huge error logs. Please have a look in attached file.

And above that, as I am using D415, so I want to have solution for that too. realsense_camera doesn't support D415.

And D415 is supported by realsense2_camera only.

And realsense2_camera is not having any parameter named as mode.

So if you can try to test this package with D415, it will be really very much helpful to me.

Please let me know if any other modification I can do to make it working.

Saurabh

0 Kudos
MartyG
Honored Contributor III
2,226 Views

I do not have the ability to test ROS on my computer's setup, unfortunately. I'm sorry to say that this case is going beyond the extent of my general level of ROS knowledge and would benefit from an Intel support team member with specialist ROS knowledge taking it up from this point onward. I do apologize and hope that somebody else can help you to find a resolution. Good luck!

0 Kudos
SBans3
Beginner
2,226 Views

Hello Marty,

I was going through 'realsense_camera' package. Here there is one parameter in its launch file 'publish_tf'.

Actually I have to set this flag to false, as TF is already provided by URDF itself.

May be because of this there is a clash and I am getting wrong direction of PointCloud.

But I was not able to find this parameter in 'realsense2_camera' package.

Can you please let me know the equivalent for this field in 'realsense2_camera'.

With warm regards,

Saurabh

0 Kudos
MartyG
Honored Contributor III
2,226 Views

realsense2_camera has a reference called publish_static_tf that you could try.

0 Kudos
Reply