Unable to source ROS 2 setup file on Windows 10
Hello everyone,
I followed the instructions showen in the link below to install ROS2 on Windows. https://index.ros.org/doc/ros2/Window...
But when i reached the step " Set up the ROS 2 environment" and wrote that command
call C:\dev\ros2\local_setup.bat"
in command prompt this what i got
'""python" "C:\dev\ros2\_local_setup_util.py" --merged-install"' is not recognized as an internal or external command, operable program or batch file.
So i tried the following:
i run the command "python" "C:\dev\ros2_local_setup_util.py" --merged-install directly in command prompt and it worked and the output was
ament_clang_format
ament_copyright
ament_cppcheck
ament_cpplint
ament_flake8
ament_index_cpp
ament_index_python
ament_lint_cmake
ament_package
ament_cmake_core
ament_cmake_export_definitions
ament_cmake_export_include_directories
ament_cmake_export_libraries
ament_cmake_export_interfaces
ament_cmake_export_link_flags
ament_cmake_include_directories
ament_cmake_libraries
ament_cmake_export_dependencies
ament_cmake_python
ament_cmake_target_dependencies
ament_cmake_test
ament_cmake
ament_cmake_auto
ament_cmake_clang_format
ament_cmake_copyright
ament_cmake_cppcheck
ament_cmake_cpplint
ament_cmake_flake8
ament_cmake_lint_cmake
ament_cmake_nose
ament_cmake_pytest
ament_cmake_ros
ament_lint_auto
ament_pclint
ament_cmake_pclint
ament_pep257
ament_cmake_pep257
ament_pep8
ament_cmake_pep8
ament_pyflakes
ament_cmake_pyflakes
connext_cmake_module
console_bridge
fastcdr
fastrtps
fastrtps_cmake_module
gtest_vendor
ament_cmake_gtest
gmock_vendor
ament_cmake_gmock
libcurl_vendor
libyaml_vendor
opensplice_cmake_module
orocos_kdl
osrf_pycommon
ament_tools
launch
launch_testing
osrf_testing_tools_cpp
poco_vendor
class_loader
python_cmake_module
rcl_yaml_param_parser
rcutils
resource_retriever
rmw_connext_shared_cpp
rmw_implementation_cmake
ros_environment
rosidl_parser
rosidl_cmake
rosidl_generator_dds_idl
rosidl_typesupport_interface
rosidl_generator_c
rmw
rosidl_generator_cpp
rosidl_typesupport_connext_cpp
rosidl_typesupport_connext_c
rmw_connext_cpp
rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp
rmw_fastrtps_cpp
rosidl_typesupport_opensplice_cpp
rosidl_typesupport_opensplice_c
rmw_opensplice_cpp
rmw_implementation
rosidl_typesupport_c
rosidl_generator_py
rosidl_typesupport_cpp
rosidl_default_generators
rosidl_default_runtime
builtin_interfaces
example_interfaces
lifecycle_msgs
pendulum_msgs
rcl_interfaces
rcl
rcl_lifecycle
rclpy
launch_ros
ros2cli
ros2msg
ros2node
ros2param
ros2pkg
ros2launch
ros2run
ros2srv
ros2topic
ros2service
ros2lifecycle
rosgraph_msgs
rclcpp
examples_rclcpp_minimal_client
examples_rclcpp_minimal_service
examples_rclcpp_minimal_timer
rviz_assimp_vendor
rviz_ogre_vendor
rviz_rendering
rviz_rendering_tests
rviz_yaml_cpp_vendor
sros2
std_msgs
actionlib_msgs
composition
demo_nodes_cpp_native
demo_nodes_py
examples_rclcpp_minimal_composition
examples_rclcpp_minimal_publisher
examples_rclcpp_minimal_subscriber
examples_rclpy_executors
examples_rclpy_minimal_client
examples_rclpy_minimal_publisher
examples_rclpy_minimal_service
examples_rclpy_minimal_subscriber
geometry_msgs
diagnostic_msgs
logging_demo
nav_msgs
dummy_map_server
rclcpp_lifecycle
lifecycle
sensor_msgs
demo_nodes_cpp
dummy_sensors
image_tools
intra_process_demo
map_msgs
shape_msgs
std_srvs
stereo_msgs
test_cli
test_cli_remapping
test_communication
test_msgs
test_osrf_testing_tools_cpp
test_rclcpp
test_security
tf2
laser_geometry
tf2_msgs
tf2_ros
tf2_eigen
tf2_geometry_msgs
tinyxml2_vendor
pluginlib
tinyxml_vendor
topic_monitor
trajectory_msgs
uncrustify_vendor
ament_uncrustify
ament_cmake_uncrustify
ament_lint_common
urdfdom_headers
urdfdom
urdf
kdl_parser
robot_state_publisher
dummy_robot_bringup
rviz_common
rviz_visual_testing_framework
visualization_msgs
common_interfaces
rviz_default_plugins
rviz2
Here is the batch file result with echo on
C:\WINDOWS\system32>call "C:\dev\ros2\local_setup.bat"
C:\WINDOWS\system32>call:_colcon_prefix_bat_prepend_unique_value COLCON_PREFIX_PATH "%~dp0"
C:\WINDOWS\system32>setlocal enabledelayedexpansion
C:\WINDOWS\system32>set "listname=COLCON_PREFIX_PATH"
C:\WINDOWS\system32>set "value=C:\dev\ros2\"
C:\WINDOWS\system32>set "values=!COLCON_PREFIX_PATH!"
C:\WINDOWS\system32>set "all_values=C:\dev\ros2\"
C:\WINDOWS\system32>if "C:\dev\ros2\" NEQ "" (for %v in ("C:\dev\ros2\") do (if "%~v" NEQ "" (if "%~v" NEQ "C:\dev\ros2\" (set "all_values=!all_values!;%~v" ) ) ) )
C:\WINDOWS\system32>(if "C:\dev\ros2\" NEQ "" (if "C:\dev\ros2\" NEQ "C:\dev\ros2\" (set "all_values=!all_values!;C:\dev\ros2\" ) ) )
C:\WINDOWS\system32>endlocal & (set "COLCON_PREFIX_PATH=C:\dev\ros2\" )
C:\WINDOWS\system32>goto:eof
C:\WINDOWS\system32>call:_colcon_get_ordered_packages _ordered_packages "C:\dev\ros2\"
C:\WINDOWS\system32>setlocal enabledelayedexpansion
C:\WINDOWS\system32>if "" NEQ "" (
if not exist "" (
echo error: COLCON_PYTHON_EXECUTABLE '' doesn't exist
exit /b 1
)
set "_colcon_python_executable="
) else (
set "_colcon_python_executable=c:\python37\python.exe"
if not exist "" (
python --version 1>NUL 2>NUL
if errorlevel 1 (
echo error: unable to find python executable
exit /b 1
)
set "_colcon_python_executable=python"
)
)
C:\WINDOWS\system32>set "_colcon_ordered_packages="
C:\WINDOWS\system32>for /F %p in ('""python" "C:\dev\ros2\_local_setup_util.py" --merged-install"') do (
if "!_colcon_ordered_packages!" NEQ "" set "_colcon_ordered_packages=!_colcon_ordered_packages!;"
set "_colcon_ordered_packages=!_colcon_ordered_packages!%p ...