Running Ros2 on an ESP32

Virtualbox guest master setup

  1. create a virtual machine

    1. Networking: Select bridged networking
  2. install ubuntu 22.04 server edition

  3. update and upgrade

  4. remove firefox and snapd

  5. install helpful tools

    sudo apt install -y net-tools
    
  6. install ubuntu-desktop-minimal

    sudo apt install -y ubuntu-desktop-minimal
    
  7. install vm guest additions prerequisites

    sudo apt install -y gcc make perl
    
  8. install vm guest additions

    1. go to virtualbox menu and select “install guest additions”
    2. navigate to the cdrom and run autorun.sh
  9. restart

  10. Install ROS2

    sudo apt install -y software-properties-common
    sudo add-apt-repository universe
    sudo apt update && sudo apt install -y curl
    sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
    sudo apt update && sudo apt upgrade -y
    sudo apt install -y ros-humble-desktop ros-dev-tools
    
  11. install cyclone-dds

    sudo apt install -y ros-humble-rmw-cyclonedds-cpp
    
  12. add configuration info to .bashrc:

    echo "source /opt/ros/humble/setup.bash" >> .bashrc
    echo "RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> .bashrc
    
  13. install ros-bridge server

    sudo apt install -y ros-humble-rosbridge-server 
    
  14. launch rosbridge

    ros2 launch rosbridge_server rosbridge_websocket_launch.xml 
    
  15. Publish something using rosbridge

  16. echo it in ROS

    ros2 topic list 
    ros2 topic echo /hadabot/log/info 
    

External resources