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

Windows Port (WIP) #238

Closed
wants to merge 26 commits into from
Closed

Windows Port (WIP) #238

wants to merge 26 commits into from

Conversation

lilustga
Copy link
Contributor

All of moveit2 now builds on windows. This is a work in progress PR intended for feedback.

Please explain the changes you made, including a reference to the related issue if applicable

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@@ -2,6 +2,7 @@ set(MOVEIT_LIB_NAME moveit_background_processing)

add_library(${MOVEIT_LIB_NAME} SHARED src/background_processing.cpp)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henningkayser PR #285 set's this as a global property

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress! It's also nice that there are not too many source file changes required. Did you successfully run the demo on this yet?

@@ -70,6 +72,12 @@ if(BUILD_TESTING)
)
endif()

# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${MOVEIT_LIB_NAME}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, instructions like this would fit well in a single line

@@ -0,0 +1,70 @@
// Copyright (c) 2019, Open Source Robotics Foundation, Inc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copyright (c) 2019, Open Source Robotics Foundation, Inc.
// Copyright (c) 2020, Open Source Robotics Foundation, Inc.

// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef COLLISION_DETECTION__VISIBILITY_CONTROL_HPP_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to simplify the visibility logic even more? It looks like these constants don't have to be defined for each class, so maybe we could use a single header for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henningkayser We need one macro per shared lib. However, we could put them all in one header if that's preferable. It could be one large file in moveit_common which would be include logic for every shared lib.

Copy link
Contributor Author

@lilustga lilustga Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also maybe leverage rcpputils? https://github.com/ros2/rcpputils/blob/master/include/rcpputils/visibility_control.hpp

@mikeferguson I'm not sure what you mean by leveraging rcpputils. It uses the same logic for symbol visibility but the RCPPUTILS_PUBLIC macro will switch between import and export based on whether rcpputils is the library currently being built.

@lilustga
Copy link
Contributor Author

lilustga commented Aug 5, 2020

Great progress! It's also nice that there are not too many source file changes required. Did you successfully run the demo on this yet?

I did run the demo successfully! It appears to plan successfully and I see the visualization of the arm moving in Rviz. The only issue I've noticed is an error loading the dll for the rviz planning plugin. I'll be debugging that next.

Failed to load library C:\moveit_ws\install\moveit_ros_visualization\bin\moveit_planning_scene_rviz_plugin.dll

@davetcoleman davetcoleman changed the title Draft PR - Work in Progress Windows Port Windows Port (WIP) Aug 18, 2020
@davetcoleman
Copy link
Member

@lilustga I'm excited to try this out, as I'm working more and more on a Windows machine now. Do you have any recent updates? I'd love to test this once the merge conflicts are resolved.

p.s. I made your title more concise and standard ;-)

@tylerjw
Copy link
Member

tylerjw commented Sep 3, 2020

I tried using this and am failing in the rosdep step and then I get an error when trying to run catkin. I admit I don't know what I'm doing in windows. Here are the outputs I'm seeing in case someone else knows a way around these:

rosdep errors:

c:\moveit_ws>rosdep install --from-paths src --ignore-src -r -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rospack: No definition of [python3-rosdep-modules] for OS [windows]
msft_ros_vcpkg: Cannot locate rosdep definition for [vcpkg]
robotiq_3f_gripper_control: No definition of [socketcan_interface] for OS [windows]
moveit_kinematics: No definition of [liburdfdom-tools] for OS [windows]
diagnostic_common_diagnostics: No definition of [hddtemp] for OS [windows]
python_orocos_kdl: No definition of [python3-future] for OS [windows]
moveit_tutorials: Cannot locate rosdep definition for [panda_moveit_config]
code_coverage: No definition of [lcov] for OS [windows]
eigenpy: No definition of [doxygen] for OS [windows]
spacenav_node: No definition of [libspnav-dev] for OS [windows]
ps3joy: No definition of [bluez] for OS [windows]
rviz_visual_tools: No definition of [libqt5x11extras5-dev] for OS [windows]
msft_ros2_env: Cannot locate rosdep definition for [ament_cmake]
wiimote: No definition of [cwiid] for OS [windows]
Continuing to install resolvable dependencies...
ERROR: the following rosdeps failed to install
  vcpkg: Vcpkg is not installed

cmake errors:

==> Processing catkin package: 'catkin'
==> cmake c:\moveit_ws\src\catkin -DCATKIN_DEVEL_PREFIX=c:\moveit_ws\devel_isolated\catkin -DCMAKE_INSTALL_PREFIX=c:\opt\ros\melodic\x64 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=C:/opt/ros/melodic/x64;C:/opt/rosdeps/x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DPYTHON_VERSION=2.7 -DPYTHON_EXECUTABLE=C:\opt\python27amd64\python.exe -DPYTHON_LIBRARIES=C:\opt\python27amd64\Libs -DCATKIN_SKIP_TESTING=ON -G NMake Makefiles in 'c:\moveit_ws\build_isolated\catkin'
-- Using CATKIN_DEVEL_PREFIX: C:/moveit_ws/devel_isolated/catkin
-- Using CMAKE_PREFIX_PATH: C:/opt/ros/melodic/x64;C:/opt/rosdeps/x64
-- Using PYTHON_EXECUTABLE: C:/opt/python27amd64/python.exe
-- Using default Python package layout
-- Could NOT find PY_em (missing: PY_EM)
CMake Error at cmake/empy.cmake:30 (message):
  Unable to find either executable 'empy' or Python module 'em'...  try
  installing the package 'python-empy'

