create a virtual machine
install ubuntu 22.04 server edition
update and upgrade
install helpful tools
sudo apt install -y net-tools
install ubuntu-desktop-minimal
sudo apt install -y ubuntu-desktop-minimal
install vm guest additions prerequisites
sudo apt install -y gcc make perl
install vm guest additions
restart
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
install cyclone-dds
sudo apt install -y ros-humble-rmw-cyclonedds-cpp
add configuration info to .bashrc:
echo "source /opt/ros/humble/setup.bash" >> .bashrc
echo "RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> .bashrc
install ros-bridge server
sudo apt install -y ros-humble-rosbridge-server
launch rosbridge
ros2 launch rosbridge_server rosbridge_websocket_launch.xml
Publish something using rosbridge
echo it in ROS
ros2 topic list
ros2 topic echo /hadabot/log/info