Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use method2 to install realsense-ros in windows get problem #1797

Closed
Twilight89 opened this issue Apr 8, 2021 · 19 comments
Closed

Use method2 to install realsense-ros in windows get problem #1797

Twilight89 opened this issue Apr 8, 2021 · 19 comments
Labels

Comments

@Twilight89
Copy link

Twilight89 commented Apr 8, 2021

Hi~ I try to install realsense-ros in windows, and I have installed SDK2.0 in windows. When I run catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release , it get errors:
NMAKE : fatal error U1077: “P:\VisualStudio2017\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “P:\VisualStudio2017\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe”: 返回代码“0x2”
Stop.
NMAKE : fatal error U1077: “P:\VisualStudio2017\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe”: 返回代码“0x2”
Stop.
Invoking "nmake" failed
(Inside 返回代码=return code)
By the way, in windows I can't run this command:
git checkout git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1
Because no grep and tail command in windows.
And I use SDK2.43, ros rapper2.2.23, which is campatible I think.
Can you help me? I have got into big trouble.
Hope for your reply soon. Thanks~

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 8, 2021

Hi @Twilight89 Yes, SDK 2.43.0 and ROS wrapper 2.2.23 are a compatible match.

As a starting point in investigating your case, may I confirm please if you have installed ROS on Windows before you began installing the RealSense ROS wrapper (2.2.23). Having ROS installed is a requirement for using the RealSense ROS wrapper.

https://wiki.ros.org/Installation/Windows

@Twilight89
Copy link
Author

Twilight89 commented Apr 8, 2021

@MartyG-RealSense
Thanks for your reply~
I am pretty sure that I have installed ros on windows.
For more detail:
image
image

Hope reply, sincerely.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 8, 2021

Which version of ROS are you using please? There are separate wrappers for ROS1 and ROS2 with different instructions.

ROS1 (Kinetic, Melodic, Noetic)
https://github.com/IntelRealSense/realsense-ros

ROS2 (Dashing, Eloquent, Foxy)
https://github.com/IntelRealSense/realsense-ros/tree/ros2

If you are using ROS1 then you would use the 2.2.23 ROS1 wrapper with SDK 2.43.0.

If you are using ROS2 then you would use the 3.1.5 ROS2 wrapper with SDK 2.43.0.

@Twilight89
Copy link
Author

@MartyG-RealSense
Sorry for the delay and thanks for your reply.
I have installed ros1 melodic on windows, which use the 2.2.23 ROS1 wrapper with SDK 2.43.0. In this part I think there is no problem.
image
So I'm so confused about my problem and search all issues about windows, but no one seems to me.
Really need your help. Thanks~

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 9, 2021

The link below has a guide to installing ROS on Windows and running roscore.

https://janbernloehr.de/2017/06/10/ros-windows

Your roscore launch output in the image above is almost the same as the roscore launch output shown in an image in the guide in the section titled Run a simple test. So that would suggest to me that your ROS Melodic installation on Windows is okay.

So let's look again at the Method 2 process for installing RealSense ROS wrapper 2.2.23.

You confirmed in your first message in this discussion that you have installed the librealsense SDK, which is required for using the RealSense ROS wrapper.

Are you using the Windows Command Prompt terminal interface to enter the commands to set up the catkin workspace for the ROS wrapper as described in the guide linked to below?

#1366 (comment)

The Command Prompt is the interface that can be found by typing the word command into the text box at the bottom of the Windows screen, next to the corner button where the PC is shut down.

@Twilight89
Copy link
Author

@MartyG-RealSense
Hi,
I am sure that I have installed ros melodic on windows because I can run turtlesim demo. And I didn't use WSL which is windows subsystem linux.

In fact, if you just use "cmd" to run, there will be mistake that couldn't find ros and c++ compiler.

So I create one like bellow, just like a command window in ubuntu.

image

In the red rectangle:
C:\Windows\System32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 && c:\opt\ros\melodic\x64\setup.bat
I think it tells that this file is "C:\Windows\System32\cmd.exe", and it will use c++ compiler in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat". And set environment for ros by "c:\opt\ros\melodic\x64\setup.bat".

So I think this part is also no problem. I pretty curious that can you guys run this repo(realsense-ros) on windows ?
Because In you tutorial for installing on windows, there is a command "git checkout git tag | sort -V | grep -P "^2.\d+.\d+" | tail -1" which can not run on windows. And in this issue, this guy also met this problem, but the solution is that giving up on windows.

