AkulaControl is a package for controlling skid steering robot, obtaining data from Velodyne VLP-16 lidar, Basler camera and encoders and publishing everything through ROS2 Foxy. The package is consisted of the main server (DesktopServer), stm32f407 board firmware (STM32), mobile control UI (AndroidApp) and ROS2 package (AkulaPackageROS2). It is quite easy to adapt this code to any sensors you want to use or even platforms due to modules separation and the fact that communication between them is packet-based.
Start obtaining dependencies with
sudo apt update
- libyaml-cpp-dev
- dSocket (already included as a reference)
- cmake (version >= 3.16)
- gcc, g++ (version >= 9.3.0)
- arm-none-eabi-g++, arm-none-eabi-gcc (version >= 9.2.1)
- (optional) basler-ros2-driver (if you need this camera, otherwise exclude it from the Main.launch.py and from AkulaSensorsRecord.sh that currently obtains images from Basler while recording)
- (optional) velodyne (if you need a ros2 node for this lidar, otherwise exclude it from the Main.launch.py and from AkulaSensorsRecord.sh that currently obtains data from Velodyne while recording)
For some tools you can change CMakeLists.txt files to check whether building works for older versions.
Recursive flag is required for obtaining dSocket library
git clone --recurse-submodules https://github.com/MobileRoboticsSkoltech/AkulaControl.git
- Install dependencies:
sudo apt install build-essential cmake libyaml-cpp-dev
- Build the project:
cd path/to/AkulaControl/DesktopServer
mkdir build
cd build
cmake ..
make -j
The project can also be easily opened with any IDE that supports cmake (Clion, for example).
1a. The easiest way to build the project is to use STM32CubeIDE with STM32CubeMX that can build and flash the hardware.
1b. If you want to avoid using any of the IDEs, you need to setup a toolchain for cross-compilation. For that obtain ARM compilers:
sudo apt install gcc-arm-none-eabi
2b. Build the project:
cd path/to/AkulaControl/STM32
mkdir build
cd build
cmake ..
make -j
3b. Upload the firmware to a stm32 board with your tool of choice.
?b. Method b was tested after setting up STM32CubeMX that automatically installs all the tools, so, toolchain setup can possibly require more effort
1a. The easiest way to build the project is to use Android Studio.
2a. Change local.properties file providing path to your Android SDK
3a. To sign your app folow these instructions: https://developer.android.com/studio/publish/app-signing
1b. If you want to avoid using any of the IDEs, you need to install JDK and manually setup gradle:
sudo apt install openjdk-8-jdk
2b. Build the project:
cd path/to/AkulaControl/AndroidApp
./gradlew assembleRelease
3b. To sign your app folow these instructions: https://developer.android.com/studio/build/building-cmdline
?b. Method b was tested after setting up Android Studio that automatically configures gradle and all related stuff, so, the actual build can possibly require more effort
- Create a soft link of the AkulaPackageROS2 to your ROS2 environment (lower snake_case is due to some ROS restrictions):
ln -s /global/path/to/AkulaPackageROS2 /global/path/to/env/src/akula_package
- (optional) If you want to use Basler camera, clone the repository (https://github.com/MobileRoboticsSkoltech/basler_ros2_driver) and create a soft link to it inside your ROS environment source directory:
git clone https://github.com/MobileRoboticsSkoltech/basler_ros2_driver.git
ln -s /global/path/to/basler_ros2_driver /global/path/to/env/src/basler_ros2_driver
- (optional) If you want to use Velodyne lidar, clone the ros2 branch from the repository (https://github.com/ros-drivers/velodyne) and create a soft link to it inside your ROS environment source directory:
git clone -b ros2 --single-branch https://github.com/ros-drivers/velodyne.git
ln -s /global/path/to/velodyne /global/path/to/env/src/velodyne
- Build everything using colcon:
colcon build --symlink-install
- Download firmware to you stm32f407 board.
- Download Android app to your smartphone.
- In the config directory change control.yaml file for your configuration (if you have exactly the same setup, you don't need to change this config).
- Start DesktopServer executable.
- Connect stm32f407 to your PC using micro-USB cable (if you don't have external power for the board, also connect mini-USB cable to power it from PC).
- Open Android app, pull the top slider down, fill in the address of your PC in the wireless network and press Request button.
- If everything works correctly, you will have green and yellow virtual LEDs in enable state - now you can control the robot.