@lilustga
Copy link
Contributor Author

lilustga commented Sep 3, 2020

Hi @tylerjw,

Which version of ROS are you using?

@tylerjw
Copy link
Member

tylerjw commented Sep 3, 2020

melodic, as that is what was recommended on moveit.ros.org, should I be using noetic?

🤦 that's ROS1, feel free to laugh at me.

@tylerjw
Copy link
Member

tylerjw commented Sep 3, 2020

I need to figure out how to test this... which means I need to install foxy on windows first...

@lilustga
Copy link
Contributor Author

lilustga commented Sep 3, 2020

@tylerjw you can use chocolatey to install a foxy prerelease:
choco upgrade ros-foxy-desktop -y --pre

I'm testing now as well, previously I ported moveit2 to Windows on eloquent where I did my original testing.

@tylerjw
Copy link
Member

tylerjw commented Sep 3, 2020

I get errors when I try that:

ros-foxy-desktop
By upgrading you accept licenses for the packages.
ros-foxy-desktop is not installed. Installing...
ros-foxy-desktop not installed. The package was not found with the source(s) listed.
 Source(s): 'https://chocolatey.org/api/v2/'
 NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
 the package may not be found.
Please see https://chocolatey.org/docs/troubleshooting for more
 assistance.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - ros-foxy-desktop - ros-foxy-desktop not installed. The package was not found with the source(s) listed.
 Source(s): 'https://chocolatey.org/api/v2/'
 NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
 the package may not be found.
Please see https://chocolatey.org/docs/troubleshooting for more
 assistance.

@lilustga
Copy link
Contributor Author

lilustga commented Sep 3, 2020

I get errors when I try that:

ros-foxy-desktop
By upgrading you accept licenses for the packages.
ros-foxy-desktop is not installed. Installing...
ros-foxy-desktop not installed. The package was not found with the source(s) listed.
 Source(s): 'https://chocolatey.org/api/v2/'
 NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
 the package may not be found.
Please see https://chocolatey.org/docs/troubleshooting for more
 assistance.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - ros-foxy-desktop - ros-foxy-desktop not installed. The package was not found with the source(s) listed.
 Source(s): 'https://chocolatey.org/api/v2/'
 NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
 the package may not be found.
Please see https://chocolatey.org/docs/troubleshooting for more
 assistance.

Try running this first:

mkdir c:\opt\chocolatey
set ChocolateyInstall=c:\opt\chocolatey
choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1

@tylerjw
Copy link
Member

tylerjw commented Sep 3, 2020

I got that to work and then I did this:

c:\opt\ros\foxy\x64\setup.bat
mkdir c:\moveit_ws\src
cd c:\moveit_ws 
curl -o overrides.rosinstall https://raw.githubusercontent.com/ms-iot/master/moveit2.repos

Now I'm struggling with how to use vcstool in windows (I'm assuming that's the next step as wstool isn't in ros2).

@davetcoleman
Copy link
Member

@lilustga would you mind resolving the conflicting files to make testing this PR easier?

@lilustga
Copy link
Contributor Author

lilustga commented Sep 4, 2020

@lilustga would you mind resolving the conflicting files to make testing this PR easier?

Hi Dave,

I'm currently working on a rebased version of this PR to resolve the conflicts. I'm also fixing some new build breaks which occurred in the move from eloquent on Windows to foxy on Windows. 18/21 packages building so far.

moveit2.repos Outdated
@@ -1,7 +1,7 @@
repositories:
moveit2:
type: git
url: https://github.com/ros-planning/moveit2
url: https://github.com/ms-iot/moveit2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to revert these

@davetcoleman davetcoleman changed the base branch from master to main September 15, 2020 22:21
@lilustga
Copy link
Contributor Author

@davetcoleman @tylerjw

If you want to try out the latest binary you can do it easily now because we've added moveit2 to our foxy desktop build.

To try the demo on Windows you simply need to:

@davetcoleman
Copy link
Member

@lilustga we'd really like to see this PR merged (conflicts resolved, feedback addressed) so we can use the latest version of MoveIt 2 from source on Windows.

@lilustga
Copy link
Contributor Author

PR #285 moves the symbol visibility cmake code into a common package (as discussed last week at the moveit2 meeting)

Note that it doesn't replace the need for explicit symbol visibility macros (i.e. visibility_control.hpp) in exceptional cases like static global variables.

I will make another PR with the rest of the fixes which are staged in ms-iot/moveit2.

@Ace314159
Copy link
Contributor

Are there any updates regarding this PR? I'd love to use MoveIt2 on Windows. Is there anything I can do to help?

@ooeygui ooeygui mentioned this pull request Jun 17, 2021
@Ace314159 Ace314159 mentioned this pull request Jul 1, 2021
6 tasks
@davetcoleman
Copy link
Member

This should be closed because #530 was merged, correct?

MikeWrock pushed a commit to MikeWrock/moveit2 that referenced this pull request Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants