Install ROS on macOS - umrover/mrover-ros2 GitHub Wiki
Overview
Although it is not officially supported, we have had success using RoboStack to provide ROS packages.
Steps
- Install homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install miniforge:
brew install miniforge
. Runconda init "$(basename "${SHELL}")"
. Restart your shell. Runmamba init zsh
. Restart your shell again. Now you should see "base" in your prompt. We recommend addingmamba deactivate
to the end of your.zshrc
to preserve your Python environment previous to the install. - Install Git LFS:
brew install git-lfs
. You should rungit lfs install
afterward. - Run
mkdir -p ~/ros2_ws/src
and change directory to it withcd ~/ros2_ws/src
- Ensure you have your Git credentials set up. Clone the repository with:
git clone [email protected]:umrover/mrover-ros2.git mrover
- Ensure you are in the mrover repository:
cd ~/ros2_ws/src/mrover
- Create the virtual environment, activate it, and configure it (it is OK if the last command complains):
mamba create python=3.11 -n ros2_env
mamba activate ros2_env
conda config --env --add channels robostack-staging
- Now you should see "ros2_env" somewhere in your prompt.
- Install needed packages:
mamba install ros-humble-rviz2 ros-humble-ros-base ros-humble-xacro colcon-common-extensions
mamba install clangxx ccache ninja cmake pkg-config opencv assimp bullet glfw boost
- Update submodules:
git submodule init && git submodule update
- Build dawn:
CC=/usr/bin/clang CXX=/usr/bin/clang++ ./scripts/build_dawn.sh
- Install Python dependencies:
pip3 install -e ".[dev]"
cd ~/ros2_ws/src/mrover
and do./build.sh
Every time you open a shell, you need to run: mamba activate ros2_env && source ~/ros2_ws/install/setup.zsh
Optionally you can add the following line to the end of ~/.zshrc
for a shortcut
alias mrover="cd ~/ros2_ws/src/mrover && mamba activate ros2_env && source ~/ros2_ws/install/setup.zsh"
After adding and restarting your shell once, you should now be able to run mrover
from anywhere to navigate to the repository, activate the virtual environment and source the setup script.
To test your robostock ROS2 install, inside your shell run:
ros2 launch mrover simulator.launch.py