Ask Your Question
0

How to get rospack, roslaunch, etc. to work in Windows 10 (Melodic)

asked 2019-04-17 10:55:53 -0600

RobotRiley gravatar image

updated 2019-04-18 07:57:19 -0600

I have installed ROS for Windows 10 per the instructions at the link below: http://wiki.ros.org/Installation/Windows

I am having trouble figuring out where to place my workspace and packages such that they are able to use standard ROS commands. roscd brings me to C:\opt\ros\melodic\x64

I created a workspace in that directory, but none of the packages inside are recognized. I am able to start roscore and then manually start nodes with "python myfile.py", but I can't run launch files without going into the directory with the launch file and I can't use roscd package_name to jump to a package, nor use rospack package_name to find a package I create. Using the list parameter I can see the packages in the share subdirectory (of x64), but not my packages.

Are there any additional steps I need to make these commends work, or a special directory I need to put my workspace in?


Edit: I open up a command window shortcut which automatically runs c:\opt\ros\melodic\x64\setup.bat

I then use roscd to jump to c:\opt\ros\melodic\x64

I create a workspace folder (catkin_ws) there with a folder called src inside.

I run catkin_make inside or the workspace folder. This creates build and devel folders inside of the workspace folder and create a CMakeLists.txt file in the src folder.

Inside the src folder I type catkin_create_pkg test_package std_msgs rospy roscpp

There is now a test_package folder with the include and src folders, as well as CMakeLists.txt and package.xml files.

I then return to the workspace folder and run catkin_make again.

Then I run the setup.bat file in the devel folder of the workspace.

I don't have enough characters left to list all of the files and folders, but the above is what I do to get things set up.


Edit #2:

The output of rospack profile:

Full tree crawl took 0.765600 seconds. Directories marked with (*) contain no manifest. You may want to delete these directories. To get just of list of directories without manifests, re-run the profile with --zombie-only
-------------------------------------------------------------
0.718767   C:\opt\ros\melodic\x64\share
0.000000   C:\opt\ros\melodic\x64\share\doc\liborocos-kdl
0.000000   C:\opt\ros\melodic\x64\share\doc
edit retag flag offensive close merge delete

Comments

Are there any additional steps I need to make these commends work, or a special directory I need to put my workspace in?

Just making sure: you did build your workspace, correct?

gvdhoorn gravatar imagegvdhoorn ( 2019-04-17 12:43:01 -0600 )edit

As far as I know I did. I have been using those steps on the Ubuntu machine I was working on with no problems, but on the Windows computer I feel that I am missing something.

RobotRiley gravatar imageRobotRiley ( 2019-04-17 13:31:13 -0600 )edit

As far as I know I did.

So: please tell us exactly which commands you've run, how you created your workspace, what's in it and what you did after building it.

gvdhoorn gravatar imagegvdhoorn ( 2019-04-17 13:33:24 -0600 )edit
1

I run catkin_make inside or the workspace folder.

This should probably read: "inside of the workspace folder"?

Then I run the setup.bat file in the devel folder of the workspace.

If you did this, what is the output of rospack profile?

I don't have enough characters left to list all of the files and folders,

don't use comments for this sort of thing. Update your original question text by editing it.

gvdhoorn gravatar imagegvdhoorn ( 2019-04-18 01:12:21 -0600 )edit

Ok, I will respond with edits to the main question from now on.

RobotRiley gravatar imageRobotRiley ( 2019-04-18 07:58:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-04-19 15:43:06 -0600

RobotRiley gravatar image

updated 2019-04-19 19:26:01 -0600

jayess gravatar image

The solution I found was to type the following at the command line from my ROS shortcut:

choco upgrade ros-melodic-desktop -y

choco upgrade ros-melodic-desktop_full -y

For reference, the shortcut target is:

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'm not sure if only one of those commands was needed, but I ran both. After that I appended the location of my workspace batch file to the shortcut target listed above:

&& %USERPROFILE%\catkin_ws\devel\setup.bat

Doing these things gave me access to the normal ROS syntax (rospack, rosrun, etc.) for my packages. Please note that you have to use the shortcut to open your command line window in order for it to work.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-04-17 10:55:53 -0600

Seen: 424 times

Last updated: Apr 19