The setup makes use of Robostack to install ROS2 and Gazebo natively in a Conda environment - without the need for Docker-containers, Parallels, VMs, etc.
to version 14.x which is required by RoboStack. This in turn requires macOS Sonoma. Update your system to match
2. Install Homebrew
The default install directory for Homebrew on Apple Silicon is /opt/homebrew/
. This doesn't work for our use, make sure to install brew at /usr/local
and NOT at /opt/homebrew/
# install homebrew
cd ~
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# follow the instructions and
# dont forget to paste the two commands
(echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/[YOUR_NAME]/.zprofile
eval "$(/usr/local/bin/brew shellenv)"
Check the installation with
brew doctor
Install conda if you haven't already.
Install mamba package manager (just a fast wrapper around conda). if mamba doesn't work just use conda instead of mamba for all the commands below
# install mamba
conda install mamba -c conda-forge
Create an environment
mamba create -n ros_env
mamba activate ros_env
# this adds the conda-forge channel to the new created environment configuration
conda config --env --add channels conda-forge
# and the robostack channel
conda config --env --add channels robostack-staging
# remove the defaults channel just in case, this might return an error if it is not in the list which is ok
conda config --env --remove channels defaults
and dependencies. See which packages are available pre-built on Robostack.
# re init the environment
mamba deactivate
mamba activate ros_env
# install ros, dependencies, etc.
mamba install ros-humble-desktop
mamba install compilers cmake pkg-config make ninja colcon-common-extensions catkin_tools
NOTE: Has to be installed in the base environment, i.e. call conda deactivate
twice to get from (ros_env) -> (base) -> ( )
conda deactivate
conda deactivate
# install gazebo
curl -ssL http://get.gazebosim.org | sh
brew update && brew upgrade
brew doctor
Create a workspace whereever you want on your local computer
mkdir -p ~/ros2_ws/src
Install packages
mamba install ros-humble-turtlebot3 ros-humble-turtlebot3-gazebo
(Specific for DTU 34761) Download framework
git clone https://github.com/RasmusAndersen/RobotAutonomy.git ~/path/to/your/ws/src
Add commands to script automatically sourced on conda activate.
Find the location of your conda env with conda info -e
Create a file in the directory of where conda stores activation scripts.
touch /path/to/your/conda/envs/ros_env/etc/conda/activate.d/ros_env_activate.sh
Add whatever you want to run on startup to the script ros_env_activate.sh
#!/bin/bash
source ~/ros2_ws/install/setup.zsh
# Add environment variables for ROS and Gazebo
export ROS_DOMAIN_ID=11
export TURTLEBOT3_MODEL=burger
export GAZEBO_MODEL_PATH=
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$(ros2 pkg prefix my_turtlebot)/share/my_turtlebot/models
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:$(ros2 pkg prefix turtlebot3_gazebo)/share/turtlebot3_gazebo/models
Make it executeable with chmod +x ros_env_activate.sh