Skip to content

Latest commit

 

History

History
183 lines (127 loc) · 5.39 KB

InstallMowgli.md

File metadata and controls

183 lines (127 loc) · 5.39 KB

Install ROS Noetic + Mowgli + OpenMower on Ubuntu 20.04 Server on a Raspi

Required Items

  • Raspi 4
  • 32GB or better SD Card
  • USB Keyboard
  • Mini HDMI to XXX adapter and a monitor
  • WLAN credentials and internet connectivity
  • A PC running Ubuntu 20.04 (for Magentometer Calibration) or untested by me it should run on the Raspi4 as well.

Install Ubuntu 20.04 Server

Configure NTP

Set your local timezone ..

sudo timedatectl set-timezone Europe/Vienna
sudo timedatectl set-ntp on

Stop auto updates (from interfering)

sudo systemctl stop --force unattended-upgrades.service

Remove snapd

sudo snap remove --purge lxd
sudo snap remove --purge core20
sudo snap remove --purge snapd
sudo apt -y remove --autoremove snapd

Update Ubuntu to latest version

sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install curl git

Perform steps: 1.2, 1.3

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

For step: 1.4 use the ROS-Base (Bare Bones) option

sudo apt update
sudo apt install -y ros-noetic-ros-base

Perform step: 1.5

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
echo "source ~/MowgliRover/devel/setup.bash" >> ~/.bashrc

Install ROS packages and other good stuff that Mowgli and OM will need

sudo apt-get -y install g++ cpp cmake ros-noetic-tf2-eigen ros-noetic-teleop-twist-keyboard ros-noetic-robot-state-publisher ros-noetic-joint-state-publisher ros-noetic-map-server ros-noetic-rosserial-server ros-noetic-gps-common picocom libraspberrypi-bin  ros-noetic-tf2-geometry-msgs ros-noetic-robot-localization libraspberrypi-dev libraspberrypi0 libpigpiod-if-dev wavemon ros-noetic-rosserial-arduino python3-paho-mqtt openocd python3-rosdep ros-noetic-rtcm-msgs libxml2-utils

Add some alias helpers to ~/.bashrc

alias depit="rosdep install --from-paths src --ignore-src -r -y"
alias debug="picocom -b 115200 /dev/ttyAMA1"
alias vbat="rostopic echo -n 1 /mowgli/status/v_battery | head -1"

Configure ROS Core IP (in /opt/ros/noetic/setup.bash)

<your-rover-ip> is your static ip address for the raspi. add the export ROS_IP, ROS_MASTER_URI to your setup.bash file

export ROS_IP=<your-rover-ip>
export ROS_MASTER_URI=http://localhost:11311

CATKIN_SHELL=bash

Installing Mowgli, OpenMower and dependencies

Clone MowgliRover Repo

cd ~
git clone https://github.com/cloudn1ne/MowgliRover.git

Make catkin_workspace (in ~/MowgliRover), Clone submodules for MowgliRover

cd ~/MowgliRover/
. /opt/ros/noetic/setup.bash
git submodule update --init --recursive

Install ROS dependencies

cd ~/MowgliRover/
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -r -y

Build Mowgli, OM, RobotLocalization, ...

Note: Create a swap file around 4G in size if you have less than 4G memory or compiles will fail (and take ages). I managed to (test) compile this on a Raspi3 that way, but i have not actually tried to run it with a real bot.

./scripts/build_all.sh

Login again to source your ~/.bashrc

or run

. ~/.bashrc 

Plugin the YF Mainboard with Mowgli usbnode installed via USB

Your YF mainbord needs to run https://github.com/cloudn1ne/Mowgli/tree/main/stm32/ros_usbnode

**You need to run a version released after 20th Sept 2022 as only those will include the required srvs and topics !!!) - it will not work with an older version **

In general its a good idea to update Mowgli (stm32) whenever there is a new release because some feature enhancements on MowgliRover will need new stm32 code (or fixes there). Hopefully a version system will soon be working that will tell you that your Mowgli (stm32) is too old when running MowgliRover.

See https://github.com/cloudn1ne/Mowgli for more information how to do that.

Install the roscore and rosserial service scripts

cd ~/MowgliRover/scripts/systemctl
./install.sh

usbreset will be installed as /usr/bin/usbreset - which is used to reset Mowgli in case of a reflash, or other connection errors (rosserial_watchdog)

Remove some useless stuff to lighten the load on the Raspi

sudo apt-get remove --purge pulseaudio
sudo systemctl disable ModemManager
sudo systemctl stop ModemManager

Reboot

sudo reboot

Install complete

If your Raspi comes back, then congratulations you are now ready to configure Mowgli and Openmower

See here for the next steps