diff --git a/source/Installation/Alternatives/RHEL-Development-Setup.rst b/source/Installation/Alternatives/RHEL-Development-Setup.rst index 90904e9708..db14d7956d 100644 --- a/source/Installation/Alternatives/RHEL-Development-Setup.rst +++ b/source/Installation/Alternatives/RHEL-Development-Setup.rst @@ -38,10 +38,10 @@ Enable required repositories The rosdep database contains packages from the EPEL and PowerTools repositories, which are not enabled by default. They can be enabled by running: - .. code-block:: bash + .. code-block:: console - sudo dnf install 'dnf-command(config-manager)' epel-release -y - sudo dnf config-manager --set-enabled crb + $ sudo dnf install 'dnf-command(config-manager)' epel-release -y + $ sudo dnf config-manager --set-enabled crb .. note:: This step may be slightly different depending on the distribution you are using. `Check the EPEL documentation `_ @@ -54,9 +54,9 @@ Enable required repositories Install development tools ^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: bash +.. code-block:: console - sudo dnf install -y \ + $ sudo dnf install -y \ cmake \ gcc-c++ \ git \ @@ -76,9 +76,9 @@ Install development tools python3-vcstool \ wget - # install some pip packages needed for testing and - # not available as RPMs - python3 -m pip install -U --user \ + ~ install some pip packages needed for testing and + ~ not available as RPMs + $ python3 -m pip install -U --user \ flake8-blind-except==0.1.1 \ flake8-class-newline \ flake8-deprecated @@ -91,22 +91,22 @@ Get ROS 2 code Create a workspace and clone all repos: -.. code-block:: bash +.. code-block:: console - mkdir -p ~/ros2_{DISTRO}/src - cd ~/ros2_{DISTRO} - vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src + $ mkdir -p ~/ros2_{DISTRO}/src + $ cd ~/ros2_{DISTRO} + $ vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src Install dependencies using rosdep ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. include:: ../_Dnf-Update-Admonition.rst -.. code-block:: bash +.. code-block:: console - sudo rosdep init - rosdep update - rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-7.3.0 urdfdom_headers" + $ sudo rosdep init + $ rosdep update + $ rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-7.3.0 urdfdom_headers" Install additional RMW implementations (optional) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -124,47 +124,50 @@ The output should be empty. More info on working with a ROS workspace can be found in :doc:`this tutorial <../../Tutorials/Beginner-Client-Libraries/Colcon-Tutorial>`. -.. code-block:: bash +.. code-block:: console - cd ~/ros2_{DISTRO}/ - colcon build --symlink-install + $ cd ~/ros2_{DISTRO}/ + $ colcon build --symlink-install .. note:: If you are having trouble compiling all examples and this is preventing you from completing a successful build, you can use the ``--packages-skip`` colcon flag to ignore the package that is causing problems. For instance, if you don't want to install the large OpenCV library, you could skip building the packages that depend on it using the command: - .. code-block:: bash + .. code-block:: console - colcon build --symlink-install --packages-skip image_tools intra_process_demo + $ colcon build --symlink-install --packages-skip image_tools intra_process_demo Setup environment ----------------- Set up your environment by sourcing the following file. -.. code-block:: bash +.. code-block:: console - # Replace ".bash" with your shell if you're not using bash - # Possible values are: setup.bash, setup.sh, setup.zsh - . ~/ros2_{DISTRO}/install/local_setup.bash + $ . ~/ros2_{DISTRO}/install/local_setup.bash + +.. note:: + + Replace ``.bash`` with your shell if you're not using bash. + Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``. Try some examples ----------------- In one terminal, source the setup file and then run a C++ ``talker``\ : -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/install/local_setup.bash - ros2 run demo_nodes_cpp talker + $ . ~/ros2_{DISTRO}/install/local_setup.bash + $ ros2 run demo_nodes_cpp talker In another terminal source the setup file and then run a Python ``listener``\ : -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/install/local_setup.bash - ros2 run demo_nodes_py listener + $ . ~/ros2_{DISTRO}/install/local_setup.bash + $ ros2 run demo_nodes_py listener You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages. This verifies both the C++ and Python APIs are working properly. @@ -186,12 +189,12 @@ Clang To configure CMake to detect and use Clang: -.. code-block:: bash +.. code-block:: console - sudo dnf install clang - export CC=clang - export CXX=clang++ - colcon build --cmake-force-configure + $ sudo dnf install clang + $ export CC=clang + $ export CXX=clang++ + $ colcon build --cmake-force-configure Stay up to date --------------- @@ -211,6 +214,6 @@ Uninstall 2. If you're also trying to free up space, you can delete the entire workspace directory with: - .. code-block:: bash + .. code-block:: console - rm -rf ~/ros2_{DISTRO} + $ rm -rf ~/ros2_{DISTRO} diff --git a/source/Installation/Alternatives/RHEL-Install-Binary.rst b/source/Installation/Alternatives/RHEL-Install-Binary.rst index f88e34944f..823eafdac5 100644 --- a/source/Installation/Alternatives/RHEL-Install-Binary.rst +++ b/source/Installation/Alternatives/RHEL-Install-Binary.rst @@ -36,10 +36,10 @@ Enable required repositories The rosdep database contains packages from the EPEL and PowerTools repositories, which are not enabled by default. They can be enabled by running: -.. code-block:: bash +.. code-block:: console - sudo dnf install 'dnf-command(config-manager)' epel-release -y - sudo dnf config-manager --set-enabled crb + $ sudo dnf install 'dnf-command(config-manager)' epel-release -y + $ sudo dnf config-manager --set-enabled crb .. note:: This step may be slightly different depending on the distribution you are using. `Check the EPEL documentation `_ @@ -49,18 +49,18 @@ Install prerequisites There are a few packages that must be installed in order to get and unpack the binary release. -.. code-block:: bash +.. code-block:: console - sudo dnf install tar bzip2 wget -y + $ sudo dnf install tar bzip2 wget -y Install development tools (optional) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you are going to build ROS packages or otherwise do development, you can also install the development tools: -.. code-block:: bash +.. code-block:: console - sudo dnf install -y \ + $ sudo dnf install -y \ cmake \ gcc-c++ \ git \ @@ -77,9 +77,9 @@ If you are going to build ROS packages or otherwise do development, you can also python3-vcstool \ wget - # install some pip packages needed for testing and - # not available as RPMs - python3 -m pip install -U --user \ + ~ install some pip packages needed for testing and + ~ not available as RPMs + $ python3 -m pip install -U --user \ flake8-blind-except==0.1.1 \ flake8-class-newline \ flake8-deprecated @@ -96,22 +96,22 @@ Instead you may download nightly :ref:`prerelease binaries * Unpack it: - .. code-block:: bash + .. code-block:: console - mkdir -p ~/ros2_{DISTRO} - cd ~/ros2_{DISTRO} - tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2 + $ mkdir -p ~/ros2_{DISTRO} + $ cd ~/ros2_{DISTRO} + $ tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2 Install dependencies using rosdep ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. include:: ../_Dnf-Update-Admonition.rst -.. code-block:: bash +.. code-block:: console - sudo rosdep init - rosdep update - rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rti-connext-dds-7.3.0 urdfdom_headers" + $ sudo rosdep init + $ rosdep update + $ rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rti-connext-dds-7.3.0 urdfdom_headers" Install additional RMW implementations (optional) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -124,28 +124,31 @@ Setup environment Set up your environment by sourcing the following file. -.. code-block:: bash +.. code-block:: console - # Replace ".bash" with your shell if you're not using bash - # Possible values are: setup.bash, setup.sh, setup.zsh - . ~/ros2_{DISTRO}/ros2-linux/setup.bash + $ . ~/ros2_{DISTRO}/ros2-linux/setup.bash + +.. note:: + + Replace ``.bash`` with your shell if you're not using bash. + Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``. Try some examples ----------------- In one terminal, source the setup file and then run a C++ ``talker``: -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/ros2-linux/setup.bash - ros2 run demo_nodes_cpp talker + $ . ~/ros2_{DISTRO}/ros2-linux/setup.bash + $ ros2 run demo_nodes_cpp talker In another terminal source the setup file and then run a Python ``listener``: -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/ros2-linux/setup.bash - ros2 run demo_nodes_py listener + $ . ~/ros2_{DISTRO}/ros2-linux/setup.bash + $ ros2 run demo_nodes_py listener You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages. This verifies both the C++ and Python APIs are working properly. @@ -169,6 +172,6 @@ Uninstall 2. If you're also trying to free up space, you can delete the entire workspace directory with: - .. code-block:: bash + .. code-block:: console - rm -rf ~/ros2_{DISTRO} + $ rm -rf ~/ros2_{DISTRO} diff --git a/source/Installation/Alternatives/Ubuntu-Development-Setup.rst b/source/Installation/Alternatives/Ubuntu-Development-Setup.rst index ce46985409..f6f6e9cd50 100644 --- a/source/Installation/Alternatives/Ubuntu-Development-Setup.rst +++ b/source/Installation/Alternatives/Ubuntu-Development-Setup.rst @@ -36,9 +36,9 @@ Enable required repositories Install development tools ^^^^^^^^^^^^^^^^^^^^^^^^^ -.. code-block:: bash +.. code-block:: console - sudo apt update && sudo apt install -y \ + $ sudo apt update && sudo apt install -y \ python3-flake8-blind-except \ python3-flake8-class-newline \ python3-flake8-deprecated \ @@ -61,11 +61,11 @@ Get ROS 2 code Create a workspace and clone all repos: -.. code-block:: bash +.. code-block:: console - mkdir -p ~/ros2_{DISTRO}/src - cd ~/ros2_{DISTRO} - vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src + $ mkdir -p ~/ros2_{DISTRO}/src + $ cd ~/ros2_{DISTRO} + $ vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src .. _linux-development-setup-install-dependencies-using-rosdep: @@ -74,11 +74,11 @@ Install dependencies using rosdep .. include:: ../_Apt-Upgrade-Admonition.rst -.. code-block:: bash +.. code-block:: console - sudo rosdep init - rosdep update - rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-7.3.0 urdfdom_headers" + $ sudo rosdep init + $ rosdep update + $ rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-7.3.0 urdfdom_headers" .. include:: ../_rosdep_Linux_Mint.rst @@ -98,30 +98,33 @@ The output should be empty. More info on working with a ROS workspace can be found in :doc:`this tutorial <../../Tutorials/Beginner-Client-Libraries/Colcon-Tutorial>`. -.. code-block:: bash +.. code-block:: console - cd ~/ros2_{DISTRO}/ - colcon build --symlink-install + $ cd ~/ros2_{DISTRO}/ + $ colcon build --symlink-install .. note:: If you are having trouble compiling all examples and this is preventing you from completing a successful build, you can use the ``--packages-skip`` colcon flag to ignore the package that is causing problems. For instance, if you don't want to install the large OpenCV library, you could skip building the packages that depend on it using the command: - .. code-block:: bash + .. code-block:: console - colcon build --symlink-install --packages-skip image_tools intra_process_demo + $ colcon build --symlink-install --packages-skip image_tools intra_process_demo Setup environment ----------------- Set up your environment by sourcing the following file. -.. code-block:: bash +.. code-block:: console - # Replace ".bash" with your shell if you're not using bash - # Possible values are: setup.bash, setup.sh, setup.zsh - . ~/ros2_{DISTRO}/install/local_setup.bash + $ . ~/ros2_{DISTRO}/install/local_setup.bash + +.. note:: + + Replace ``.bash`` with your shell if you're not using bash. + Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``. .. _talker-listener: @@ -130,17 +133,17 @@ Try some examples In one terminal, source the setup file and then run a C++ ``talker``\ : -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/install/local_setup.bash - ros2 run demo_nodes_cpp talker + $ . ~/ros2_{DISTRO}/install/local_setup.bash + $ ros2 run demo_nodes_cpp talker In another terminal source the setup file and then run a Python ``listener``\ : -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/install/local_setup.bash - ros2 run demo_nodes_py listener + $ . ~/ros2_{DISTRO}/install/local_setup.bash + $ ros2 run demo_nodes_py listener You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages. This verifies both the C++ and Python APIs are working properly. @@ -162,12 +165,12 @@ Clang To configure CMake to detect and use Clang: -.. code-block:: bash +.. code-block:: console - sudo apt install clang - export CC=clang - export CXX=clang++ - colcon build --cmake-force-configure + $ sudo apt install clang + $ export CC=clang + $ export CXX=clang++ + $ colcon build --cmake-force-configure Stay up to date --------------- @@ -187,6 +190,6 @@ Uninstall 2. If you're also trying to free up space, you can delete the entire workspace directory with: - .. code-block:: bash + .. code-block:: console - rm -rf ~/ros2_{DISTRO} + $ rm -rf ~/ros2_{DISTRO} diff --git a/source/Installation/Alternatives/Ubuntu-Install-Binary.rst b/source/Installation/Alternatives/Ubuntu-Install-Binary.rst index 71e7b97212..bcdf9c44c2 100644 --- a/source/Installation/Alternatives/Ubuntu-Install-Binary.rst +++ b/source/Installation/Alternatives/Ubuntu-Install-Binary.rst @@ -44,18 +44,18 @@ Install prerequisites There are a few packages that must be installed in order to get and unpack the binary release. -.. code-block:: bash +.. code-block:: console - sudo apt install tar bzip2 wget -y + $ sudo apt install tar bzip2 wget -y Install development tools (optional) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you are going to build ROS packages or otherwise do development, you can also install the development tools: -.. code-block:: bash +.. code-block:: console - sudo apt update && sudo apt install ros-dev-tools + $ sudo apt update && sudo apt install ros-dev-tools Install ROS 2 ------------- @@ -70,11 +70,11 @@ Instead you may download nightly :ref:`prerelease binaries * Unpack it: - .. code-block:: bash + .. code-block:: console - mkdir -p ~/ros2_{DISTRO} - cd ~/ros2_{DISTRO} - tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2 + $ mkdir -p ~/ros2_{DISTRO} + $ cd ~/ros2_{DISTRO} + $ tar xf ~/Downloads/ros2-package-linux-x86_64.tar.bz2 .. _linux-install-binary-install-missing-dependencies: @@ -83,13 +83,13 @@ Install dependencies using rosdep .. include:: ../_Apt-Upgrade-Admonition.rst -.. code-block:: bash +.. code-block:: console - sudo apt update - sudo apt install -y python3-rosdep - sudo rosdep init - rosdep update - rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rmw_connextdds rti-connext-dds-7.3.0 urdfdom_headers" + $ sudo apt update + $ sudo apt install -y python3-rosdep + $ sudo rosdep init + $ rosdep update + $ rosdep install --from-paths ~/ros2_{DISTRO}/ros2-linux/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastrtps iceoryx_binding_c rmw_connextdds rti-connext-dds-7.3.0 urdfdom_headers" .. include:: ../_rosdep_Linux_Mint.rst @@ -104,28 +104,31 @@ Setup environment Set up your environment by sourcing the following file. -.. code-block:: bash +.. code-block:: console - # Replace ".bash" with your shell if you're not using bash - # Possible values are: setup.bash, setup.sh, setup.zsh - . ~/ros2_{DISTRO}/ros2-linux/setup.bash + $ . ~/ros2_{DISTRO}/ros2-linux/setup.bash + +.. note:: + + Replace ``.bash`` with your shell if you're not using bash. + Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``. Try some examples ----------------- In one terminal, source the setup file and then run a C++ ``talker``: -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/ros2-linux/setup.bash - ros2 run demo_nodes_cpp talker + $ . ~/ros2_{DISTRO}/ros2-linux/setup.bash + $ ros2 run demo_nodes_cpp talker In another terminal source the setup file and then run a Python ``listener``: -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/ros2-linux/setup.bash - ros2 run demo_nodes_py listener + $ . ~/ros2_{DISTRO}/ros2-linux/setup.bash + $ ros2 run demo_nodes_py listener You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages. This verifies both the C++ and Python APIs are working properly. @@ -149,6 +152,6 @@ Uninstall 2. If you're also trying to free up space, you can delete the entire workspace directory with: - .. code-block:: bash + .. code-block:: console - rm -rf ~/ros2_{DISTRO} + $ rm -rf ~/ros2_{DISTRO} diff --git a/source/Installation/Alternatives/Windows-Development-Setup.rst b/source/Installation/Alternatives/Windows-Development-Setup.rst index ff8b88404a..ede1a4717a 100644 --- a/source/Installation/Alternatives/Windows-Development-Setup.rst +++ b/source/Installation/Alternatives/Windows-Development-Setup.rst @@ -35,7 +35,7 @@ We'll use ``C:\dev`` for the rest of these instructions. .. code-block:: console - md C:\dev + $ md C:\dev Increase the Windows maximum path length ---------------------------------------- @@ -46,7 +46,7 @@ Using the powershell session you started above, run the following: .. code-block:: console - New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force + $ New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force You can read more about this limitation in `Microsoft's documentation `__. @@ -64,13 +64,13 @@ Continue using the previous powershell session, and run the following command to .. code-block:: console - irm https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools_2019.exe + $ irm https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools_2019.exe Now install MSVC 2019: .. code-block:: console - .\vs_buildtools_2019.exe --quiet --wait --norestart --add Microsoft.Component.MSBuild --add Microsoft.Net.Component.4.6.1.TargetingPack --add Microsoft.Net.Component.4.8.SDK --add Microsoft.VisualStudio.Component.CoreBuildTools --add Microsoft.VisualStudio.Component.Roslyn.Compiler --add Microsoft.VisualStudio.Component.TextTemplating --add Microsoft.VisualStudio.Component.VC.CLI.Support --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.CoreIde --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools + $ .\vs_buildtools_2019.exe --quiet --wait --norestart --add Microsoft.Component.MSBuild --add Microsoft.Net.Component.4.6.1.TargetingPack --add Microsoft.Net.Component.4.8.SDK --add Microsoft.VisualStudio.Component.CoreBuildTools --add Microsoft.VisualStudio.Component.Roslyn.Compiler --add Microsoft.VisualStudio.Component.TextTemplating --add Microsoft.VisualStudio.Component.VC.CLI.Support --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.CoreIde --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.VCTools .. note:: @@ -91,14 +91,14 @@ Download the pixi configuration file in the existing powershell session: .. code-block:: console - cd C:\dev - irm https://raw.githubusercontent.com/ros2/ros2/refs/heads/{REPOS_FILE_BRANCH}/pixi.toml -OutFile pixi.toml + $ cd C:\dev + $ irm https://raw.githubusercontent.com/ros2/ros2/refs/heads/{REPOS_FILE_BRANCH}/pixi.toml -OutFile pixi.toml Install dependencies: .. code-block:: console - pixi install + $ pixi install You should now close the powershell session, as the rest of the instructions will use the Windows command prompt. @@ -114,7 +114,7 @@ This is required in the command prompt you'll use to compile ROS 2, but it is *n .. code-block:: console - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 + $ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 Source the pixi environment ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,8 +123,8 @@ This is required in every command prompt you open to set up paths to the depende .. code-block:: console - cd C:\dev - pixi shell + $ cd C:\dev + $ pixi shell Get ROS 2 code ^^^^^^^^^^^^^^ @@ -133,16 +133,16 @@ Now that we have the development tools we can get the ROS 2 source code. Setup a development folder, for example ``C:\dev\{DISTRO}``: -.. code-block:: bash +.. code-block:: console - md C:\dev\{DISTRO}\src - cd C:\dev\{DISTRO} + $ md C:\dev\{DISTRO}\src + $ cd C:\dev\{DISTRO} Get the ``ros2.repos`` file which defines the repositories to clone from: -.. code-block:: bash +.. code-block:: console - vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src + $ vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src Install additional RMW implementations (optional) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -157,9 +157,9 @@ Build the code in the workspace To build the ``\{DISTRO}`` folder tree: -.. code-block:: bash +.. code-block:: console - colcon build --merge-install + $ colcon build --merge-install .. note:: @@ -178,17 +178,17 @@ This is required in every command prompt you open to set up paths to the depende .. code-block:: console - cd C:\dev - pixi shell + $ cd C:\dev + $ pixi shell Source the ROS 2 environment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is required in every command prompt you open to setup the ROS 2 workspace: -.. code-block:: bash +.. code-block:: console - call C:\dev\{DISTRO}\install\local_setup.bat + $ call C:\dev\{DISTRO}\install\local_setup.bat This will automatically set up the environment for any DDS vendors that support was built for. @@ -201,9 +201,9 @@ Note that the first time you run any executable you will have to allow access to You can run the tests using this command: -.. code-block:: bash +.. code-block:: console - colcon test --merge-install + $ colcon test --merge-install .. note:: @@ -211,24 +211,24 @@ You can run the tests using this command: Afterwards you can get a summary of the tests using this command: -.. code-block:: bash +.. code-block:: console - colcon test-result + $ colcon test-result To run the examples, first open a clean new ``cmd.exe`` and set up the workspace by sourcing the ``local_setup.bat`` file. Then, run a C++ ``talker``\ : -.. code-block:: bash +.. code-block:: console - call install\local_setup.bat - ros2 run demo_nodes_cpp talker + $ call install\local_setup.bat + $ ros2 run demo_nodes_cpp talker In a separate command prompt you can do the same, but instead run a Python ``listener``\ : -.. code-block:: bash +.. code-block:: console - call install\local_setup.bat - ros2 run demo_nodes_py listener + $ call install\local_setup.bat + $ ros2 run demo_nodes_py listener You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages. This verifies both the C++ and Python APIs are working properly. @@ -261,6 +261,6 @@ Uninstall 2. If you're also trying to free up space, you can delete the entire workspace directory with: - .. code-block:: bash + .. code-block:: console - rmdir /s /q C:\dev\ros2_{DISTRO} + $ rmdir /s /q C:\dev\ros2_{DISTRO} diff --git a/source/Installation/Alternatives/macOS-Development-Setup.rst b/source/Installation/Alternatives/macOS-Development-Setup.rst index 631e9b81aa..5caf23c728 100644 --- a/source/Installation/Alternatives/macOS-Development-Setup.rst +++ b/source/Installation/Alternatives/macOS-Development-Setup.rst @@ -33,14 +33,19 @@ You need the following things installed to build ROS 2: * Note: Versions of Xcode later than 11.3.1 can no longer be installed on macOS Mojave, so you will need to install an older version manually, see: https://stackoverflow.com/a/61046761 * Also, if you don't already have it installed, install the Command Line Tools: - .. code-block:: bash + .. code-block:: console - xcode-select --install - # This command will not succeed if you have not installed Xcode.app - sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer - # If you installed Xcode.app manually, you need to either open it or run: - sudo xcodebuild -license - # To accept the Xcode.app license + $ xcode-select --install + $ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer + + .. note:: + + If you installed Xcode.app manually, you need to accept the Xcode.app license. + You can do this by opening Xcode.app or running: + + .. code-block:: console + + $ sudo xcodebuild -license #. **brew** *(needed to install more stuff; you probably already have this)*: @@ -50,42 +55,42 @@ You need the following things installed to build ROS 2: * *Optional*: Check that ``brew`` is happy with your system configuration by running: - .. code-block:: bash + .. code-block:: console - brew doctor + $ brew doctor Fix any problems that it identifies. #. Use ``brew`` to install more stuff: - .. code-block:: bash + .. code-block:: console - brew install asio assimp bison bullet cmake console_bridge cppcheck \ + $ brew install asio assimp bison bullet cmake console_bridge cppcheck \ cunit eigen freetype graphviz opencv openssl orocos-kdl pcre poco \ pyqt@5 python qt@5 sip spdlog tinyxml2 #. Setup some environment variables: - .. code-block:: bash + .. code-block:: console - # Add the openssl dir for DDS-Security - # if you are using BASH, then replace '.zshrc' with '.bashrc' - echo "export OPENSSL_ROOT_DIR=$(brew --prefix openssl)" >> ~/.zshrc + ~ Add the openssl dir for DDS-Security + ~ if you are using BASH, then replace '.zshrc' with '.bashrc' + $ echo "export OPENSSL_ROOT_DIR=$(brew --prefix openssl)" >> ~/.zshrc - # Add the Qt directory to the PATH and CMAKE_PREFIX_PATH - export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$(brew --prefix qt@5) - export PATH=$PATH:$(brew --prefix qt@5)/bin + ~ Add the Qt directory to the PATH and CMAKE_PREFIX_PATH + $ export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$(brew --prefix qt@5) + $ export PATH=$PATH:$(brew --prefix qt@5)/bin #. Use ``python3 -m pip`` (just ``pip`` may install Python3 or Python2) to install more stuff: - .. code-block:: bash + .. code-block:: console - python3 -m pip install --upgrade pip + $ python3 -m pip install --upgrade pip - python3 -m pip install -U \ + $ python3 -m pip install -U \ --config-settings="--global-option=build_ext" \ --config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \ --config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \ @@ -107,10 +112,10 @@ You need the following things installed to build ROS 2: * When you get to the step where you call ``rosinstall_generator`` to get the source code, here's an alternate invocation that brings in just the minimum required to produce a useful bridge: - .. code-block:: bash + .. code-block:: console - rosinstall_generator catkin common_msgs roscpp rosmsg --rosdistro kinetic --deps --wet-only --tar > kinetic-ros2-bridge-deps.rosinstall - wstool init -j8 src kinetic-ros2-bridge-deps.rosinstall + $ rosinstall_generator catkin common_msgs roscpp rosmsg --rosdistro kinetic --deps --wet-only --tar > kinetic-ros2-bridge-deps.rosinstall + $ wstool init -j8 src kinetic-ros2-bridge-deps.rosinstall Otherwise, just follow the normal instructions, then source the resulting ``install_isolated/setup.bash`` before proceeding here to build ROS 2. @@ -129,11 +134,11 @@ Get ROS 2 code Create a workspace and clone all repos: -.. code-block:: bash +.. code-block:: console - mkdir -p ~/ros2_{DISTRO}/src - cd ~/ros2_{DISTRO} - vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src + $ mkdir -p ~/ros2_{DISTRO}/src + $ cd ~/ros2_{DISTRO} + $ vcs import --input https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos src Install additional RMW implementations (optional) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -146,10 +151,10 @@ Build the code in the workspace Run the ``colcon`` tool to build everything (more on using ``colcon`` in :doc:`this tutorial <../../Tutorials/Beginner-Client-Libraries/Colcon-Tutorial>`): -.. code-block:: bash +.. code-block:: console - cd ~/ros2_{DISTRO}/ - colcon build --symlink-install --packages-skip-by-dep python_qt_binding + $ cd ~/ros2_{DISTRO}/ + $ colcon build --symlink-install --packages-skip-by-dep python_qt_binding Note: due to an unresolved issue with SIP, Qt@5, and PyQt5, we need to disable ``python_qt_binding`` to have the build succeed. This will be removed when the issue is resolved, see: https://github.com/ros-visualization/python_qt_binding/issues/103 @@ -159,9 +164,9 @@ Setup environment Source the ROS 2 setup file: -.. code-block:: bash +.. code-block:: console - . ~/ros2_{DISTRO}/install/setup.zsh + $ . ~/ros2_{DISTRO}/install/setup.zsh This will automatically set up the environment for any DDS vendors that support was built for. @@ -170,15 +175,15 @@ Try some examples In one terminal, set up the ROS 2 environment as described above and then run a C++ ``talker``: -.. code-block:: bash +.. code-block:: console - ros2 run demo_nodes_cpp talker + $ ros2 run demo_nodes_cpp talker In another terminal source the setup file and then run a Python ``listener``: -.. code-block:: bash +.. code-block:: console - ros2 run demo_nodes_py listener + $ ros2 run demo_nodes_py listener You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages. This verifies both the C++ and Python APIs are working properly. @@ -213,6 +218,6 @@ Uninstall 2. If you're also trying to free up space, you can delete the entire workspace directory with: - .. code-block:: bash + .. code-block:: console - rm -rf ~/ros2_{DISTRO} + $ rm -rf ~/ros2_{DISTRO}