Agrarsense
|
Topic | Link |
---|---|
Getting Started | Getting Started |
Using the Simulator | Using the Simulator |
Using Vehicles | Using Vehicles |
Using Walkers | Using Walkers |
Sensors | Sensors |
Setupping sensors | Setupping sensor |
Creating own levels | Creating own levels |
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 |
In this section, you will find essential information regarding the system requirements, software installations, and other dependencies necessary before starting the development of AGRARSENSE.
The project directory structure is as follows:
You can either install pre-compiled Unreal Engine 5.3 for Linux by following this guide, or you can install our fork of the Unreal Engine which is preferred.
We have made our own fork of the Unreal Engine where we have made few optimizations to the engine to improve sensors performance.
To install our fork of the engine, you need to have a GitHub account linked to Unreal Engine's account.
Note. Compiling Unreal Engine from source will take ~1-4 hours depending on your CPU!
To build our fork of the Unreal Engine:
1. Clone the repository
2. Navigate to cloned folder:
3. Run the configuration scripts and compile the engine:
If you are installing the Unreal Engine for the first time on your machine, these commands will to prompt register Unreal Engine types and ask for sudo password. Click yes and enter sudo password to be able to compile the engine.
If you modify the Unreal Engine source after first compilation, you must compile the Unreal Engine again with following command. Unreal Engine will only compile the parts you have modified, not the entire Unreal Engine.
In order to AGRARSENSE to find the correct installation of Unreal Engine, we need to set the environment variable.
To set the variable for this session only:
To set the variable so it persists across sessions:
1. Open ~/.bashrc
or ./profile
.
2. Add the following line to the bottom of the file:
3. Save the file and reset the terminal.
1. Clone the repository
2. Navigate to AGRARSENSE Unreal project folder
3. Build AGRARSENSE
To compile and open the Unreal Editor with one command
ROS noetic is required for the project to be able to communicate between Unreal Engine and ROS. The simulator supports ROS2 via ROS1 to ROS2 bridge.
ROS noetic is only offically supported on Ubuntu 18.04 and 20.04. Ubuntu 22.04 doesn't offically support ROS noetic.
AGRARSENSE Unreal project will work without a ROS installation but you cannot get or send any data to or from the simulator.
Install ROS noetic
Install ROSBridge
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.
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: ```sh 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. ```sh 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.
Launch new terminal ``` 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
source /opt/ros/noetic/setup.bash source ~/ros2_foxy/install/setup.bash
cd ~/ros2_foxy/ colcon build –symlink-install –packages-select ros1_bridge –cmake-force-configure
echo "alias ROS2='source ~/ros2_foxy/install/setup.bash'" >> ~/.bashrc
rviz is short for ROS Visualization. It's easy way visualize ROS messages, for example camera images and Lidar pointclouds.
To create packaged shipping build for disturbution, you can either:
A. Create package without opening the Unreal Editor with following command. This script packages the project into ./Build folder
B. or launch the Unreal Editor with following command and create the package in the Unreal Editor.
Maps to include in the packaged build is defined in DefaultGame.ini file.
When modifying Blueprints or Widget Blueprints in Unreal Editor, simply click compile and save in the Unreal Editor as in with any Unreal project.
When modifying AGRARSENSE Unreal project C++ source or plugins C++ source, you must close the Unreal Editor, compile C++ and then open the Unreal Editor again or else changes will not take effect. This can be done with same scripts as above.
Note. Unreal Engine does support compiling C++ in Unreal Editor through Live Coding but your experience may vary.
To compile and open the Unreal Editor with one command:
To just compile C++ source and plugins: