Agrarsense
Windows install

Documentation

Topic Link
Getting Started Getting Started
Using the Simulator Using the Simulator
Using Vehicles Using Vehicles
Using Walkers Using Walkers
Sensors Sensors
Creating own maps Creating own maps
Building from source on Linux Building on Linux
Building from source on Windows Building on Windows
Installing on Linux Installing on Linux
Installing on Windows Installing on Windows

Download latest AGRARSENSE build

  1. Download latest Simulator build

Navigate to AGRARSENSE Azure Artifact page

Click "1 published" link

Screenshot

This leads to Azure Artifact storage page where you can now download the latest build.

Screenshot

  1. When AgrarsenseBuild.zip has been downloaded, unzip it to any location where you have enough space.
  2. Launch the Simulator by double clicking Agrarsense.exe located in UN_ZIP_PATH/Agrarsense/Windows/

If the Agrarsense.exe asks to install Unreal prerequisites click yes. These are required to run applications made with Unreal Engine.

To communicate between the Simulator and ROS, you need to install ROS with below instructions. If you are just testing the Simulator, ROS is not required to run the Simulator.

ROS related installations

Installing Ubuntu WSL on Windows

Ubuntu WSL is required for the project to be able to communicate between Unreal Engine and ROS.

AGRARSENSE Unreal project will work without a ROS installation but you cannot get or send any data to or from the simulator.

WSL can be installed either from the Microsoft Store (as of November 2022), or from the command line. If installing from the command line won't work, try installing from the Microsoft Store.

Install Ubuntu WSL by putting this command in command prompt.

```sh
wsl --install -d Ubuntu-20.04
```

You can now Launch Ubuntu WLS from start menu or with wsl command to command prompt

Install ROS noetic on WSL Ubuntu

When WSL installation is ready, follow this guide to install ROS.

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
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install ros-noetic-desktop-full -y
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

Install ROSBridge on WSL Ubuntu

https://github.com/code-iai/ROSIntegration states this:

The recommended way to install rosbridge is from source (requires the rosauth package) – Even though you could install rosbridge using apt, there have been numersous issues where these apt packages do not reflect the code in the ros1 branch. Hence, it is best to install from source.

Install from apt packages:

sudo apt-get install ros-noetic-rosauth
sudo apt-get install ros-noetic-rosbridge-suite
echo "alias ROS1='source /opt/ros/noetic/setup.bash'" >> ~/.bashrc

When launching ROS server, you can either launch it manually from Ubuntu WSL Terminal

roslaunch rosbridge_server rosbridge_tcp.launch bson_only_mode:=True

or in windows terminal

wsl -e bash -lic "roslaunch rosbridge_server rosbridge_tcp.launch bson_only_mode:=True

To run python scripts with ROS connection you need to install Python ROS packages:

sudo apt install python3-pip
pip install --extra-index-url https://rospypi.github.io/simple/ rospy
pip install --extra-index-url https://rospypi.github.io/simple/ tf2_ros

If connection doesn't go through from windows to Ubuntu WSL, you need to set **"ROS_IP"** in command prompt.

set ROS_IP=192.168.x.x

When ROS is installed follow this guide to install ROS2 (Foxy).

First, you need to install ROS2 without ros1_bridge.

First Launch new terminal and do following:

locale # check for UTF-8
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
locale # verify settings
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install 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 install -y \
libbullet-dev \
python3-pip \
python3-pytest-cov \
ros-dev-tools
python3 -m pip install -U \
argcomplete \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures \
pytest
sudo apt install --no-install-recommends -y \
libasio-dev \
libtinyxml2-dev
sudo apt install --no-install-recommends -y \
libcunit1-dev
mkdir -p ~/ros2_foxy/src
cd ~/ros2_foxy
vcs import --input https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos src
sudo apt upgrade
sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-5.3.1 urdfdom_headers"
cd ~/ros2_foxy/
colcon build --symlink-install --packages-skip ros1_bridge

After ROS2 is build from source (without ros1_bridge), You need to 'source' both ROS1 and ROS2.

source /opt/ros/noetic/setup.bash
source ~/ros2_foxy/install/setup.bash

then build only ros1_bridge

cd ~/ros2_foxy/
colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure

NOTE: To use ROS1 rosbridge_server, you shouldn't add both ROS1 and ROS2 to ~.bashrc, since it mixes the packages. Instead, use ROS1 as intended and source ROS2 ONLY when needed

echo "alias ROS2='source ~/ros2_foxy/install/setup.bash'" >> ~/.bashrc

By typing ROS2 in terminal, it sources the ROS2 bash file and removes ROS2 alias