I am very sad about this problem, exhaust me a lot, spending whole day but can't fix it.
Hope for your help, sincerely.

@MartyG-RealSense
Copy link
Collaborator

I recall a case where a RealSense ROS user bypassed the grep problem by replacing the checking equation with simply the value of the ROS wrapper version that they were using. For example in your case:

git checkout 2.2.23

#1322 (comment)

@Twilight89
Copy link
Author

@MartyG-RealSense
Hi,
Thanks for reply. I ran this command git checkout 2.2.23:
image

But subsequently run catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release, it got error same as my second message.

Maybe git checkout 2.2.23 is not the solution.
Could you install this repo on windows to see whether this problem would happen to you ?
Sincerely.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 10, 2021

I am not set up on my computer to perform an installation myself. Let's check through the installation steps in the instructions.

Before entering the catkin_make command, have you cloned the ROS dependency ddynamic_reconfigure into your catkin_ws/src folder from the link below:

https://github.com/pal-robotics/ddynamic_reconfigure/tree/kinetic-devel

Also, after you entered the git checkout 2.2.23 command, did you then input cd .. as mentioned in the instructions to navigate one directory backwards before entering the catkin_init_workspace command?

If you did this, did you then input cd .. again to once again navigate one folder backwards before inputting catkin_make clean and catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release

@Twilight89
Copy link
Author

@MartyG-RealSense

  1. I am pretty sure that I have clone ddynamic_reconfigure. Because at first I did't clone this one, it got another error, so I read the README.MD carefully. And I find this procedure.
    image
  2. I have run catkin_init_workspace. So in src file, there is a CMakeLists.txt.
  3. Yep, I know catkin_make clean and catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release should run in catkin_ws file.
    So, these parts seem no problem.
    I have checked these procedure for 3-4 times.
    Sincerely.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 10, 2021

Other ROS users (not just RealSense ones) have had problems with setting the -DCATKIN_ENABLE_TESTING=False term. One RealSense ROS user got past the error by using True to permit testing.

@Twilight89
Copy link
Author

Thanks for advice.
But it didn't work for me. It just got the same error. And I directly run catkin_make, also got the same error.
Does anyone install realsense-ros on windows successfully?

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 10, 2021

I do not personally recall a case where someone has clearly, without any room for doubt, confirmed that they succeeded in setting up the RealSense ROS wrapper from source-code on Windows and could not find such a case by researching it. As it is supported in the installation instructions though, I have to assume that it is possible.

@Twilight89
Copy link
Author

Ok, I don't think I have enough time to solve this weird problem.
If anyone meets this problem and has a work around, please @ me.
Thanks again for your patience and time.

@MartyG-RealSense
Copy link
Collaborator

You are very welcome @Twilight89

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

If future readers of this case have advice for @Twilight89 then please feel free to leave a comment.

@TobiasVishchers
Copy link

I had the same problem (Win10, ROS Melodic, SDK 2.45 and ROS wrapper 2.3.0).
I still cant install the package, but was able to get one step further than @Twilight89.
As shown in Twilight89s screenshot there were some undeclared identifiers "RS2_OPTIONS_...".
Those are missing if you install via vcpkg but are availabe if you install the SDK per binary installer.

So I copied the include folder from the sdk (C:\Program Files (x86)\Intel RealSense SDK 2.0\include)
and replaced the one from vcpkg (C:\opt\ros\melodic\x64\tools\vcpkg\installed\x64-windows\include)
(dont rosdep install, because that will override vcpkg again with the wrong files)

CMake gets to 100% now but fails while linking the shared library realsense2_camera.dll

grafik

@TobiasVishchers
Copy link

"vcpkg list" tells me that it installed realsense2:x64-windows 2.34.0.
Could it be a solution to use an older ROS wrapper?
There doesn't seem to be a Wrapper version which targets sdk 2.34.0 though.
Build 2.2.12 supports SDK v2.35.2 and Build 2.2.13 supports SDK v2.33.1.

@MartyG-RealSense
Copy link
Collaborator

@TobiasVishchers My recollection from the time that these SDKs were released is that it was okay to use the wrapper for 2.33.1 with 2.34.0 because there were not significant changes between SDKs 2.33.1 and 2.34.0.

Having said that, I usually recommend avoiding SDK 2.34.0 because it had an issue that generated continuous timing errors for some RealSense users. If you do not experience that error yourself then it should be okay to use it though.

IntelRealSense/librealsense#6189 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants