Closed FaboNo closed 4 years ago
Hi @FaboNo Since ROS wrapper version 2.2.15, infra, fisheye, IMU and pose streams are set to false by default. You can enable them in your roslaunch statement or in the launch file. For example, to enable infra1 and infra2 in roslaunch:
roslaunch realsense2_camera rs_camera.launch enable_infra1:=true enable_infra2:=true
Regarding the IMU calibration: originally, the D435i IMU sensor was not calibrated in the factory, though the other sensors in the camera are factory-calibrated. I haven't heard information that this has changed. A calibration of the IMU can be performed using a Python-based tool.
https://dev.intelrealsense.com/docs/imu-calibration-tool-for-intel-realsense-depth-camera
Use of this tool can correct an issue where the accel values do not settle near zero even when the camera is stationary. The software calibration is needed because the IMU component in the camera does not have its own internal calibration.
Once a calibration has been successfully completed and written to the camera hardware, an option becomes available in the RealSense Viewer to perform motion correction on the IMU data. This 'fixes' the raw IMU data to take account of known inaccuracies in the IMU component so that the 'fixed' results are closer to what they should be.
It looks as though your librealsense installation has significant problems related to the kernel though. This was indicated first by the error Pixel format 36315752-1a66-a242-9065-d01814a likely requires patch for fourcc code RW16! and later by the long list of kernel related xioctl(UVCIOC_CTRL_QUERY) failed errors in your log.
Which computer / computing device do you have Ubuntu installed on, please?
@MartyG-RealSense Thank you for your answer
Actually I did enter
roslaunch realsense2_camera rs_camera.launch unite_imu_method:=linear_interpolation enable_infra1:=true enable_infra2:=true
but i did not get all the expected topics.
I installed the librealsense on an Intel NUC. What I will do is deinstall and reinstall and calibrate the IMU. Then I will see what's happen and get back to you in case I run into problems again
Thank you
@MartyG-RealSense one more information because after reinstalling everything and start realsense-viewer
I still get the following message:
08/09 12:30:33,495 WARNING [140351643637504] (backend-v4l2.cpp:1269) Pixel format 36315752-1a66-a242-9065-d01814a likely requires patch for fourcc code RW16!
My kernel (uname -r) is 5.4.0-47-generic
Should be compatible with the SDK?
@FaboNo Kernel 5.4 is not yet officially validated for use with librealsense (the most recent officially validated kernel is 5.3), though many RealSense users have been able to unofficially use 5.4 with librealsense.
Assuming that your Intel NUC has an Intel processor chip, it should be able to work with the distribution package method of librealsense installation.
A way to build librealsense without kernel conflicts is to use a method called RSUSB backend. It is useful for situations where the normal installation methods are not working. It requires an internet connection to perform the installation but is not dependent on Linux versions or kernel versions and does not require patching. The instructions in the link below are for SDK 2.36.0 - just substitute the 2.36.0 parts of the instructions for 2.37.0.
https://github.com/IntelRealSense/librealsense/issues/6845#issuecomment-659540316
@MartyG-RealSense so you mean I have to recompile from source the 2.37 release?
Yes, the RSUSB method uses the source code folder from the Releases page instead of the DKMS packages used in the Distribution method. The zipped source code folder for 2.37.0 should be downloaded from the Assets list of that version and extracted.
@MartyG-RealSense I successfully compiled the library. But I am a bit puzzled with the next steps (sorry about that). Do I need to do sudo make install
? Deinstall all the dkms one? ....
No problem at all. Having multiple librealsense installations made by different methods can sometimes cause conflicts, so uninstall the DKMS one if you encounter problems.
As far as I know there is not a further step after the CMake instruction completes with the RSUSB method. Are you able to use applications such as RealSense Viewer in the new installation of librealsense, please?
@MartyG-RealSense I did `sudo make install' to install the libraries on /usr/local
when I entered
fabrice@fabrice-desktop:~/src/librealsense-2.37.0/build$ tools/realsense-viewer/realsense-viewer
I got the following messages...
08/09 15:22:05,000 WARNING [140207844222720] (backend-v4l2.cpp:1270) Pixel format 36315752-1a66-a242-9065-d01814a likely requires patch for fourcc code RW16!
08/09 15:22:11,006 WARNING [140208134854528] (types.cpp:78) hwmon command 0x4f( 0 208 0 0 ) failed (response -21= No data to return)
08/09 15:22:11,007 WARNING [140208134854528] (ds5-motion.cpp:480) IMU Calibration is not available, default intrinsic and extrinsic will be used.
08/09 15:22:11,014 WARNING [140207684826880] (backend-hid.cpp:681) HID set_power 1 failed for /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.5/0003:8086:0B3A.000C/HID-SENSOR-200076.4.auto/iio:device1/buffer/enable
08/09 15:22:11,014 WARNING [140207420602112] (backend-hid.cpp:681) HID set_power 1 failed for /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.5/0003:8086:0B3A.000C/HID-SENSOR-200073.3.auto/iio:device0/buffer/enable
08/09 15:22:11,015 WARNING [140207194109696] (sensor.cpp:970) HID timestamp not found, switching to Host timestamps.
Looks like I still have the problem plus a new one with the HID-SENSORS
Could you try uninstalling all of the RealSense DKMS packages from the previous installation with the command below please to see if that makes a difference?
dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge
@MartyG-RealSense yes I did it before and reinstall the package for the udev rules only.
If the source code was being compiled using the normal (non-RSUSB) method then the instructions state that the install statement that would be used to make sure that it is a clean installation is:
sudo make uninstall && make clean && make && sudo make install
@MartyG-RealSense actually I just did mkdir build,
cd build
cmake ..
and then make
Do I need to setup any parameter with make?
I understand that the role of the uninstall and make clean commands is to do clear-up operations such as clearing the CMake cache before doing the install process. Entering the commands exactly as listed in the instructions should be sufficient:
sudo make uninstall && make clean && make && sudo make install
You can use make -j8 instead of make to speed up the build process by taking advantage of multiple cores in the processor chip, though this may make the build process more prone to failure on low-end computer specifications.
sudo make uninstall && make clean && make -j8 && sudo make install
@MartyG-RealSense I finally gave up on Melodic and did the installation on Kinetic and it works. However after achieving the imu calibration I ended up with the following message:
[-0.00424225 -0.00318948 -0.00178359]
[1000 1000 1000 1000 1000 1000]
using 6000 measurements.
[[ 1.02273049e+00 1.38555019e-02 -8.31411095e-03]
[-2.29580697e-03 1.01606005e+00 1.86339471e-02]
[-7.21045918e-05 1.07868300e-03 1.01519079e+00]
[ 4.39851838e-02 5.38233324e-01 3.48860872e-01]]
residuals: [ 6.37946886 7.88940666 157.87314031]
rank: 4
singular: [437.13818699 430.25124687 427.77323301 76.94863166]
norm (raw data ): 9.646208
norm (fixed data): 9.805130 A good calibration will be near 9.806650
With the camera fixed on the tripod, no vibration on the table, the topic /camera/imu (with
angular_velocity:
x: -0.00167128804605
y: -0.00168966234196
z: -0.001714199665
angular_velocity_covariance: [0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01]
linear_acceleration:
x: -0.213709972834
y: -9.75781635933
z: -0.674374943543
linear_acceleration_covariance: [0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01]
Indeed x and z should be something like 0.00xxx but definitively not 0.21 or 0.67, is there any mean to improve the calibration?
Thank you
You can repeat the IMU calibration as many times as you feel necessary until you are satisfied with the results. The results can be affected by how level the camera is when performing the steps where you are holding it side-on (holding it by the USB cable connector or by the other end with the USB cable resting on the flat surface). It is difficult to position the camera completely level in these two particular orientations, so you may never acheve ideal results.
As far as I know, if you are accessing the IMU data through ROS though then you get it "as is" without the ability to do further improvement processing on it.
Hi @FaboNo Do you require further assistance with this case, please? Thanks!
@MartyG-RealSense I am sorry for my late response. I have just a last question, If i want to use Kalibr can you tell me what is the best camera model to use: is it pinhole-equi or pinhole-radtan ? Thank you very much
I have not got personal experience with using Kalibr so I cannot offer guidance about that, but a RealSense user did recently uae both pinhole-equi and pinhole-radian with the D435i IMU and produced charts.
@MartyG-RealSense thanks again. I did few calibrations because I need to get the distortion prameters nd they are not provided by /camera/infra1/camera_info but what bother me is that the intrinsics I got are not similar to the ones provided by camera_info. In my case fx, fy = 381.82/381/82 (/camera/infra1/camera_info) but the calibration values are more between 386/386 -- 394/394 values. My question is : does it matter? and each camera is really calibrated or not? Thank you very much for your answer
You can check the intrinsics and extrinsics of the camera with rs-enumerate-devices -c to list the camera's full calibration information for all of the sensors that it supports on that particular model.
If you calibrated the camera and wrote the calibration to the camera then yes, you can consider it calibrated. Whether it is a good calibration will depend on the values that you wrote to the camera. You can of course try the calibration again instead of writing it to the camera if you are not satisfied with the results at the end of the calibration process.
It may therefore be worth comparing the results from rs-enumerate-devices to those that were provided at the end of the calibration process to see how well they match up.
@MartyG-RealSense ah yes quite comprehensive source of information! Thank you
However is it normal to get a distortion array with 0 values?
Intrinsic of "Infrared 2" / 640x480 / {Y8}
Width: 640
Height: 480
PPX: 319.074340820312
PPY: 237.638229370117
Fx: 381.82470703125
Fy: 381.82470703125
Distortion: Brown Conrady
Coeffs: 0 0 0 0 0
FOV (deg): 79.93 x 64.3
Does it mean that the image is already rectified?
The 400 Series cameras deliberately set all the coefficients to zero, so that is normal.
Hi @FaboNo Do you require further assistance with this case, please? Thanks!
@MartyG-RealSense No I have all the information I required thanks for your support
Thanks for the update!
@MartyG-RealSense oups sorry as I am working with other people, I have another (last) question. Can you confirm that the infra1 and infra2 images are already rectified?
The Y8 infrared channel is rectified. Y16 in librealsense is unrectified.
@MartyG-RealSense it is interesting because as I am working with other researchers on VIO based algorithm, and they prefer to work on unrectified images as a precise calibration is required. Is it possible to setup in rs_camera.launch Y16 (meaning 25Hz max and 640x400) ? Is it supported in the ros wrapper? Do I need to open a new thread because I closed this one?
It is fine to continue on this discussion after it is closed if you wish to.
Y16 is a grayscale format channel and is unrectified because it is intended to be used for the purpose of RealSense camera calibration.
I am not aware of a means to change a stream's format in RealSense ROS though.
@MartyG-RealSense I see that I can change the parameters (Y16 and image size) with realsense-viewver but I do not know if I can save them (well I do not know how to). Even though it is possible, I do not know how the ros wrapper will react...
Yes, you can set Y16 in librealsense @FaboNo but librealsense and the RealSense ROS wrapper operate independently. So setting an option in a librealsense-based program such as the Viewer does not affect the camera's behavior in ROS and vice versa.
@MartyG-RealSense Yes this is what I was afraid of (well in some sense :) ) So regarding ros wrapper we are stick to Y8 and rectified images then. Thanks again for your support.
@MartyG-RealSense Hi, I can get the imu topic but cannot echo data from that topic. Do you know how to fix this? This is a newly created issue: https://github.com/IntelRealSense/realsense-ros/issues/3121
Hi @Hanning-Liu Thanks for your question. I will reply at https://github.com/IntelRealSense/realsense-ros/issues/3121
I am running Ubuntu 18.04 and ROS MELODIC
D435i version:
I installed all the packages following the instructions provided here: https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages
My first problem is coming when I started realsense-viewer and activated motion, looks like the IMU is not calibrated but I though it was "factory calibrated"? So does it mean that I have to calibrate it myself?
Second issue is coming when I launch
Then I look at the published topics and found that many are missing (related to IMU,infra1, infra2..):
Can you help me to understand where is the problems?
I would like to understand also what is the meaning if these messages when I tried to update the firmware:
Thank you very much for your support